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

readpst.c File Reference

#include "define.h"
#include "lzfu.h"

Include dependency graph for readpst.c:

Include dependency graph

Go to the source code of this file.

Data Structures

struct  file_ll

Defines

#define OUTPUT_TEMPLATE   "%s"
#define OUTPUT_KMAIL_DIR_TEMPLATE   ".%s.directory"
#define KMAIL_INDEX   ".%s.index"
#define SEP_MAIL_FILE_TEMPLATE   "%i%s"
#define C_TIME_SIZE   500
#define MODE_NORMAL   0
#define MODE_KMAIL   1
#define MODE_RECURSE   2
#define MODE_SEPARATE   3
#define OUTPUT_NORMAL   0
#define OUTPUT_QUIET   1
#define MIME_TYPE_DEFAULT   "application/octet-stream"
#define RFC822   "message/rfc822"
#define CMODE_VCARD   0
#define CMODE_LIST   1
#define DMODE_EXCLUDE   0
#define DMODE_INCLUDE   1
#define OTMODE_EMAIL   1
#define OTMODE_APPOINTMENT   2
#define OTMODE_JOURNAL   4
#define OTMODE_CONTACT   8
#define RTF_ATTACH_NAME   "rtf-body.rtf"
#define RTF_ATTACH_TYPE   "application/rtf"

Functions

int grim_reaper ()
pid_t try_fork (char *folder)
void process (pst_item *outeritem, pst_desc_tree *d_ptr)
void write_email_body (FILE *f, char *body)
void removeCR (char *c)
void usage ()
void version ()
char * mk_kmail_dir (char *fname)
int close_kmail_dir ()
char * mk_recurse_dir (char *dir, int32_t folder_type)
int close_recurse_dir ()
char * mk_separate_dir (char *dir)
int close_separate_dir ()
void mk_separate_file (struct file_ll *f, char *extension)
void close_separate_file (struct file_ll *f)
char * my_stristr (char *haystack, char *needle)
void check_filename (char *fname)
void write_separate_attachment (char f_name[], pst_item_attach *attach, int attach_num, pst_file *pst)
void write_embedded_message (FILE *f_output, pst_item_attach *attach, char *boundary, pst_file *pf, char **extra_mime_headers)
void write_inline_attachment (FILE *f_output, pst_item_attach *attach, char *boundary, pst_file *pst)
int valid_headers (char *header)
void header_has_field (char *header, char *field, int *flag)
void header_get_subfield (char *field, const char *subfield, char *body_subfield, size_t size_subfield)
char * header_get_field (char *header, char *field)
char * header_end_field (char *field)
void header_strip_field (char *header, char *field)
int test_base64 (char *body)
void find_html_charset (char *html, char *charset, size_t charsetlen)
void find_rfc822_headers (char **extra_mime_headers)
void write_body_part (FILE *f_output, pst_string *body, char *mime, char *charset, char *boundary, pst_file *pst)
void write_schedule_part_data (FILE *f_output, pst_item *item, const char *sender, const char *method)
void write_schedule_part (FILE *f_output, pst_item *item, const char *sender, const char *boundary)
void write_normal_email (FILE *f_output, char f_name[], pst_item *item, int mode, int mode_MH, pst_file *pst, int save_rtf, char **extra_mime_headers)
void write_vcard (FILE *f_output, pst_item *item, pst_item_contact *contact, char comment[])
int write_extra_categories (FILE *f_output, pst_item *item)
void write_journal (FILE *f_output, pst_item *item)
void write_appointment (FILE *f_output, pst_item *item)
void create_enter_dir (struct file_ll *f, pst_item *item)
void close_enter_dir (struct file_ll *f)
int grim_reaper (int waitall)

Variables

const char * prog_name
char * output_dir = "."
char * kmail_chdir = NULL
int mode = 0
int mode_MH = 0
int mode_EX = 0
int mode_thunder = 0
int output_mode = 0
int contact_mode = 0
int deleted_mode = 0
int output_type_mode = 0xff
int contact_mode_specified = 0
int overwrite = 0
int save_rtf_body = 1
int file_name_len = 10
pst_file pstfile
regex_t meta_charset_pattern
int number_processors = 1
int max_children = 0
int max_child_specified = 0
int active_children
pid_t * child_processes
int shared_memory_id
sem_t * global_children = NULL
sem_t * output_mutex = NULL


Define Documentation

#define C_TIME_SIZE   500
 

Definition at line 17 of file readpst.c.

#define CMODE_LIST   1
 

Definition at line 103 of file readpst.c.

#define CMODE_VCARD   0
 

Definition at line 102 of file readpst.c.

#define DMODE_EXCLUDE   0
 

Definition at line 106 of file readpst.c.

#define DMODE_INCLUDE   1
 

Definition at line 107 of file readpst.c.

#define KMAIL_INDEX   ".%s.index"
 

Definition at line 13 of file readpst.c.

#define MIME_TYPE_DEFAULT   "application/octet-stream"
 

Definition at line 98 of file readpst.c.

#define MODE_KMAIL   1
 

Definition at line 79 of file readpst.c.

#define MODE_NORMAL   0
 

Definition at line 75 of file readpst.c.

#define MODE_RECURSE   2
 

Definition at line 83 of file readpst.c.

#define MODE_SEPARATE   3
 

Definition at line 88 of file readpst.c.

#define OTMODE_APPOINTMENT   2
 

Definition at line 111 of file readpst.c.

#define OTMODE_CONTACT   8
 

Definition at line 113 of file readpst.c.

#define OTMODE_EMAIL   1
 

Definition at line 110 of file readpst.c.

#define OTMODE_JOURNAL   4
 

Definition at line 112 of file readpst.c.

#define OUTPUT_KMAIL_DIR_TEMPLATE   ".%s.directory"
 

Definition at line 12 of file readpst.c.

#define OUTPUT_NORMAL   0
 

Definition at line 92 of file readpst.c.

#define OUTPUT_QUIET   1
 

Definition at line 95 of file readpst.c.

#define OUTPUT_TEMPLATE   "%s"
 

Definition at line 11 of file readpst.c.

#define RFC822   "message/rfc822"
 

Definition at line 99 of file readpst.c.

#define RTF_ATTACH_NAME   "rtf-body.rtf"
 

Definition at line 117 of file readpst.c.

#define RTF_ATTACH_TYPE   "application/rtf"
 

Definition at line 119 of file readpst.c.

#define SEP_MAIL_FILE_TEMPLATE   "%i%s"
 

Definition at line 14 of file readpst.c.


Function Documentation

void check_filename char *  fname  ) 
 

Referenced by write_separate_attachment().

void close_enter_dir struct file_ll f  ) 
 

Definition at line 40 of file lspst.c.

References file_ll::dname.

Referenced by process().

int close_kmail_dir  ) 
 

int close_recurse_dir  ) 
 

int close_separate_dir  ) 
 

void close_separate_file struct file_ll f  ) 
 

void create_enter_dir struct file_ll f,
pst_item item
 

Definition at line 29 of file lspst.c.

References file_ll::dname, pst_item::file_as, pst_item::folder, pst_item_folder::item_count, file_ll::item_count, pst_convert_utf8(), file_ll::skip_count, file_ll::stored_count, pst_string::str, pst_item::type, and file_ll::type.

Referenced by process().

Here is the call graph for this function:

void find_html_charset char *  html,
char *  charset,
size_t  charsetlen
 

void find_rfc822_headers char **  extra_mime_headers  ) 
 

int grim_reaper int  waitall  ) 
 

Definition at line 150 of file readpst.c.

References active_children, child_processes, DEBUG_INFO, and global_children.

int grim_reaper  ) 
 

Referenced by try_fork().

char* header_end_field char *  field  ) 
 

char* header_get_field char *  header,
char *  field
 

void header_get_subfield char *  field,
const char *  subfield,
char *  body_subfield,
size_t  size_subfield
 

void header_has_field char *  header,
char *  field,
int *  flag
 

void header_strip_field char *  header,
char *  field
 

char* mk_kmail_dir char *  fname  ) 
 

char* mk_recurse_dir char *  dir,
int32_t  folder_type
 

char* mk_separate_dir char *  dir  ) 
 

void mk_separate_file struct file_ll f,
char *  extension
 

char* my_stristr char *  haystack,
char *  needle
 

void process pst_item outeritem,
pst_desc_tree d_ptr
 

write extra vcard or vcalendar categories from the extra keywords fields

Parameters:
f_output open file pointer
item pst item containing the keywords
Returns:
true if we write a categories line

Definition at line 46 of file lspst.c.

References pst_desc_tree::child, close_enter_dir(), create_enter_dir(), pst_desc_tree::d_id, DEBUG_ENT, DEBUG_INFO, DEBUG_RET, DEBUG_WARN, pst_desc_tree::desc, DIE, pst_index_ll::i_id, memset(), pst_desc_tree::next, pst_convert_utf8(), pst_freeItem(), pst_parse_item(), pst_rfc2426_escape(), pst_rfc2445_datetime_format(), pstfile, file_ll::skip_count, time_buffer, and pst_item::type.

Referenced by main().

Here is the call graph for this function:

void removeCR char *  c  ) 
 

Referenced by write_normal_email().

int test_base64 char *  body  ) 
 

pid_t try_fork char *  folder  ) 
 

Definition at line 195 of file readpst.c.

References active_children, child_processes, global_children, grim_reaper(), max_children, memset(), pst_reopen(), and pstfile.

Here is the call graph for this function:

void usage  ) 
 

int valid_headers char *  header  ) 
 

void version  ) 
 

void write_appointment FILE *  f_output,
pst_item item
 

void write_body_part FILE *  f_output,
pst_string body,
char *  mime,
char *  charset,
char *  boundary,
pst_file pst
 

void write_email_body FILE *  f,
char *  body
 

void write_embedded_message FILE *  f_output,
pst_item_attach attach,
char *  boundary,
pst_file pf,
char **  extra_mime_headers
 

int write_extra_categories FILE *  f_output,
pst_item item
 

void write_inline_attachment FILE *  f_output,
pst_item_attach attach,
char *  boundary,
pst_file pst
 

void write_journal FILE *  f_output,
pst_item item
 

void write_normal_email FILE *  f_output,
char  f_name[],
pst_item item,
int  mode,
int  mode_MH,
pst_file pst,
int  save_rtf,
char **  extra_mime_headers
 

void write_schedule_part FILE *  f_output,
pst_item item,
const char *  sender,
const char *  boundary
 

void write_schedule_part_data FILE *  f_output,
pst_item item,
const char *  sender,
const char *  method
 

void write_separate_attachment char  f_name[],
pst_item_attach attach,
int  attach_num,
pst_file pst
 

Referenced by write_normal_email().

void write_vcard FILE *  f_output,
pst_item item,
pst_item_contact contact,
char  comment[]
 


Variable Documentation

int active_children
 

Definition at line 140 of file readpst.c.

Referenced by grim_reaper(), and try_fork().

pid_t* child_processes
 

Definition at line 141 of file readpst.c.

Referenced by grim_reaper(), and try_fork().

int contact_mode = 0
 

Definition at line 127 of file readpst.c.

int contact_mode_specified = 0
 

Definition at line 130 of file readpst.c.

int deleted_mode = 0
 

Definition at line 128 of file readpst.c.

int file_name_len = 10
 

Definition at line 133 of file readpst.c.

sem_t* global_children = NULL
 

Definition at line 145 of file readpst.c.

Referenced by grim_reaper(), and try_fork().

char* kmail_chdir = NULL
 

Definition at line 71 of file readpst.c.

int max_child_specified = 0
 

Definition at line 139 of file readpst.c.

int max_children = 0
 

Definition at line 138 of file readpst.c.

Referenced by try_fork().

regex_t meta_charset_pattern
 

Definition at line 135 of file readpst.c.

int mode = 0
 

Definition at line 122 of file readpst.c.

int mode_EX = 0
 

Definition at line 124 of file readpst.c.

int mode_MH = 0
 

Definition at line 123 of file readpst.c.

int mode_thunder = 0
 

Definition at line 125 of file readpst.c.

int number_processors = 1
 

Definition at line 137 of file readpst.c.

char* output_dir = "."
 

Definition at line 70 of file readpst.c.

int output_mode = 0
 

Definition at line 126 of file readpst.c.

sem_t* output_mutex = NULL
 

Definition at line 146 of file readpst.c.

int output_type_mode = 0xff
 

Definition at line 129 of file readpst.c.

int overwrite = 0
 

Definition at line 131 of file readpst.c.

const char* prog_name
 

Definition at line 69 of file readpst.c.

pst_file pstfile
 

Definition at line 134 of file readpst.c.

int save_rtf_body = 1
 

Definition at line 132 of file readpst.c.

int shared_memory_id
 

Definition at line 144 of file readpst.c.


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