define.h File Reference

#include "config.h"
#include "libpst.h"
#include "timeconv.h"
#include "libstrfunc.h"
#include "vbuf.h"
#include <string.h>
#include <ctype.h>
#include <limits.h>
#include <wchar.h>
#include <signal.h>
#include <errno.h>
#include <iconv.h>
#include <regex.h>
#include <gd.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/shm.h>
#include <sys/wait.h>
#include <dirent.h>
#include <semaphore.h>
Include dependency graph for define.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define PERM_DIRS   0777
#define D_MKDIR(x)   mkdir(x, PERM_DIRS)
#define MESSAGEPRINT1(...)   pst_debug(1, __LINE__, __FILE__, __VA_ARGS__)
#define MESSAGEPRINT2(...)   pst_debug(2, __LINE__, __FILE__, __VA_ARGS__)
#define MESSAGEPRINT3(...)   pst_debug(3, __LINE__, __FILE__, __VA_ARGS__)
#define WARN(x)
#define DIE(x)
#define DEBUG_WARN(x)   MESSAGEPRINT3 x
#define DEBUG_INFO(x)   MESSAGEPRINT2 x
#define DEBUG_HEXDUMP(x, s)   pst_debug_hexdump(1, __LINE__, __FILE__, (char*)x, s, 0x10, 0)
#define DEBUG_HEXDUMPC(x, s, c)   pst_debug_hexdump(1, __LINE__, __FILE__, (char*)x, s, c, 0)
#define DEBUG_ENT(x)
#define DEBUG_RET()
#define DEBUG_INIT(fname, mutex)   {pst_debug_init(fname,mutex);}
#define DEBUG_CLOSE()   {pst_debug_close();}
#define RET_DERROR(res, ret_val, x)   if (res) { DIE(x);}
#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_lock ()
void pst_debug_unlock ()
void pst_debug_setlevel (int level)
void pst_debug_init (const char *fname, void *output_mutex)
void pst_debug_func (int level, const char *function)
void pst_debug_func_ret (int level)
void pst_debug (int level, int line, const char *file, const char *fmt,...)
void pst_debug_hexdump (int level, int line, const char *file, const char *buf, size_t size, int cols, int delta)
void pst_debug_hexdumper (FILE *out, const char *buf, size_t size, int cols, int delta)
void pst_debug_close ()
void * pst_malloc (size_t size)
void * pst_realloc (void *ptr, size_t size)

Define Documentation

#define D_MKDIR (  )     mkdir(x, PERM_DIRS)

Definition at line 108 of file define.h.

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

 
#define DEBUG_CLOSE (  )     {pst_debug_close();}

Definition at line 184 of file define.h.

#define DEBUG_ENT (  ) 
Value:
{                                                           \
      pst_debug_func(1, x);                                      \
      pst_debug(1, __LINE__, __FILE__, "Entering function\n");   \
    }

Definition at line 172 of file define.h.

Referenced by acceptable_ext(), add_descriptor_to_list(), canonicalize_filename(), check_filename(), close_kmail_dir(), close_recurse_dir(), close_separate_dir(), close_separate_file(), convert_8bit(), create_enter_dir(), find_html_charset(), find_rfc822_headers(), header_get_subfield(), header_has_field(), main(), mk_kmail_dir(), mk_recurse_dir(), mk_separate_dir(), mk_separate_file(), print_ldif_address(), process(), pst_append_holder(), 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_convert_utf8(), pst_decode_type3(), pst_decrypt(), pst_ff_compile_ID(), pst_ff_getID2block(), pst_ff_getID2data(), pst_ff_getIDblock(), pst_ff_getIDblock_dec(), pst_finish_cleanup_holder(), pst_free_desc(), 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_process(), pst_read_block_size(), pst_rfc2425_datetime_format(), pst_rfc2426_escape(), pst_rfc2445_datetime_format(), pst_rfc2445_datetime_format_now(), pst_wide_to_single(), record_descriptor(), removeCR(), sbcs_conversion(), test_base64(), usage(), version(), write_body_part(), write_email_body(), write_embedded_message(), write_inline_attachment(), write_msg_email(), write_normal_email(), write_separate_attachment(), and write_vcard().

#define DEBUG_HEXDUMP ( x,
 )     pst_debug_hexdump(1, __LINE__, __FILE__, (char*)x, s, 0x10, 0)

Definition at line 168 of file define.h.

Referenced by pst_process().

#define DEBUG_HEXDUMPC ( x,
s,
 )     pst_debug_hexdump(1, __LINE__, __FILE__, (char*)x, s, c, 0)
#define DEBUG_INFO (  )     MESSAGEPRINT2 x
#define DEBUG_INIT ( fname,
mutex   )     {pst_debug_init(fname,mutex);}

Definition at line 183 of file define.h.

Referenced by main().

 
#define DEBUG_RET (  ) 
Value:
{                                                           \
      pst_debug(1, __LINE__, __FILE__, "Leaving function\n");    \
      pst_debug_func_ret(1);                     \
    }

Definition at line 177 of file define.h.

Referenced by acceptable_ext(), add_descriptor_to_list(), canonicalize_filename(), check_filename(), close_kmail_dir(), close_recurse_dir(), close_separate_dir(), close_separate_file(), convert_8bit(), create_enter_dir(), find_html_charset(), find_rfc822_headers(), header_get_subfield(), header_has_field(), main(), mk_kmail_dir(), mk_recurse_dir(), mk_separate_dir(), mk_separate_file(), print_ldif_address(), process(), pst_append_holder(), 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_convert_utf8(), pst_decode_type3(), pst_decrypt(), pst_ff_compile_ID(), pst_ff_getID2block(), pst_ff_getID2data(), pst_ff_getIDblock(), pst_ff_getIDblock_dec(), pst_finish_cleanup_holder(), pst_free_desc(), 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_process(), pst_read_block_size(), pst_rfc2425_datetime_format(), pst_rfc2426_escape(), pst_rfc2445_datetime_format(), pst_rfc2445_datetime_format_now(), pst_wide_to_single(), record_descriptor(), removeCR(), sbcs_conversion(), test_base64(), usage(), version(), write_body_part(), write_email_body(), write_embedded_message(), write_inline_attachment(), write_msg_email(), write_normal_email(), write_separate_attachment(), and write_vcard().

#define DEBUG_WARN (  )     MESSAGEPRINT3 x
#define DIE (  ) 
#define LE16_CPU (  ) 
Value:
x = ((((x) & 0xff00) >> 8) | \
       (((x) & 0x00ff) << 8));

Definition at line 204 of file define.h.

Referenced by pst_build_id2(), pst_decode_index(), pst_ff_compile_ID(), pst_getBlockOffset(), pst_lzfu_decompress(), and pst_parse_block().

#define LE32_CPU (  ) 
Value:
x = ((((x) & 0xff000000) >> 24) | \
       (((x) & 0x00ff0000) >> 8 ) | \
       (((x) & 0x0000ff00) << 8 ) | \
       (((x) & 0x000000ff) << 24));

Definition at line 199 of file define.h.

Referenced by 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_lzfu_decompress(), pst_open(), and pst_parse_block().

#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 190 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 MESSAGEPRINT1 ( ...   )     pst_debug(1, __LINE__, __FILE__, __VA_ARGS__)

Definition at line 149 of file define.h.

#define MESSAGEPRINT2 ( ...   )     pst_debug(2, __LINE__, __FILE__, __VA_ARGS__)

Definition at line 150 of file define.h.

#define MESSAGEPRINT3 ( ...   )     pst_debug(3, __LINE__, __FILE__, __VA_ARGS__)

Definition at line 151 of file define.h.

#define PERM_DIRS   0777

Definition at line 58 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 252 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 242 of file define.h.

Referenced by pst_process().

#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 226 of file define.h.

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

Definition at line 258 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 248 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 236 of file define.h.

Referenced by pst_convert_recurrence(), and 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 216 of file define.h.

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

Definition at line 256 of file define.h.

Referenced by pst_convert_recurrence().

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

Definition at line 185 of file define.h.

Referenced by main().

#define WARN (  ) 
Value:
{           \
    MESSAGEPRINT3 x;        \
    pst_debug_lock();       \
        printf x;           \
        fflush(stdout);     \
    pst_debug_unlock();     \
}

Definition at line 153 of file define.h.

Referenced by pst_open().


Function Documentation

void pst_debug ( int  level,
int  line,
const char *  file,
const char *  fmt,
  ... 
)

Definition at line 95 of file debug.c.

References debug_fp, pst_debug_info(), pst_debug_unlock(), and pst_debuglevel.

Here is the call graph for this function:

void pst_debug_close (  ) 

Definition at line 157 of file debug.c.

References debug_fp, pst_debug_func::name, and pst_debug_func::next.

Referenced by pst_debug_init().

void pst_debug_func ( int  level,
const char *  function 
)

Definition at line 59 of file debug.c.

References func_depth, pst_debug_func::name, pst_debug_func::next, pst_debuglevel, and pst_malloc().

Here is the call graph for this function:

void pst_debug_func_ret ( int  level  ) 

Definition at line 69 of file debug.c.

References DIE, func_depth, pst_debug_func::name, pst_debug_func::next, and pst_debuglevel.

void pst_debug_hexdump ( int  level,
int  line,
const char *  file,
const char *  buf,
size_t  size,
int  cols,
int  delta 
)

Definition at line 109 of file debug.c.

References debug_fp, pst_debug_hexdumper(), pst_debug_info(), pst_debug_unlock(), and pst_debuglevel.

Here is the call graph for this function:

void pst_debug_hexdumper ( FILE *  out,
const char *  buf,
size_t  size,
int  cols,
int  delta 
)

Definition at line 119 of file debug.c.

References func_depth, indent, MAX_DEPTH, and NUM_COL.

Referenced by dumper(), main(), and pst_debug_hexdump().

void pst_debug_init ( const char *  fname,
void *  output_mutex 
)

Definition at line 44 of file debug.c.

References debug_fp, debug_mutex, indent, MAX_DEPTH, and pst_debug_close().

Here is the call graph for this function:

void pst_debug_lock (  ) 

Definition at line 28 of file debug.c.

References debug_mutex.

Referenced by close_enter_dir(), process(), and pst_debug_info().

void pst_debug_setlevel ( int  level  ) 

Definition at line 23 of file debug.c.

References pst_debuglevel.

Referenced by main().

void pst_debug_unlock (  ) 

Definition at line 36 of file debug.c.

References debug_mutex.

Referenced by close_enter_dir(), process(), pst_debug(), and pst_debug_hexdump().

void* pst_malloc ( size_t  size  ) 
void* pst_realloc ( void *  ptr,
size_t  size 
)

Definition at line 179 of file debug.c.

Referenced by mk_kmail_dir(), pst_append_holder(), pst_build_id_ptr(), and pst_rfc2426_escape().


Generated on 6 Jul 2016 for 'LibPst' by  doxygen 1.6.1