--- parser3/src/include/pa_common.h 2003/03/20 08:11:13 1.89.2.13.2.3 +++ parser3/src/include/pa_common.h 2003/04/07 15:32:57 1.89.2.13.2.10 @@ -8,16 +8,14 @@ #ifndef PA_COMMON_H #define PA_COMMON_H -static const char* IDENT_COMMON_H="$Date: 2003/03/20 08:11:13 $"; +static const char* IDENT_COMMON_H="$Date: 2003/04/07 15:32:57 $"; #include "pa_string.h" #include "pa_hash.h" -//#include "pa_value.h" -//typedef Hash HashStringValue; - -class HashStringValue; +class Value; +typedef Hash HashStringValue; // replace system s*nprintf with our versions #undef vsnprintf @@ -59,29 +57,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); @@ -89,8 +64,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)( @@ -125,7 +100,7 @@ char *file_read_text(Charset& charset, struct File_read_result { bool success; - char* data; size_t size; + char* str; size_t length; HashStringValue* headers; }; @@ -186,7 +161,7 @@ bool entry_exists(const char* fname, str bool entry_exists(const String& file_spec); bool file_readable(const String& file_spec); bool dir_readable(const String& file_spec); -const String* file_readable(String& path, String& name); +const String* file_readable(const String& path, const String& name); bool file_executable(const String& file_spec); bool file_stat(const String& file_spec, @@ -236,6 +211,10 @@ int getMonthDays(int year, int month); void remove_crlf(char *start, char *end); +#ifdef PA_SAFE_MODE +void check_safe_mode(stat finfo, const String& file_spec, const char* fname); +#endif + // globals extern const String file_status_name;