--- parser3/src/include/pa_common.h 2003/03/21 16:16:43 1.89.2.13.2.6 +++ parser3/src/include/pa_common.h 2003/07/24 11:31:21 1.93 @@ -8,14 +8,13 @@ #ifndef PA_COMMON_H #define PA_COMMON_H -static const char* IDENT_COMMON_H="$Date: 2003/03/21 16:16:43 $"; - +static const char* IDENT_COMMON_H="$Date: 2003/07/24 11:31:21 $"; #include "pa_string.h" #include "pa_hash.h" class Value; -typedef Hash HashStringValue; +typedef Hash HashStringValue; // replace system s*nprintf with our versions #undef vsnprintf @@ -57,29 +56,6 @@ inline long lseek( int handle, long offs #endif -#ifdef HAVE_TRUNC -# ifndef trunc -extern "C" double trunc(double); -# endif -#else -inline double trunc(double param) { return param > 0? floor(param) : ceil(param); } -#endif - -#ifdef HAVE_ROUND -# ifndef round -extern "C" double round(double); -# endif -#else -inline double round(double param) { return floor(param+0.5); } -#endif -#ifdef HAVE_SIGN -# ifndef sign -extern "C" double sign(double); -# endif -#else -inline double sign(double param) { return param > 0 ? 1 : ( param < 0 ? -1 : 0 ); } -#endif - /// yields to OS for secs secs and usecs milliseconds int pa_sleep(unsigned long secs, unsigned long usecs); @@ -87,8 +63,8 @@ int pa_sleep(unsigned long secs, unsigne can't say that about other systems/ line break styles */ void fix_line_breaks( - char *buf, - size_t& size ///< may change! used to speedup next actions + char *str, + size_t& length///< may change! used to speedup next actions ); typedef void (*File_read_action)( @@ -116,7 +92,7 @@ bool file_read_action_under_lock(const S @returns true if read OK */ -char *file_read_text(Charset& charset, +char *file_read_text(Request_charsets& charsets, const String& file_spec, bool fail_on_read_problem=true, HashStringValue* options=0/*, HashStringValue* * out_fields=0*/); @@ -135,7 +111,7 @@ struct File_read_result { @returns true if read OK */ -File_read_result file_read(Charset& charset, +File_read_result file_read(Request_charsets& charsets, const String& file_spec, bool as_text, HashStringValue* options=0, @@ -206,13 +182,6 @@ char *lsplit(char **string_ref,char deli char *rsplit(char *string, char delim); const char* format(double value, char *fmt); -#ifndef max -inline int max(int a, int b) { return a>b?a:b; } -inline int min(int a, int b){ return ab?a:b; } -inline size_t min(size_t a, size_t b){ return a