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

define.h File Reference

#include "version.h"
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <time.h>
#include <string.h>
#include <ctype.h>
#include <limits.h>
#include <wchar.h>
#include <signal.h>
#include <errno.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 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

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 DEBUG  )     {DEBUG_PRINT(x);}
 

Definition at line 150 of file define.h.

 
#define DEBUG_CLOSE  )     {pst_debug_close();}
 

Definition at line 238 of file define.h.

#define DEBUG_CODE  )     {x}
 

Definition at line 195 of file define.h.

Referenced by pst_load_index().

#define DEBUG_DECRYPT  )     {}
 

Definition at line 203 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 162 of file define.h.

Referenced by pst_ff_compile_ID(), pst_parse_block(), pst_parse_item(), pst_process(), 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 163 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 222 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(), my_stristr(), 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 218 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 207 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 210 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_compile_ID(), pst_ff_getIDblock_dec(), and pst_parse_block().

#define DEBUG_INDEX  )     MESSAGEPRINT(x, DEBUG_INDEX_NO);
 

Definition at line 156 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 183 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 237 of file define.h.

Referenced by main().

#define DEBUG_MAIN  )     MESSAGEPRINT(x, DEBUG_MAIN_NO);
 

Definition at line 189 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 144 of file define.h.

#define DEBUG_READ  )     MESSAGEPRINT(x, DEBUG_READ_NO);
 

Definition at line 177 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 239 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 227 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(), my_stristr(), 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 247 of file define.h.

#define DEBUG_WARN  )     MESSAGEPRINT(x, DEBUG_WARN_NO);
 

Definition at line 171 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(), and write_normal_email().

#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 133 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(), utf8to16(), vb_utf16to8(), vballoc(), vbgrow(), and write_separate_attachment().

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

Definition at line 131 of file define.h.

#define MESSAGEPRINT x,
 ) 
 

Value:

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

Definition at line 128 of file define.h.

#define PERM_DIRS   0777
 

Definition at line 60 of file define.h.

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

Definition at line 241 of file define.h.

Referenced by main().

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

Definition at line 244 of file define.h.

#define WARN  ) 
 

Value:

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

Definition at line 138 of file define.h.

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


Function Documentation

void pst_debug const char *  fmt,
  ...
 

Definition at line 43 of file debug.c.

void pst_debug_close void   ) 
 

Definition at line 246 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 224 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 233 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 33 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 208 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 52 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 91 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 107 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 126 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 259 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 Thu Dec 11 11:58:52 2008 for 'LibPst' by  doxygen 1.3.9.1