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

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:

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.

Defines

#define PERM_DIRS   0777
#define D_MKDIR(x)   mkdir(x, PERM_DIRS)
#define MESSAGEPRINT()   pst_debug(__LINE__, __FILE__, __VA_ARGS__)
#define WARN(x)
#define DIE(x)
#define DEBUG_WARN(x)   MESSAGEPRINT x
#define DEBUG_INFO(x)   MESSAGEPRINT x
#define DEBUG_HEXDUMP(x, s)   pst_debug_hexdump(__LINE__, __FILE__, (char*)x, s, 0x10, 0)
#define DEBUG_HEXDUMPC(x, s, c)   pst_debug_hexdump(__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_init (const char *fname, void *output_mutex)
void pst_debug_func (const char *function)
void pst_debug_func_ret ()
void pst_debug (int line, const char *file, const char *fmt,...)
void pst_debug_hexdump (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)
void * pst_malloc (size_t size)
void * pst_realloc (void *ptr, size_t size)


Define Documentation

#define D_MKDIR x   )     mkdir(x, PERM_DIRS)
 

Definition at line 108 of file define.h.

 
#define DEBUG_CLOSE  )     {pst_debug_close();}
 

Definition at line 181 of file define.h.

#define DEBUG_ENT x   ) 
 

Value:

{                                                           \
        pst_debug_func(x);                                      \
        pst_debug(__LINE__, __FILE__, "Entering function\n");   \
    }

Definition at line 169 of file define.h.

Referenced by add_descriptor_to_list(), canonicalize_filename(), check_filename(), main(), print_ldif_address(), process(), pst_attach_to_file(), pst_attach_to_file_base64(), pst_attach_to_mem(), pst_build_id2(), pst_build_id_ptr(), pst_close(), pst_convert_utf8(), pst_decode_type3(), pst_free_desc(), pst_free_id(), pst_free_id2(), pst_free_list(), pst_free_xattrib(), pst_freeItem(), pst_getBlockOffset(), pst_getBlockOffsetPointer(), pst_getNextDptr(), pst_getTopOfFolders(), pst_load_extended_attributes(), pst_load_index(), pst_open(), pst_parse_item(), record_descriptor(), removeCR(), usage(), version(), write_normal_email(), and write_separate_attachment().

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

Definition at line 165 of file define.h.

#define DEBUG_HEXDUMPC x,
s,
 )     pst_debug_hexdump(__LINE__, __FILE__, (char*)x, s, c, 0)
 

Definition at line 166 of file define.h.

Referenced by pst_build_id2(), pst_build_id_ptr(), pst_decode_assoc(), pst_decode_desc(), pst_decode_index(), pst_decode_table(), pst_decode_type3(), and pst_load_extended_attributes().

#define DEBUG_INFO x   )     MESSAGEPRINT x
 

Definition at line 164 of file define.h.

Referenced by dumper(), grim_reaper(), main(), process(), pst_build_id2(), pst_build_id_ptr(), pst_decode_assoc(), pst_decode_desc(), pst_decode_index(), pst_decode_table(), pst_decode_type3(), pst_getTopOfFolders(), pst_load_extended_attributes(), pst_load_index(), pst_open(), pst_parse_item(), record_descriptor(), write_normal_email(), and write_separate_attachment().

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

Definition at line 180 of file define.h.

Referenced by main().

 
#define DEBUG_RET  ) 
 

Value:

{                                                           \
        pst_debug(__LINE__, __FILE__, "Leaving function\n");    \
        pst_debug_func_ret();                                   \
    }

Definition at line 174 of file define.h.

Referenced by add_descriptor_to_list(), canonicalize_filename(), check_filename(), main(), print_ldif_address(), process(), pst_attach_to_file(), pst_attach_to_file_base64(), pst_attach_to_mem(), pst_build_id2(), pst_build_id_ptr(), pst_close(), pst_convert_utf8(), pst_decode_type3(), pst_free_desc(), pst_free_id(), pst_free_id2(), pst_free_list(), pst_free_xattrib(), pst_freeItem(), pst_getBlockOffset(), pst_getBlockOffsetPointer(), pst_getNextDptr(), pst_getTopOfFolders(), pst_load_extended_attributes(), pst_load_index(), pst_open(), pst_parse_item(), record_descriptor(), removeCR(), usage(), version(), write_normal_email(), and write_separate_attachment().

#define DEBUG_WARN x   )     MESSAGEPRINT x
 

Definition at line 163 of file define.h.

Referenced by open_targets(), process(), pst_attach_to_file(), pst_attach_to_file_base64(), pst_attach_to_mem(), pst_build_id2(), pst_build_id_ptr(), pst_close(), pst_convert_utf8(), pst_getBlockOffset(), pst_getBlockOffsetPointer(), pst_load_extended_attributes(), pst_load_index(), pst_open(), pst_parse_item(), pst_unicode_init(), pst_vb_utf16to8(), sbcs_conversion(), utf16_is_terminated(), and write_separate_attachment().

#define DIE x   ) 
 

Value:

{            \
    WARN(x);                \
    exit(EXIT_FAILURE);     \
}

Definition at line 158 of file define.h.

Referenced by dumper(), main(), process(), pst_debug_func_ret(), pst_vballoc(), and write_separate_attachment().

#define LE16_CPU x   ) 
 

Value:

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

Definition at line 201 of file define.h.

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

#define LE32_CPU x   ) 
 

Value:

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

Definition at line 196 of file define.h.

Referenced by pst_decode_assoc(), pst_decode_desc(), pst_decode_index(), pst_decode_table(), pst_decode_type3(), pst_load_extended_attributes(), pst_lzfu_decompress(), and pst_open().

#define LE64_CPU x   ) 
 

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

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

 
#define MESSAGEPRINT  )     pst_debug(__LINE__, __FILE__, __VA_ARGS__)
 

Definition at line 148 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 249 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 239 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 223 of file define.h.

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

Definition at line 255 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 245 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 233 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 213 of file define.h.

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

Definition at line 253 of file define.h.

Referenced by pst_convert_recurrence().

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

Definition at line 182 of file define.h.

Referenced by main().

#define WARN x   ) 
 

Value:

{           \
    MESSAGEPRINT x;         \
    pst_debug_lock();       \
        printf x;           \
        fflush(stdout);     \
    pst_debug_unlock();     \
}

Definition at line 150 of file define.h.

Referenced by pst_open().


Function Documentation

void pst_debug int  line,
const char *  file,
const char *  fmt,
  ...
 

Definition at line 86 of file debug.c.

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

Here is the call graph for this function:

void pst_debug_close void   ) 
 

Definition at line 146 of file debug.c.

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

Referenced by pst_debug_init().

void pst_debug_func const char *  function  ) 
 

Definition at line 53 of file debug.c.

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

Here is the call graph for this function:

void pst_debug_func_ret  ) 
 

Definition at line 62 of file debug.c.

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

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

Definition at line 99 of file debug.c.

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

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 108 of file debug.c.

References func_depth, indent, and MAX_DEPTH.

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

void pst_debug_init const char *  fname,
void *  output_mutex
 

Definition at line 38 of file debug.c.

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

Here is the call graph for this function:

void pst_debug_lock  ) 
 

Definition at line 22 of file debug.c.

References debug_mutex.

Referenced by pst_debug_info().

void pst_debug_unlock  ) 
 

Definition at line 30 of file debug.c.

References debug_mutex.

Referenced by pst_debug(), and pst_debug_hexdump().

void* pst_malloc size_t  size  ) 
 

Definition at line 158 of file debug.c.

References size.

Referenced by deep_copy(), dumper(), main(), pst_build_id2(), pst_build_id_ptr(), pst_convert_recurrence(), pst_debug_func(), pst_getTopOfFolders(), pst_load_extended_attributes(), pst_lzfu_decompress(), pst_open(), pst_parse_item(), pst_vballoc(), and write_separate_attachment().

void* pst_realloc void *  ptr,
size_t  size
 

Definition at line 168 of file debug.c.

References size.


Generated on Sun Jul 10 16:52:29 2011 for 'LibPst' by  doxygen 1.3.9.1