#include <iostream>
#include <string>
#include <vector>
#include "define.h"
#include "lzfu.h"
Go to the source code of this file.
Data Structures | |
struct | file_ll |
Defines | |
#define | C_TIME_SIZE 500 |
Functions | |
static void | open_png () |
static void | close_png () |
static void | version () |
static void | usage () |
static char * | removeCR (char *c) |
static char * | skip_header_prologue (char *headers) |
static void | check_filename (string &fname) |
static string | write_separate_attachment (string fname, pst_item_attach *current_attach, int attach_num, pst_file *pst) |
static void | print_pdf_short (const char *line, int len, int color) |
static void | new_line () |
static void | print_pdf_single (const char *line, int color) |
static void | print_pdf_only (char *line, int color) |
static void | print_pdf (char *line) |
static void | open_pdf (char *line) |
static void | close_pdf () |
static void | write_simple (const char *tag, const char *value) |
static void | write_simple (const char *tag, string value) |
static void | write_simple (const char *tag, const char *value, const char *value2) |
static string | extract_header (char *headers, const char *field) |
static void | write_normal_email (file_ll &f, pst_item *item, pst_file *pst) |
static void | create_enter_dir (file_ll &f, file_ll *parent, pst_item *item) |
static void | close_enter_dir (file_ll &f) |
static void | process (pst_item *outeritem, file_ll *parent, pst_desc_tree *d_ptr) |
int | main (int argc, char *const *argv) |
Variables | |
const char * | convert = "/usr/bin/convert" |
const char * | prog_name = NULL |
const char * | bates_prefix = "" |
int | bates_index = 0 |
const char * | output_directory = "." |
const char * | output_file = "load.dii" |
char * | font_file = NULL |
int | bates_color = 0xff0000 |
int | email_sequence = 0 |
char * | pdf_name = NULL |
FILE * | dii_file = NULL |
pst_file | pstfile |
bool | pdf_open = false |
char * | pst_folder |
int | page_sequence |
string | conversion |
vector< string > | png_names |
bool | png_open = false |
int | line_height |
int | char_width |
int | col_number |
int | col_max |
int | line_number |
int | line_max |
int | x_position |
int | y_position |
int | black |
int | red |
gdImagePtr | image |
const int | DPI = 300 |
const double | sz = 10.0 |
const int | margin = DPI/2 |
const int | LINE_SIZE = 2000 |
const int | PAGE_WIDTH = DPI*17/2 |
const int | PAGE_HEIGHT = DPI*11 |
#define C_TIME_SIZE 500 |
Definition at line 74 of file pst2dii.cpp.
Referenced by write_normal_email().
static void check_filename | ( | string & | fname | ) | [static] |
Definition at line 146 of file pst2dii.cpp.
References DEBUG_ENT, and DEBUG_RET.
Referenced by create_enter_dir(), mk_kmail_dir(), mk_recurse_dir(), mk_separate_dir(), mk_separate_file(), and write_separate_attachment().
static void close_enter_dir | ( | file_ll & | f | ) | [static] |
Definition at line 597 of file pst2dii.cpp.
static void close_pdf | ( | ) | [static] |
Definition at line 381 of file pst2dii.cpp.
References close_png(), conversion, dii_file, pdf_name, and png_names.
Referenced by write_normal_email().
static void close_png | ( | ) | [static] |
Definition at line 343 of file pst2dii.cpp.
References conversion, image, page_sequence, png_names, png_open, and pst_malloc().
Referenced by close_pdf(), and print_pdf_short().
Definition at line 587 of file pst2dii.cpp.
References pst_item::file_as, pst_item::folder, pst_item_folder::item_count, file_ll::name, pst_convert_utf8(), file_ll::stored_count, pst_string::str, pst_item::type, and file_ll::type.
static string extract_header | ( | char * | headers, | |
const char * | field | |||
) | [static] |
Definition at line 419 of file pst2dii.cpp.
Referenced by write_normal_email().
int main | ( | int | argc, | |
char *const * | argv | |||
) |
Definition at line 637 of file pst2dii.cpp.
References bates_color, bates_index, bates_prefix, pst_desc_tree::child, pst_file::d_head, DEBUG_ENT, DEBUG_INIT, DEBUG_RET, DIE, dii_file, font_file, getopt(), pst_item::message_store, optarg, optind, output_directory, output_file, process, prog_name, pst_close(), pst_freeItem(), pst_getTopOfFolders(), pst_load_extended_attributes(), pst_load_index(), pst_open(), pst_parse_item(), RET_DERROR, usage(), and version().
static void new_line | ( | ) | [static] |
Definition at line 251 of file pst2dii.cpp.
References col_number, line_height, line_number, margin, x_position, and y_position.
Referenced by print_pdf_only(), and print_pdf_single().
static void open_pdf | ( | char * | line | ) | [static] |
Definition at line 364 of file pst2dii.cpp.
References conversion, convert, dii_file, email_sequence, open_png(), output_directory, page_sequence, pdf_name, png_names, pst_folder, and pst_malloc().
Referenced by write_normal_email().
static void open_png | ( | ) | [static] |
Definition at line 305 of file pst2dii.cpp.
References bates_color, bates_index, bates_prefix, black, char_width, col_max, col_number, DPI, font_file, image, line_height, line_max, line_number, LINE_SIZE, margin, PAGE_HEIGHT, PAGE_WIDTH, png_open, print_pdf_only(), pst_folder, red, sz, x_position, and y_position.
Referenced by open_pdf(), and print_pdf_short().
static void print_pdf | ( | char * | line | ) | [static] |
Definition at line 298 of file pst2dii.cpp.
References black, dii_file, print_pdf_only(), and pst_fwrite().
Referenced by write_normal_email().
static void print_pdf_only | ( | char * | line, | |
int | color | |||
) | [static] |
Definition at line 283 of file pst2dii.cpp.
References new_line(), and print_pdf_single().
Referenced by open_png(), print_pdf(), and write_normal_email().
static void print_pdf_short | ( | const char * | line, | |
int | len, | |||
int | color | |||
) | [static] |
Definition at line 215 of file pst2dii.cpp.
References close_png(), col_number, DPI, font_file, image, line_max, line_number, open_png(), sz, x_position, and y_position.
Referenced by print_pdf_single().
static void print_pdf_single | ( | const char * | line, | |
int | color | |||
) | [static] |
Definition at line 261 of file pst2dii.cpp.
References col_max, col_number, new_line(), and print_pdf_short().
Referenced by print_pdf_only().
static void process | ( | pst_item * | outeritem, | |
file_ll * | parent, | |||
pst_desc_tree * | d_ptr | |||
) | [static] |
Definition at line 603 of file pst2dii.cpp.
References pst_desc_tree::child, close_enter_dir(), create_enter_dir(), DEBUG_ENT, DEBUG_INFO, DEBUG_RET, pst_desc_tree::desc, pst_item::email, file_ll::email_count, pst_item::file_as, pst_item::folder, pst_desc_tree::next, process, pst_freeItem(), pst_parse_item(), PST_TYPE_NOTE, PST_TYPE_REPORT, PST_TYPE_SCHEDULE, file_ll::skip_count, pst_string::str, pst_item::type, and write_normal_email().
static char * removeCR | ( | char * | c | ) | [static] |
Definition at line 113 of file pst2dii.cpp.
References DEBUG_ENT, and DEBUG_RET.
Referenced by write_normal_email().
static char * skip_header_prologue | ( | char * | headers | ) | [static] |
Definition at line 134 of file pst2dii.cpp.
Referenced by write_normal_email().
static void usage | ( | void | ) | [static] |
Definition at line 95 of file pst2dii.cpp.
References prog_name, and version().
static void version | ( | void | ) | [static] |
Definition at line 81 of file pst2dii.cpp.
References VERSION.
Definition at line 443 of file pst2dii.cpp.
References pst_item_email::arrival_date, pst_item::attach, bates_index, pst_item_email::bcc_address, black, pst_item::body, C_TIME_SIZE, pst_item_email::cc_address, close_pdf(), pst_binary::data, DEBUG_ENT, DEBUG_INFO, DEBUG_RET, dii_file, pst_item::email, pst_item_email::encrypted_body, pst_item_email::encrypted_htmlbody, extract_header(), pst_item::flags, pst_item_email::header, pst_item_email::htmlbody, LINE_SIZE, pst_item_email::messageid, file_ll::name, pst_item_attach::next, open_pdf(), pst_item_email::outlook_sender, pst_item_email::outlook_sender_name, print_pdf(), print_pdf_only(), pst_convert_utf8_null(), pst_fileTimeToUnixTime(), pst_item_email::recip_address, removeCR(), pst_item_email::sender_address, pst_item_email::sent_date, pst_item_email::sentto_address, skip_header_prologue(), pst_string::str, pst_item::subject, write_separate_attachment(), and write_simple().
Referenced by process().
static string write_separate_attachment | ( | string | fname, | |
pst_item_attach * | current_attach, | |||
int | attach_num, | |||
pst_file * | pst | |||
) | [static] |
Definition at line 167 of file pst2dii.cpp.
References check_filename(), DEBUG_ENT, DEBUG_INFO, DEBUG_RET, DEBUG_WARN, DIE, pst_item_attach::filename1, pst_item_attach::filename2, output_directory, pst_attach_to_file(), pst_malloc(), and pst_string::str.
Referenced by write_normal_email().
static void write_simple | ( | const char * | tag, | |
const char * | value, | |||
const char * | value2 | |||
) | [static] |
Definition at line 409 of file pst2dii.cpp.
References dii_file.
static void write_simple | ( | const char * | tag, | |
string | value | |||
) | [static] |
Definition at line 402 of file pst2dii.cpp.
References dii_file.
static void write_simple | ( | const char * | tag, | |
const char * | value | |||
) | [static] |
Definition at line 395 of file pst2dii.cpp.
References dii_file.
Referenced by write_normal_email().
int bates_color = 0xff0000 |
Definition at line 43 of file pst2dii.cpp.
Referenced by main(), and open_png().
int bates_index = 0 |
Definition at line 39 of file pst2dii.cpp.
Referenced by main(), open_png(), and write_normal_email().
const char* bates_prefix = "" |
Definition at line 38 of file pst2dii.cpp.
Referenced by main(), and open_png().
int black |
Definition at line 63 of file pst2dii.cpp.
Referenced by open_png(), print_pdf(), and write_normal_email().
int char_width |
Definition at line 59 of file pst2dii.cpp.
Referenced by open_png().
int col_max |
Definition at line 60 of file pst2dii.cpp.
Referenced by open_png(), and print_pdf_single().
int col_number |
Definition at line 60 of file pst2dii.cpp.
Referenced by new_line(), open_png(), print_pdf_short(), and print_pdf_single().
string conversion |
Definition at line 53 of file pst2dii.cpp.
Referenced by close_pdf(), close_png(), and open_pdf().
Definition at line 36 of file pst2dii.cpp.
Referenced by open_pdf().
FILE* dii_file = NULL |
Definition at line 46 of file pst2dii.cpp.
Referenced by close_pdf(), main(), open_pdf(), print_pdf(), write_normal_email(), and write_simple().
const int DPI = 300 |
Definition at line 66 of file pst2dii.cpp.
Referenced by open_png(), and print_pdf_short().
int email_sequence = 0 |
Definition at line 44 of file pst2dii.cpp.
Referenced by open_pdf().
char* font_file = NULL |
Definition at line 42 of file pst2dii.cpp.
Referenced by main(), open_png(), and print_pdf_short().
gdImagePtr image |
Definition at line 64 of file pst2dii.cpp.
Referenced by close_png(), open_png(), and print_pdf_short().
int line_height |
Definition at line 58 of file pst2dii.cpp.
Referenced by new_line(), and open_png().
int line_max |
Definition at line 61 of file pst2dii.cpp.
Referenced by open_png(), and print_pdf_short().
int line_number |
Definition at line 61 of file pst2dii.cpp.
Referenced by new_line(), open_png(), and print_pdf_short().
const int LINE_SIZE = 2000 |
Definition at line 69 of file pst2dii.cpp.
Referenced by main(), open_png(), and write_normal_email().
Definition at line 68 of file pst2dii.cpp.
Referenced by new_line(), and open_png().
const char* output_directory = "." |
Definition at line 40 of file pst2dii.cpp.
Referenced by main(), open_pdf(), and write_separate_attachment().
const char* output_file = "load.dii" |
Definition at line 41 of file pst2dii.cpp.
Referenced by main().
const int PAGE_HEIGHT = DPI*11 |
Definition at line 71 of file pst2dii.cpp.
Referenced by open_png().
int page_sequence |
Definition at line 52 of file pst2dii.cpp.
Referenced by close_png(), and open_pdf().
const int PAGE_WIDTH = DPI*17/2 |
Definition at line 70 of file pst2dii.cpp.
Referenced by open_png().
char* pdf_name = NULL |
Definition at line 45 of file pst2dii.cpp.
Referenced by close_pdf(), and open_pdf().
bool pdf_open = false |
Definition at line 50 of file pst2dii.cpp.
vector<string> png_names |
Definition at line 54 of file pst2dii.cpp.
Referenced by close_pdf(), close_png(), and open_pdf().
bool png_open = false |
Definition at line 57 of file pst2dii.cpp.
Referenced by close_png(), and open_png().
const char* prog_name = NULL |
Definition at line 37 of file pst2dii.cpp.
char* pst_folder |
Definition at line 51 of file pst2dii.cpp.
Referenced by open_pdf(), and open_png().
Definition at line 47 of file pst2dii.cpp.
int red |
Definition at line 63 of file pst2dii.cpp.
Referenced by open_png().
const double sz = 10.0 |
Definition at line 67 of file pst2dii.cpp.
Referenced by open_png(), and print_pdf_short().
int x_position |
Definition at line 62 of file pst2dii.cpp.
Referenced by new_line(), open_png(), and print_pdf_short().
int y_position |
Definition at line 62 of file pst2dii.cpp.
Referenced by new_line(), open_png(), and print_pdf_short().