--- parser3/src/include/pa_common.h 2016/12/26 15:56:35 1.170 +++ parser3/src/include/pa_common.h 2017/02/07 22:00:32 1.174 @@ -1,14 +1,14 @@ /** @file Parser: commonly used functions. - Copyright (c) 2001-2015 Art. Lebedev Studio (http://www.artlebedev.com) + Copyright (c) 2001-2017 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_COMMON_H #define PA_COMMON_H -#define IDENT_PA_COMMON_H "$Id: pa_common.h,v 1.170 2016/12/26 15:56:35 moko Exp $" +#define IDENT_PA_COMMON_H "$Id: pa_common.h,v 1.174 2017/02/07 22:00:32 moko Exp $" #include "pa_string.h" #include "pa_hash.h" @@ -77,6 +77,21 @@ int pa_snprintf(char *, size_t, const ch # define strncasecmp _strnicmp #endif +#define stat __stat64 +#define pa_fstat _fstat64 + +int pa_stat(const char *pathname, struct stat *buffer); +int pa_open(const char *pathname, int flags, int mode=0); +FILE *pa_fopen(const char *pathname, const char *mode); + +#else + +#define pa_stat stat +#define pa_fstat fstat + +#define pa_open open +#define pa_fopen fopen + #endif /** @@ -204,6 +219,7 @@ const String* file_exist(const String& p bool file_executable(const String& file_spec); bool file_stat(const String& file_spec, uint64_t& rsize, time_t& ratime, time_t& rmtime, time_t& rctime, bool fail_on_read_problem=true); +size_t check_file_size(uint64_t size, const String& file_spec); size_t stdout_write(const void *buf, size_t size);