|
|
| version 1.80, 2002/08/15 12:05:36 | version 1.87, 2002/11/29 08:06:59 |
|---|---|
| Line 13 static const char* IDENT_COMMON_H="$Date | Line 13 static const char* IDENT_COMMON_H="$Date |
| #include "pa_pool.h" | #include "pa_pool.h" |
| #include "pa_string.h" | #include "pa_string.h" |
| class Hash; | |
| class Value; | class Value; |
| // replace system s*nprintf with our versions | // replace system s*nprintf with our versions |
| Line 78 extern "C" double sign(double); | Line 79 extern "C" double sign(double); |
| inline double sign(double param) { return param > 0 ? 1 : ( param < 0 ? -1 : 0 ); } | inline double sign(double param) { return param > 0 ? 1 : ( param < 0 ? -1 : 0 ); } |
| #endif | #endif |
| /** | |
| $content-type[text/html] -> | |
| content-type: text/html | |
| $content-type[$value[text/html] charset[windows-1251]] -> | |
| content-type: text/html; charset=windows-1251 | |
| */ | |
| const String& attributed_meaning_to_string(Value& meaning, String::Untaint_lang lang); | |
| /// yields to OS for secs secs and usecs milliseconds | /// yields to OS for secs secs and usecs milliseconds |
| int pa_sleep(unsigned long secs, unsigned long usecs); | int pa_sleep(unsigned long secs, unsigned long usecs); |
| Line 89 void fix_line_breaks( | Line 98 void fix_line_breaks( |
| size_t& size ///< may change! used to speedup next actions | size_t& size ///< may change! used to speedup next actions |
| ); | ); |
| typedef void (*File_read_action)(Pool& pool, | |
| struct stat& finfo, | |
| int f, | |
| const String& file_spec, const char *fname, bool as_text, | |
| void *context); | |
| /** | |
| shared-lock specified file, | |
| do actions under lock. | |
| if fail_on_read_problem is true[default] throws an exception | |
| @returns true if read OK | |
| */ | |
| bool file_read_action_under_lock(Pool& pool, const String& file_spec, | |
| const char *action_name, File_read_action action, void *context, | |
| bool as_text=false, | |
| bool fail_on_read_problem=true); | |
| /** | /** |
| read specified text file using pool, | read specified text file using pool, |
| if fail_on_read_problem is true[default] throws an exception | if fail_on_read_problem is true[default] throws an exception |
| @returns true if read OK | |
| */ | */ |
| char *file_read_text(Pool& pool, | char *file_read_text(Pool& pool, |
| const String& file_spec, | const String& file_spec, |
| bool fail_on_read_problem=true); | bool fail_on_read_problem=true, |
| Hash *options=0, Hash** out_fields=0); | |
| /** | /** |
| read specified file using pool, | read specified file using pool, |
| if fail_on_read_problem is true[default] throws an exception | if fail_on_read_problem is true[default] throws an exception |
| @returns true if read OK | |
| */ | */ |
| bool file_read(Pool& pool, const String& file_spec, | bool file_read(Pool& pool, const String& file_spec, |
| void*& data, size_t& size, | void*& data, size_t& size, |
| bool as_text, | bool as_text, |
| bool fail_on_read_problem=true, | Hash *options=0, Hash** out_fields=0, |
| size_t offset=0, size_t limit=0); | bool fail_on_read_problem=true); |
| typedef void (*File_write_action)(int f, void *context); | |
| /** | /** |
| lock specified file exclusively, | lock specified file exclusively, |
| Line 117 bool file_read(Pool& pool, const String& | Line 150 bool file_read(Pool& pool, const String& |
| */ | */ |
| bool file_write_action_under_lock( | bool file_write_action_under_lock( |
| const String& file_spec, | const String& file_spec, |
| const char *action_name, void (*action)(int, void *), void *context=0, | const char *action_name, File_write_action action, void *context, |
| bool as_text=false, | bool as_text=false, |
| bool do_append=false, | bool do_append=false, |
| bool do_block=true, | bool do_block=true, |
| Line 144 bool file_delete(const String& file_spec | Line 177 bool file_delete(const String& file_spec |
| */ | */ |
| void file_move(const String& old_spec, const String& new_spec); | void file_move(const String& old_spec, const String& new_spec); |
| bool entry_exists(const char *fname, struct stat *afinfo=0); | |
| bool entry_exists(const String& file_spec); | |
| bool file_readable(const String& file_spec); | bool file_readable(const String& file_spec); |
| bool dir_readable(const String& file_spec); | bool dir_readable(const String& file_spec); |
| String *file_readable(const String& path, const String& name); | String *file_readable(const String& path, const String& name); |