Main Page | Namespace List | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

define.h File Reference

#include "libpst.h"
#include "timeconv.h"
#include "libstrfunc.h"
#include "vbuf.h"
#include "XGetopt.h"

Include dependency graph for define.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Data Structures

struct  pst_debug_file_rec_m
struct  pst_debug_file_rec_l

Defines

#define DEBUG_MODE_GEN
#define DEBUGPRINT
#define DEBUG_MODE_WARN
#define DEBUG_MODE_READ
#define DEBUG_MODE_EMAIL
#define DEBUG_MODE_MAIN
#define DEBUG_MODE_INDEX
#define DEBUG_MODE_CODE
#define DEBUG_MODE_INFO
#define DEBUG_MODE_HEXDUMP
#define DEBUG_MODE_FUNC
#define DEBUG_MAX_ITEMS   0
#define DEBUG_FILE_NO   1
#define DEBUG_INDEX_NO   2
#define DEBUG_EMAIL_NO   3
#define DEBUG_WARN_NO   4
#define DEBUG_READ_NO   5
#define DEBUG_INFO_NO   6
#define DEBUG_MAIN_NO   7
#define DEBUG_DECRYPT_NO   8
#define DEBUG_FUNCENT_NO   9
#define DEBUG_FUNCRET_NO   10
#define DEBUG_HEXDUMP_NO   11
#define PERM_DIRS   0777
#define D_MKDIR(x)   mkdir(x, PERM_DIRS)
#define MESSAGEPRINT(x, y)
#define LOGSTOP()   {MESSAGESTOP();DEBUGSTOP();}
#define DIE(x)
#define WARN(x)
#define DEBUG_PRINT(x)   pst_debug x;
#define DEBUG(x)   {DEBUG_PRINT(x);}
#define DEBUG_INDEX(x)   MESSAGEPRINT(x, DEBUG_INDEX_NO);
#define DEBUG_EMAIL(x)   MESSAGEPRINT(x, DEBUG_EMAIL_NO);
#define DEBUG_EMAIL_HEXPRINT(x, y)
#define DEBUG_WARN(x)   MESSAGEPRINT(x, DEBUG_WARN_NO);
#define DEBUG_READ(x)   MESSAGEPRINT(x, DEBUG_READ_NO);
#define DEBUG_INFO(x)   MESSAGEPRINT(x, DEBUG_INFO_NO);
#define DEBUG_MAIN(x)   MESSAGEPRINT(x, DEBUG_MAIN_NO);
#define DEBUG_CODE(x)   {x}
#define DEBUG_DECRYPT(x)   {}
#define DEBUG_HEXDUMP(x, s)
#define DEBUG_HEXDUMPC(x, s, c)
#define DEBUG_FILE(x)
#define DEBUG_ENT(x)
#define DEBUG_RET()
#define DEBUG_INIT(fname)   {pst_debug_init(fname);}
#define DEBUG_CLOSE()   {pst_debug_close();}
#define DEBUG_REGISTER_CLOSE()   {if(atexit(pst_debug_close)!=0) fprintf(stderr, "Error registering atexit function\n");}
#define RET_DERROR(res, ret_val, x)   if (res) { DIE(x);}
#define RET_ERROR(res, ret_val)   if (res) {return ret_val;}
#define DEBUG_VERSION   1
#define LE64_CPU(x)
#define LE32_CPU(x)
#define LE16_CPU(x)
#define PST_LE_GET_UINT64(p)
#define PST_LE_GET_INT64(p)
#define PST_LE_GET_UINT32(p)
#define PST_LE_GET_INT32(p)
#define PST_LE_GET_UINT16(p)
#define PST_LE_GET_INT16(p)
#define PST_LE_GET_UINT8(p)   (*(uint8_t const *)(p))
#define PST_LE_GET_INT8(p)   (*(int8_t const *)(p))

Functions

void pst_debug (const char *fmt,...)
void pst_debug_hexdumper (FILE *out, char *buf, size_t size, int col, int delta)
void pst_debug_hexprint (char *data, int size)
void pst_debug_init (const char *fname)
void pst_debug_msg_info (int line, const char *file, int type)
void pst_debug_msg_text (const char *fmt,...)
void pst_debug_hexdump (char *x, size_t y, int cols, int delta)
void pst_debug_func (const char *function)
void pst_debug_func_ret ()
void pst_debug_close (void)
void pst_debug_write ()
size_t pst_debug_fwrite (const void *ptr, size_t size, size_t nitems, FILE *stream)
void * xmalloc (size_t size)


Define Documentation

#define D_MKDIR  )     mkdir(x, PERM_DIRS)
 

Definition at line 130 of file define.h.

Referenced by mk_kmail_dir(), mk_recurse_dir(), and mk_separate_dir().

#define DEBUG  )     {DEBUG_PRINT(x);}
 

Definition at line 184 of file define.h.

 
#define DEBUG_CLOSE  )     {pst_debug_close();}
 

Definition at line 272 of file define.h.

#define DEBUG_CODE  )     {x}
 

Definition at line 229 of file define.h.

Referenced by pst_load_index().

#define DEBUG_DECRYPT  )     {}
 

Definition at line 237 of file define.h.

#define DEBUG_DECRYPT_NO   8
 

Definition at line 44 of file define.h.

#define DEBUG_EMAIL  )     MESSAGEPRINT(x, DEBUG_EMAIL_NO);
 

Definition at line 196 of file define.h.

Referenced by find_html_charset(), header_has_field(), pst_ff_compile_ID(), pst_parse_block(), pst_parse_item(), pst_process(), test_base64(), write_body_part(), write_inline_attachment(), write_normal_email(), and write_separate_attachment().

#define DEBUG_EMAIL_HEXPRINT x,
 ) 
 

Value:

{pst_debug_msg_info(__LINE__, __FILE__, 11);\
                                   pst_debug_hexdump((char*)x, y, 0x10, 0);}

Definition at line 197 of file define.h.

Referenced by pst_process().

#define DEBUG_EMAIL_NO   3
 

Definition at line 39 of file define.h.

#define DEBUG_ENT  ) 
 

Value:

{                                                           \
        pst_debug_func(x);                                      \
        MESSAGEPRINT(("Entering function %s\n",x),DEBUG_FUNCENT_NO); \
    }

Definition at line 256 of file define.h.

Referenced by add_descriptor_to_list(), canonicalize_filename(), close_kmail_dir(), close_recurse_dir(), close_separate_dir(), main(), mk_kmail_dir(), mk_recurse_dir(), mk_separate_dir(), mk_separate_file(), process(), pst_attach_to_file(), pst_attach_to_file_base64(), pst_attach_to_mem(), pst_build_desc_ptr(), pst_build_id2(), pst_build_id_ptr(), pst_close(), pst_decrypt(), pst_ff_compile_ID(), pst_ff_getID2block(), pst_ff_getID2data(), pst_ff_getIDblock(), pst_ff_getIDblock_dec(), pst_free_desc(), pst_free_id(), pst_free_id2(), pst_free_list(), pst_free_xattrib(), pst_freeItem(), pst_fwrite(), pst_getAtPos(), pst_getBlockOffset(), pst_getBlockOffsetPointer(), pst_getDptr(), pst_getID(), pst_getID2(), pst_getNextDptr(), pst_getTopOfFolders(), pst_load_extended_attributes(), pst_load_index(), pst_open(), pst_parse_block(), pst_parse_item(), pst_printDptr(), pst_printID2ptr(), pst_printIDptr(), pst_process(), pst_read_block_size(), pst_rfc2425_datetime_format(), pst_rfc2426_escape(), pst_rfc2445_datetime_format(), pst_wide_to_single(), record_descriptor(), removeCR(), usage(), version(), write_email_body(), write_inline_attachment(), write_normal_email(), write_separate_attachment(), and write_vcard().

#define DEBUG_FILE  ) 
 

Value:

{pst_debug_msg_info(__LINE__, __FILE__, DEBUG_FILE_NO);\
                       pst_debug_msg_text x;}

Definition at line 252 of file define.h.

Referenced by main().

#define DEBUG_FILE_NO   1
 

Definition at line 37 of file define.h.

#define DEBUG_FUNCENT_NO   9
 

Definition at line 45 of file define.h.

#define DEBUG_FUNCRET_NO   10
 

Definition at line 46 of file define.h.

#define DEBUG_HEXDUMP x,
 ) 
 

Value:

{pst_debug_msg_info(__LINE__, __FILE__, DEBUG_HEXDUMP_NO);\
   pst_debug_hexdump((char*)x, s, 0x10, 0);}

Definition at line 241 of file define.h.

Referenced by pst_process().

#define DEBUG_HEXDUMP_NO   11
 

Definition at line 47 of file define.h.

#define DEBUG_HEXDUMPC x,
s,
 ) 
 

Value:

{pst_debug_msg_info(__LINE__, __FILE__, DEBUG_HEXDUMP_NO);\
   pst_debug_hexdump((char*)x, s, c, 0);}

Definition at line 244 of file define.h.

Referenced by find_html_charset(), pst_build_desc_ptr(), pst_build_id2(), pst_build_id_ptr(), pst_decode_assoc(), pst_decode_desc(), pst_decode_index(), pst_decode_table(), pst_decode_type3(), pst_ff_compile_ID(), pst_ff_getIDblock_dec(), pst_parse_block(), and test_base64().

#define DEBUG_INDEX  )     MESSAGEPRINT(x, DEBUG_INDEX_NO);
 

Definition at line 190 of file define.h.

Referenced by pst_build_desc_ptr(), pst_build_id2(), pst_build_id_ptr(), pst_decode_assoc(), pst_decode_desc(), pst_decode_index(), pst_decode_table(), pst_decode_type3(), pst_ff_getID2block(), pst_ff_getIDblock(), pst_ff_getIDblock_dec(), pst_getID(), pst_getID2(), pst_getTopOfFolders(), pst_load_extended_attributes(), pst_load_index(), pst_parse_block(), pst_printDptr(), pst_printID2ptr(), pst_printIDptr(), and record_descriptor().

#define DEBUG_INDEX_NO   2
 

Definition at line 38 of file define.h.

#define DEBUG_INFO  )     MESSAGEPRINT(x, DEBUG_INFO_NO);
 

Definition at line 217 of file define.h.

Referenced by process(), pst_open(), pst_rfc2425_datetime_format(), and pst_rfc2445_datetime_format().

#define DEBUG_INFO_NO   6
 

Definition at line 42 of file define.h.

#define DEBUG_INIT fname   )     {pst_debug_init(fname);}
 

Definition at line 271 of file define.h.

Referenced by main().

#define DEBUG_MAIN  )     MESSAGEPRINT(x, DEBUG_MAIN_NO);
 

Definition at line 223 of file define.h.

Referenced by main(), mk_separate_dir(), mk_separate_file(), and process().

#define DEBUG_MAIN_NO   7
 

Definition at line 43 of file define.h.

#define DEBUG_MAX_ITEMS   0
 

Definition at line 35 of file define.h.

#define DEBUG_MODE_CODE
 

Definition at line 29 of file define.h.

#define DEBUG_MODE_EMAIL
 

Definition at line 26 of file define.h.

#define DEBUG_MODE_FUNC
 

Definition at line 32 of file define.h.

#define DEBUG_MODE_GEN
 

Definition at line 22 of file define.h.

#define DEBUG_MODE_HEXDUMP
 

Definition at line 31 of file define.h.

#define DEBUG_MODE_INDEX
 

Definition at line 28 of file define.h.

#define DEBUG_MODE_INFO
 

Definition at line 30 of file define.h.

#define DEBUG_MODE_MAIN
 

Definition at line 27 of file define.h.

#define DEBUG_MODE_READ
 

Definition at line 25 of file define.h.

#define DEBUG_MODE_WARN
 

Definition at line 24 of file define.h.

#define DEBUG_PRINT  )     pst_debug x;
 

Definition at line 178 of file define.h.

#define DEBUG_READ  )     MESSAGEPRINT(x, DEBUG_READ_NO);
 

Definition at line 211 of file define.h.

Referenced by pst_ff_compile_ID(), pst_ff_getID2data(), and pst_read_block_size().

#define DEBUG_READ_NO   5
 

Definition at line 41 of file define.h.

 
#define DEBUG_REGISTER_CLOSE  )     {if(atexit(pst_debug_close)!=0) fprintf(stderr, "Error registering atexit function\n");}
 

Definition at line 273 of file define.h.

Referenced by main().

 
#define DEBUG_RET  ) 
 

Value:

{                                                           \
        MESSAGEPRINT(("Leaving function\n"),DEBUG_FUNCRET_NO);  \
        pst_debug_func_ret();                                   \
    }

Definition at line 261 of file define.h.

Referenced by add_descriptor_to_list(), canonicalize_filename(), close_kmail_dir(), close_recurse_dir(), close_separate_dir(), main(), mk_kmail_dir(), mk_recurse_dir(), mk_separate_dir(), mk_separate_file(), process(), pst_attach_to_file(), pst_attach_to_file_base64(), pst_attach_to_mem(), pst_build_desc_ptr(), pst_build_id2(), pst_build_id_ptr(), pst_close(), pst_decrypt(), pst_ff_compile_ID(), pst_ff_getID2block(), pst_ff_getID2data(), pst_ff_getIDblock(), pst_ff_getIDblock_dec(), pst_free_desc(), pst_free_id(), pst_free_id2(), pst_free_list(), pst_free_xattrib(), pst_freeItem(), pst_fwrite(), pst_getAtPos(), pst_getBlockOffset(), pst_getBlockOffsetPointer(), pst_getDptr(), pst_getID(), pst_getID2(), pst_getNextDptr(), pst_getTopOfFolders(), pst_load_extended_attributes(), pst_load_index(), pst_open(), pst_parse_block(), pst_parse_item(), pst_printDptr(), pst_printID2ptr(), pst_printIDptr(), pst_process(), pst_read_block_size(), pst_rfc2425_datetime_format(), pst_rfc2426_escape(), pst_rfc2445_datetime_format(), pst_wide_to_single(), record_descriptor(), removeCR(), usage(), version(), write_email_body(), write_inline_attachment(), write_normal_email(), write_separate_attachment(), and write_vcard().

#define DEBUG_VERSION   1
 

Definition at line 281 of file define.h.

#define DEBUG_WARN  )     MESSAGEPRINT(x, DEBUG_WARN_NO);
 

Definition at line 205 of file define.h.

Referenced by process(), pst_attach_to_file(), pst_attach_to_file_base64(), pst_attach_to_mem(), pst_build_desc_ptr(), pst_build_id2(), pst_build_id_ptr(), pst_ff_compile_ID(), pst_fwrite(), pst_getBlockOffset(), pst_getBlockOffsetPointer(), pst_load_extended_attributes(), pst_parse_block(), pst_parse_item(), pst_read_block_size(), utf16_is_terminated(), and vb_utf16to8().

#define DEBUG_WARN_NO   4
 

Definition at line 40 of file define.h.

#define DEBUGPRINT
 

Definition at line 23 of file define.h.

#define DIE  ) 
 

Value:

{\
 MESSAGEPRINT(x, 0);\
 printf x;\
 exit(EXIT_FAILURE);\
}

Definition at line 167 of file define.h.

Referenced by close_kmail_dir(), close_recurse_dir(), close_separate_dir(), main(), mk_kmail_dir(), mk_recurse_dir(), mk_separate_dir(), mk_separate_file(), process(), pst_debug_func_ret(), pst_free_desc(), vballoc(), vbgrow(), and write_separate_attachment().

#define LE16_CPU  ) 
 

Value:

x = ((((x) & 0xff00) >> 8) | \
       (((x) & 0x00ff) << 8));

Definition at line 315 of file define.h.

Referenced by lzfu_decompress(), pst_build_id2(), pst_decode_index(), pst_ff_compile_ID(), pst_getBlockOffset(), pst_load_extended_attributes(), pst_parse_block(), and pst_process().

#define LE32_CPU  ) 
 

Value:

x = ((((x) & 0xff000000) >> 24) | \
       (((x) & 0x00ff0000) >> 8 ) | \
       (((x) & 0x0000ff00) << 8 ) | \
       (((x) & 0x000000ff) << 24));

Definition at line 310 of file define.h.

Referenced by lzfu_decompress(), pst_decode_assoc(), pst_decode_desc(), pst_decode_index(), pst_decode_table(), pst_decode_type3(), pst_ff_compile_ID(), pst_getIntAt(), pst_getIntAtPos(), pst_load_extended_attributes(), pst_open(), pst_parse_block(), and pst_process().

#define LE64_CPU  ) 
 

Value:

x = ((((x) & UINT64_C(0xff00000000000000)) >> 56) | \
       (((x) & UINT64_C(0x00ff000000000000)) >> 40) | \
       (((x) & UINT64_C(0x0000ff0000000000)) >> 24) | \
       (((x) & UINT64_C(0x000000ff00000000)) >> 8 ) | \
       (((x) & UINT64_C(0x00000000ff000000)) << 8 ) | \
       (((x) & UINT64_C(0x0000000000ff0000)) << 24) | \
       (((x) & UINT64_C(0x000000000000ff00)) << 40) | \
       (((x) & UINT64_C(0x00000000000000ff)) << 56));

Definition at line 301 of file define.h.

Referenced by pst_decode_assoc(), pst_decode_desc(), pst_decode_index(), pst_decode_table(), pst_decode_type3(), pst_getIntAt(), and pst_getIntAtPos().

 
#define LOGSTOP  )     {MESSAGESTOP();DEBUGSTOP();}
 

Definition at line 165 of file define.h.

#define MESSAGEPRINT x,
 ) 
 

Value:

{pst_debug_msg_info(__LINE__,__FILE__,y);\
                           pst_debug_msg_text x;}

Definition at line 162 of file define.h.

#define PERM_DIRS   0777
 

Definition at line 90 of file define.h.

#define PST_LE_GET_INT16  ) 
 

Value:

(int16_t)((((uint8_t const *)(p))[0] << 0)  |    \
                   (((uint8_t const *)(p))[1] << 8))

Definition at line 363 of file define.h.

#define PST_LE_GET_INT32  ) 
 

Value:

(int32_t)((((uint8_t const *)(p))[0] << 0)  |    \
                  (((uint8_t const *)(p))[1] << 8)  |    \
                  (((uint8_t const *)(p))[2] << 16) |    \
                  (((uint8_t const *)(p))[3] << 24))

Definition at line 353 of file define.h.

#define PST_LE_GET_INT64  ) 
 

Value:

(int64_t)((((uint8_t const *)(p))[0] << 0)  |    \
                  (((uint8_t const *)(p))[1] << 8)  |    \
                  (((uint8_t const *)(p))[2] << 16) |    \
                  (((uint8_t const *)(p))[3] << 24) |    \
                  (((uint8_t const *)(p))[4] << 32) |    \
                  (((uint8_t const *)(p))[5] << 40) |    \
                  (((uint8_t const *)(p))[6] << 48) |    \
                  (((uint8_t const *)(p))[7] << 56))

Definition at line 337 of file define.h.

#define PST_LE_GET_INT8  )     (*(int8_t const *)(p))
 

Definition at line 369 of file define.h.

#define PST_LE_GET_UINT16  ) 
 

Value:

(uint16_t)((((uint8_t const *)(p))[0] << 0)  |    \
                   (((uint8_t const *)(p))[1] << 8))

Definition at line 359 of file define.h.

Referenced by pst_load_extended_attributes().

#define PST_LE_GET_UINT32  ) 
 

Value:

(uint32_t)((((uint8_t const *)(p))[0] << 0)  |    \
                   (((uint8_t const *)(p))[1] << 8)  |    \
                   (((uint8_t const *)(p))[2] << 16) |    \
                   (((uint8_t const *)(p))[3] << 24))

Definition at line 347 of file define.h.

Referenced by pst_load_extended_attributes().

#define PST_LE_GET_UINT64  ) 
 

Value:

(uint64_t)((((uint8_t const *)(p))[0] << 0)  |    \
                   (((uint8_t const *)(p))[1] << 8)  |    \
                   (((uint8_t const *)(p))[2] << 16) |    \
                   (((uint8_t const *)(p))[3] << 24) |    \
                   (((uint8_t const *)(p))[4] << 32) |    \
                   (((uint8_t const *)(p))[5] << 40) |    \
                   (((uint8_t const *)(p))[6] << 48) |    \
                   (((uint8_t const *)(p))[7] << 56))

Definition at line 327 of file define.h.

#define PST_LE_GET_UINT8  )     (*(uint8_t const *)(p))
 

Definition at line 367 of file define.h.

#define RET_DERROR res,
ret_val,
 )     if (res) { DIE(x);}
 

Definition at line 275 of file define.h.

Referenced by main().

#define RET_ERROR res,
ret_val   )     if (res) {return ret_val;}
 

Definition at line 278 of file define.h.

#define WARN  ) 
 

Value:

{\
 MESSAGEPRINT(x, 0);\
 printf x;\
}

Definition at line 172 of file define.h.

Referenced by mk_separate_dir(), pst_build_id2(), pst_close(), pst_decrypt(), pst_load_index(), pst_open(), pst_parse_block(), vb_utf8to8bit(), and write_separate_attachment().


Function Documentation

void pst_debug const char *  fmt,
  ...
 

Definition at line 33 of file debug.c.

void pst_debug_close void   ) 
 

Definition at line 236 of file debug.c.

References debug_fp, func_head, pst_debug_func::next, and pst_debug_write().

Referenced by pst_debug_init().

Here is the call graph for this function:

void pst_debug_func const char *  function  ) 
 

Definition at line 214 of file debug.c.

References func_head, pst_debug_item::next, and xmalloc().

Here is the call graph for this function:

void pst_debug_func_ret  ) 
 

Definition at line 223 of file debug.c.

References DIE, func_head, and pst_debug_func::next.

size_t pst_debug_fwrite const void *  ptr,
size_t  size,
size_t  nitems,
FILE *  stream
 

Definition at line 23 of file debug.c.

Referenced by pst_debug_init(), pst_debug_write(), pst_debug_write_hex(), and pst_debug_write_msg().

void pst_debug_hexdump char *  x,
size_t  y,
int  cols,
int  delta
 

Definition at line 198 of file debug.c.

References pst_debug_item::next, pst_debug_write(), and pst_debug_write_hex().

Here is the call graph for this function:

void pst_debug_hexdumper FILE *  out,
char *  buf,
size_t  size,
int  col,
int  delta
 

Definition at line 42 of file debug.c.

Referenced by main(), and pst_debug_write_hex().

void pst_debug_hexprint char *  data,
int  size
 

void pst_debug_init const char *  fname  ) 
 

Definition at line 81 of file debug.c.

References debug_fp, item_head, pst_debug_close(), pst_debug_fwrite(), and version().

Here is the call graph for this function:

void pst_debug_msg_info int  line,
const char *  file,
int  type
 

Definition at line 97 of file debug.c.

References pst_debug_item::file, func_head, pst_debug_item::function, pst_debug_item::line, pst_debug_func::name, pst_debug_item::next, pst_debug_item::type, and xmalloc().

Here is the call graph for this function:

void pst_debug_msg_text const char *  fmt,
  ...
 

Definition at line 116 of file debug.c.

References item_head, pst_debug_item::next, pst_debug_write(), pst_debug_write_msg(), pst_debug_item::text, and xmalloc().

Here is the call graph for this function:

void pst_debug_write  ) 
 

Definition at line 249 of file debug.c.

References debug_fp, pst_debug_file_rec_m::end, pst_debug_file_rec_l::end, pst_debug_file_rec_m::filename, pst_debug_file_rec_l::filename, pst_debug_file_rec_m::funcname, pst_debug_file_rec_l::funcname, item_head, pst_debug_file_rec_m::line, pst_debug_file_rec_l::line, pst_debug_item::next, pst_debug_fwrite(), pst_debug_file_rec_m::text, pst_debug_file_rec_l::text, pst_debug_file_rec_m::type, pst_debug_file_rec_l::type, and xmalloc().

Referenced by pst_debug_close(), pst_debug_hexdump(), and pst_debug_msg_text().

Here is the call graph for this function:

void* xmalloc size_t  size  ) 
 

Referenced by create_enter_dir(), lzfu_decompress(), main(), pst_build_desc_ptr(), pst_build_id2(), pst_build_id_ptr(), pst_debug_func(), pst_debug_msg_info(), pst_debug_msg_text(), pst_debug_write(), pst_getTopOfFolders(), pst_load_extended_attributes(), pst_parse_block(), pst_parse_item(), pst_process(), pst_read_block_size(), pst_wide_to_single(), split_args(), write_normal_email(), and write_separate_attachment().


Generated on Sat Feb 7 10:22:08 2009 for 'LibPst' by  doxygen 1.3.9.1