Logo Search packages:      
Sourcecode: parser version File versions  Download package

pa_common.h File Reference

Detailed Description

Parser: commonly used functions.

Copyright (c) 2001-2005 ArtLebedev Group (http://www.artlebedev.com) Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru)

Definition in file pa_common.h.

#include "pa_string.h"
#include "pa_hash.h"

Go to the source code of this file.


struct  File_base64_action_info
struct  File_read_result


#define _qsort(names, cnt, sizeof_names, func_addr)   qsort(names,cnt,sizeof_names,func_addr)
#define FILE_BUFFER_SIZE   4096
#define HTTP_CONTENT_TYPE_FORM_URLENCODED   "application/x-www-form-urlencoded"
#define HTTP_CONTENT_TYPE_MULTIPART   "multipart/form-data"
#define PA_CHARSET_NAME   "charset"
#define PA_COLUMN_ENCLOSER_NAME   "encloser"
#define PA_COLUMN_SEPARATOR_NAME   "separator"
#define PA_SQL_LIMIT_NAME   "limit"
#define PA_SQL_OFFSET_NAME   "offset"
#define SECS_PER_DAY   (60*60*24)
#define snprintf   __snprintf
#define SQL_BIND_NAME   "bind"
#define SQL_DEFAULT_NAME   "default"
#define SQL_DISTINCT_NAME   "distinct"
#define SQL_VALUE_TYPE_NAME   "type"
#define vsnprintf   __vsnprintf


typedef void(* File_read_action )(struct stat &finfo, int f, const String &file_spec, const char *fname, bool as_text, void *context)
typedef void(* File_write_action )(int f, void *context)
typedef Hash< const
String::Body, Value * > 


enum  Table2hash_distint { D_ILLEGAL, D_FIRST }
enum  Table2hash_value_type { C_HASH, C_STRING, C_TABLE }


int __snprintf (char *, size_t, const char *,...)
int __vsnprintf (char *, size_t, const char *, va_list)
 must be last in this file
void CalcCrc32 (const unsigned char byte, unsigned long &crc32)
static void copy_all_overwrite_to (HashStringValue::key_type key, HashStringValue::value_type value, HashStringValue *dest)
void create_dir_for_file (const String &file_spec)
static String::C date_gmt_string (tm *tms)
Charsetdetect_charset (Charset &source_charset, const String &content_type)
Charsetdetect_charset (const char *content_type)
bool dir_exists (const String &file_spec)
bool entry_exists (const String &file_spec)
bool entry_exists (const char *fname, struct stat *afinfo=0)
static void file_base64_file_action (struct stat &finfo, int f, const String &, const char *, bool, void *context)
int file_block_read (const int f, unsigned char *buffer, const size_t size)
static void file_crc32_file_action (struct stat &finfo, int f, const String &, const char *, bool, void *context)
bool file_delete (const String &file_spec, bool fail_on_problem=true)
bool file_executable (const String &file_spec)
const Stringfile_exist (const String &path, const String &name)
bool file_exist (const String &file_spec)
void file_move (const String &old_spec, const String &new_spec)
File_read_result file_read (Request_charsets &charsets, const String &file_spec, bool as_text, HashStringValue *options=0, bool fail_on_read_problem=true, char *buf=0, size_t offset=0, size_t size=0, bool transcode_text_result=true)
bool file_read_action_under_lock (const String &file_spec, const char *action_name, File_read_action action, void *context, bool as_text=false, bool fail_on_read_problem=true)
char * file_read_text (Request_charsets &charsets, const String &file_spec, bool fail_on_read_problem=true, HashStringValue *options=0, bool transcode_result=true)
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)
void file_write (const String &file_spec, const char *data, size_t size, bool as_text, bool do_append=false)
bool file_write_action_under_lock (const String &file_spec, const char *action_name, File_write_action action, void *context, bool as_text=false, bool do_append=false, bool do_block=true, bool fail_on_lock_problem=true)
void fix_line_breaks (char *str, size_t &length)
const char * format (double value, char *fmt)
int getMonthDays (int year, int month)
char * getrow (char **row_ref, char delim='\n')
static const char * hex_string (unsigned char *bytes, size_t size, bool upcase)
static void InitCrc32Table ()
char * lsplit (char **string_ref, char delim)
char * lsplit (char *string, char delim)
void pa_base64_decode (const char *in, size_t in_size, char *&result, size_t &result_size)
char * pa_base64_encode (const String &file_spec)
char * pa_base64_encode (const char *in, size_t in_size)
const unsigned long pa_crc32 (const String &file_spec)
const unsigned long pa_crc32 (const char *in, size_t in_size)
int pa_get_valid_file_options_count (HashStringValue &options)
int pa_lock_exclusive_blocking (int fd)
int pa_lock_exclusive_nonblocking (int fd)
int pa_lock_shared_blocking (int fd)
int pa_unlock (int fd)
char * print_pcre_exec_error_text (int exec_result)
int remove_crlf (char *start, char *end)
static void remove_key_from (HashStringValue::key_type key, HashStringValue::value_type, HashStringValue *dest)
char * rsplit (char *string, char delim)
size_t stdout_write (const void *buf, size_t size)
size_t strpos (const char *str, const char *substr)
bool StrStartFromNC (const char *str, const char *substr, bool equal=false)
char * unescape_chars (const char *cp, int len, Charset *client_charset=0, bool ignore_plus=false)


static unsigned long crc32Table [256]
const String file_status_name
static const char *const IDENT_COMMON_H = "$Date: 2008-08-21 15:57:33 $"

Generated by  Doxygen 1.6.0   Back to index