--- parser3/src/include/pa_common.h 2016/07/29 13:30:41 1.166 +++ parser3/src/include/pa_common.h 2016/12/26 15:56:35 1.170 @@ -8,7 +8,7 @@ #ifndef PA_COMMON_H #define PA_COMMON_H -#define IDENT_PA_COMMON_H "$Id: pa_common.h,v 1.166 2016/07/29 13:30:41 moko Exp $" +#define IDENT_PA_COMMON_H "$Id: pa_common.h,v 1.170 2016/12/26 15:56:35 moko Exp $" #include "pa_string.h" #include "pa_hash.h" @@ -55,11 +55,11 @@ typedef HASH_STRING HashStringVa // replace system s*nprintf with our versions #undef vsnprintf -int __vsnprintf(char *, size_t, const char* , va_list); -#define vsnprintf __vsnprintf +int pa_vsnprintf(char *, size_t, const char* , va_list); +#define vsnprintf pa_vsnprintf #undef snprintf -int __snprintf(char *, size_t, const char* , ...); -#define snprintf __snprintf +int pa_snprintf(char *, size_t, const char* , ...); +#define snprintf pa_snprintf #ifdef _MSC_VER @@ -203,7 +203,7 @@ bool dir_exists(const String& file_spec) const String* file_exist(const String& path, const String& name); bool file_executable(const String& file_spec); -bool file_stat(const String& file_spec, size_t& rsize, time_t& ratime, time_t& rmtime, time_t& rctime, bool fail_on_read_problem=true); +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 stdout_write(const void *buf, size_t size); @@ -260,8 +260,8 @@ char* pa_base64_encode(const String& fil const char *pa_idna_encode(const char *in, Charset &source); const char *pa_idna_decode(const char *in, Charset &source); -const unsigned long pa_crc32(const char *in, size_t in_size); -const unsigned long pa_crc32(const String& file_spec); +unsigned long pa_crc32(const char *in, size_t in_size); +unsigned long pa_crc32(const String& file_spec); /** Mix functions @@ -269,15 +269,6 @@ const unsigned long pa_crc32(const Strin #define PA_DEFAULT(A,B) ((A) ? (A):(B) ) -// some stuff for use with .for_each -static void copy_all_overwrite_to(HashStringValue::key_type key, HashStringValue::value_type value, HashStringValue* dest) { - dest->put(key, value); -} - -static void remove_key_from(HashStringValue::key_type key, HashStringValue::value_type /*value*/, HashStringValue* dest) { - dest->remove(key); -} - Charset* detect_charset(const char* content_type); // globals