--- parser3/src/include/pa_common.h 2020/10/14 21:22:58 1.181 +++ parser3/src/include/pa_common.h 2020/12/03 22:48:09 1.185 @@ -8,7 +8,7 @@ #ifndef PA_COMMON_H #define PA_COMMON_H -#define IDENT_PA_COMMON_H "$Id: pa_common.h,v 1.181 2020/10/14 21:22:58 moko Exp $" +#define IDENT_PA_COMMON_H "$Id: pa_common.h,v 1.185 2020/12/03 22:48:09 moko Exp $" #include "pa_string.h" #include "pa_hash.h" @@ -82,6 +82,8 @@ int pa_stat(const char *pathname, struct int pa_open(const char *pathname, int flags, int mode=0); FILE *pa_fopen(const char *pathname, const char *mode); +#define pa_lseek _lseeki64 + #else #define pa_stat stat @@ -90,6 +92,8 @@ FILE *pa_fopen(const char *pathname, con #define pa_open open #define pa_fopen fopen +#define pa_lseek lseek + #endif /** @@ -141,7 +145,7 @@ struct File_read_result { if fail_on_read_problem is true[default] throws an exception */ -File_read_result file_read_binary(const String& file_spec, bool fail_on_read_problem = true, char* buf = 0, size_t offset = 0, size_t limit = 0); +File_read_result file_read_binary(const String& file_spec, bool fail_on_read_problem = true, char* buf = 0, uint64_t offset = 0, size_t limit = 0); /** load specified file @@ -245,6 +249,9 @@ int remove_crlf(char *start, char *end); inline bool pa_isalpha(unsigned char c) { return (((c>='A') && (c<='Z')) || ((c>='a') && (c<='z'))); } inline bool pa_isalnum(unsigned char c) { return (((c>='0') && (c<='9')) || pa_isalpha(c)); } +char *pa_strcat(const char *a, const char *b, const char *c = 0); +const char *pa_filename(const char *path); + const char* capitalize(const char* s); char *str_lower(const char *s, size_t helper_length=0); char *str_upper(const char *s, size_t helper_length=0);