| 
									
										
										
										
											2017-09-30 10:44:03 -04:00
										 |  |  | /*********************************************************************************************************************************** | 
					
						
							|  |  |  | C to Perl Interface | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | The following C types are mapped by the current typemap: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 'AV *', 'Boolean', 'CV *', 'FILE *', 'FileHandle', 'HV *', 'I16', 'I32', 'I8', 'IV', 'InOutStream', 'InputStream', 'NV', | 
					
						
							|  |  |  | 'OutputStream', 'PerlIO *', 'Result', 'STRLEN', 'SV *', 'SVREF', 'SysRet', 'SysRetLong', 'Time_t *', 'U16', 'U32', 'U8', 'UV', | 
					
						
							|  |  |  | 'bool', 'bool_t', 'caddr_t', 'char', 'char *', 'char **', 'const char *', 'double', 'float', 'int', 'long', 'short', 'size_t', | 
					
						
							|  |  |  | 'ssize_t', 'time_t', 'unsigned', 'unsigned char', 'unsigned char *', 'unsigned int', 'unsigned long', 'unsigned long *', | 
					
						
							|  |  |  | 'unsigned short', 'void *', 'wchar_t', 'wchar_t *' | 
					
						
							|  |  |  | ***********************************************************************************************************************************/ | 
					
						
							| 
									
										
										
										
											2016-12-12 18:54:07 -05:00
										 |  |  | #define PERL_NO_GET_CONTEXT | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-09-30 10:44:03 -04:00
										 |  |  | /*********************************************************************************************************************************** | 
					
						
							|  |  |  | Perl includes | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Order is critical here so don't change it. | 
					
						
							|  |  |  | ***********************************************************************************************************************************/ | 
					
						
							| 
									
										
										
										
											2017-11-06 22:55:34 -05:00
										 |  |  | #if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ > 8 || (__GNUC_MINOR__ == 8 && __GNUC_PATCHLEVEL__ >= 0))) | 
					
						
							|  |  |  |     #define WARNING_MAYBE_INITIALIZED 1 | 
					
						
							|  |  |  | #elif __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ > 6 || (__GNUC_MINOR__ == 6 && __GNUC_PATCHLEVEL__ >= 0))) | 
					
						
							|  |  |  |     #define WARNING_INITIALIZED 1 | 
					
						
							|  |  |  | #endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #if WARNING_MAYBE_INITIALIZED | 
					
						
							|  |  |  |     #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" | 
					
						
							|  |  |  | #elif WARNING_INITIALIZED | 
					
						
							|  |  |  |     #pragma GCC diagnostic ignored "-Wuninitialized" | 
					
						
							|  |  |  | #endif | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-22 12:53:08 -04:00
										 |  |  | #pragma GCC diagnostic ignored "-Wsign-conversion" | 
					
						
							|  |  |  | #pragma GCC diagnostic ignored "-Wconversion" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-09-30 10:44:03 -04:00
										 |  |  | #include <XSUB.h> | 
					
						
							|  |  |  | #include <EXTERN.h> | 
					
						
							|  |  |  | #include <perl.h> | 
					
						
							| 
									
										
										
										
											2016-12-12 18:54:07 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-22 12:53:08 -04:00
										 |  |  | #if WARNING_MAYBE_INITIALIZED | 
					
						
							|  |  |  |     #pragma GCC diagnostic warning "-Wmaybe-uninitialized" | 
					
						
							|  |  |  | #elif WARNING_INITIALIZED | 
					
						
							|  |  |  |     #pragma GCC diagnostic warning "-Wuninitialized" | 
					
						
							| 
									
										
										
										
											2017-11-06 22:55:34 -05:00
										 |  |  | #endif | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-09-30 10:44:03 -04:00
										 |  |  | /*********************************************************************************************************************************** | 
					
						
							|  |  |  | C includes | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | These includes are from the src directory.  There is no Perl-specific code in them. | 
					
						
							|  |  |  | ***********************************************************************************************************************************/ | 
					
						
							| 
									
										
										
										
											2017-10-16 10:09:56 -04:00
										 |  |  | #include "common/error.h" | 
					
						
							| 
									
										
										
										
											2018-04-11 09:36:12 -04:00
										 |  |  | #include "common/lock.h" | 
					
						
							| 
									
										
										
										
											2017-09-30 10:44:03 -04:00
										 |  |  | #include "config/config.h" | 
					
						
							| 
									
										
										
										
											2017-11-02 08:14:13 -04:00
										 |  |  | #include "config/define.h" | 
					
						
							| 
									
										
										
										
											2018-02-05 12:32:30 -05:00
										 |  |  | #include "config/load.h" | 
					
						
							| 
									
										
										
										
											2018-04-13 16:05:52 -04:00
										 |  |  | #include "config/parse.h" | 
					
						
							| 
									
										
										
										
											2018-11-06 20:04:16 -05:00
										 |  |  | #include "crypto/crypto.h" | 
					
						
							| 
									
										
										
										
											2018-02-14 09:49:01 -05:00
										 |  |  | #include "perl/config.h" | 
					
						
							| 
									
										
										
										
											2017-09-30 10:44:03 -04:00
										 |  |  | #include "postgres/pageChecksum.h" | 
					
						
							| 
									
										
										
										
											2018-09-13 18:58:22 -04:00
										 |  |  | #include "storage/driver/posix/storage.h" | 
					
						
							| 
									
										
										
										
											2017-09-30 10:44:03 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-16 10:47:31 -04:00
										 |  |  | /*********************************************************************************************************************************** | 
					
						
							|  |  |  | Helper macros | 
					
						
							|  |  |  | ***********************************************************************************************************************************/ | 
					
						
							|  |  |  | #include "LibC.h" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-18 11:14:26 -04:00
										 |  |  | /*********************************************************************************************************************************** | 
					
						
							|  |  |  | XSH includes | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | These includes define data structures that are required for the C to Perl interface but are not part of the regular C source. | 
					
						
							|  |  |  | ***********************************************************************************************************************************/ | 
					
						
							| 
									
										
										
										
											2018-06-11 10:53:16 -04:00
										 |  |  | #include "xs/crypto/cipherBlock.xsh" | 
					
						
							| 
									
										
										
										
											2018-06-11 14:52:26 -04:00
										 |  |  | #include "xs/crypto/hash.xsh" | 
					
						
							| 
									
										
										
										
											2017-10-18 11:14:26 -04:00
										 |  |  | #include "xs/common/encode.xsh" | 
					
						
							| 
									
										
										
										
											2017-11-06 22:55:34 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-09-30 10:44:03 -04:00
										 |  |  | /*********************************************************************************************************************************** | 
					
						
							|  |  |  | Module definition | 
					
						
							|  |  |  | ***********************************************************************************************************************************/ | 
					
						
							| 
									
										
										
										
											2017-08-25 16:47:47 -04:00
										 |  |  | MODULE = pgBackRest::LibC PACKAGE = pgBackRest::LibC | 
					
						
							|  |  |  | PROTOTYPES: DISABLE | 
					
						
							| 
									
										
										
										
											2016-12-12 18:54:07 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-22 12:53:08 -04:00
										 |  |  | # Return UVSIZE to ensure that this Perl supports 64-bit integers | 
					
						
							| 
									
										
										
										
											2017-08-25 16:47:47 -04:00
										 |  |  | # ---------------------------------------------------------------------------------------------------------------------------------- | 
					
						
							| 
									
										
										
										
											2018-05-22 12:53:08 -04:00
										 |  |  | I32 | 
					
						
							|  |  |  | libcUvSize() | 
					
						
							|  |  |  | CODE: | 
					
						
							|  |  |  |     RETVAL = UVSIZE; | 
					
						
							|  |  |  | OUTPUT: | 
					
						
							|  |  |  |     RETVAL | 
					
						
							| 
									
										
										
										
											2017-11-06 22:55:34 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-09-17 15:52:19 -04:00
										 |  |  | # Exported functions and modules | 
					
						
							| 
									
										
										
										
											2017-09-30 10:44:03 -04:00
										 |  |  | # | 
					
						
							|  |  |  | # These modules should map 1-1 with C modules in src directory. | 
					
						
							| 
									
										
										
										
											2017-08-25 16:47:47 -04:00
										 |  |  | # ---------------------------------------------------------------------------------------------------------------------------------- | 
					
						
							| 
									
										
										
										
											2017-10-18 11:14:26 -04:00
										 |  |  | INCLUDE: xs/common/encode.xs | 
					
						
							| 
									
										
										
										
											2018-04-11 09:36:12 -04:00
										 |  |  | INCLUDE: xs/common/lock.xs | 
					
						
							| 
									
										
										
										
											2017-09-17 15:52:19 -04:00
										 |  |  | INCLUDE: xs/config/config.xs | 
					
						
							| 
									
										
										
										
											2018-02-05 12:32:30 -05:00
										 |  |  | INCLUDE: xs/config/configTest.xs | 
					
						
							| 
									
										
										
										
											2017-11-02 08:14:13 -04:00
										 |  |  | INCLUDE: xs/config/define.xs | 
					
						
							| 
									
										
										
										
											2018-06-11 10:53:16 -04:00
										 |  |  | INCLUDE: xs/crypto/cipherBlock.xs | 
					
						
							| 
									
										
										
										
											2018-06-11 14:52:26 -04:00
										 |  |  | INCLUDE: xs/crypto/hash.xs | 
					
						
							| 
									
										
										
										
											2018-06-11 10:53:16 -04:00
										 |  |  | INCLUDE: xs/crypto/random.xs | 
					
						
							| 
									
										
										
										
											2017-09-17 15:52:19 -04:00
										 |  |  | INCLUDE: xs/postgres/pageChecksum.xs | 
					
						
							| 
									
										
										
										
											2018-04-11 08:21:09 -04:00
										 |  |  | INCLUDE: xs/storage/storage.xs |