comparison src/pst2ldif.cpp @ 118:0f1492b7fe8b

patch from Fridrich Strba for building on mingw and general cleanup of autoconf files add processing for pst files of type 0x0f start adding support for properly building and installing libpst.so and the header files required to use it. remove version.h since the version number is now in config.h more const correctness issues regarding getopt()
author Carl Byington <carl@five-ten-sg.com>
date Sat, 31 Jan 2009 12:12:36 -0800
parents e213bfcf9aa7
children 6395ced2b8b2
comparison
equal deleted inserted replaced
117:0a3d854b53f6 118:0f1492b7fe8b
24 #include "lzfu.h" 24 #include "lzfu.h"
25 #include "stdarg.h" 25 #include "stdarg.h"
26 #include "iconv.h" 26 #include "iconv.h"
27 } 27 }
28 28
29 int32_t usage(); 29 void usage(void);
30 int32_t version(); 30 void version(void);
31 char *check_filename(char *fname); 31 char *check_filename(char *fname);
32 void print_ldif_single(const char *attr, const char *value); 32 void print_ldif_single(const char *attr, const char *value);
33 void print_ldif_address(const char *attr, int nvalues, char *value, ...); 33 void print_ldif_address(const char *attr, int nvalues, char *value, ...);
34 void print_ldif_dn(const char *attr, const char *value, const char *base); 34 void print_ldif_dn(const char *attr, const char *value, const char *base);
35 void print_ldif_multi(const char *dn, const char *value); 35 void print_ldif_multi(const char *dn, const char *value);
545 cn[i] = 0; 545 cn[i] = 0;
546 va_end(ap); 546 va_end(ap);
547 } 547 }
548 548
549 549
550 int main(int argc, char** argv) { 550 int main(int argc, char* const* argv) {
551 pst_desc_ll *d_ptr; 551 pst_desc_ll *d_ptr;
552 char *fname = NULL; 552 char *fname = NULL;
553 int c; 553 int c;
554 char *d_log = NULL; 554 char *d_log = NULL;
555 prog_name = argv[0]; 555 prog_name = argv[0];
655 655
656 return 0; 656 return 0;
657 } 657 }
658 658
659 659
660 int32_t usage() { 660 void usage(void) {
661 version(); 661 version();
662 printf("Usage: %s [OPTIONS] {PST FILENAME}\n", prog_name); 662 printf("Usage: %s [OPTIONS] {PST FILENAME}\n", prog_name);
663 printf("OPTIONS:\n"); 663 printf("OPTIONS:\n");
664 printf("\t-V\t- Version. Display program version\n"); 664 printf("\t-V\t- Version. Display program version\n");
665 printf("\t-C charset\t- assumed character set of non-ASCII characters\n"); 665 printf("\t-C charset\t- assumed character set of non-ASCII characters\n");
667 printf("\t-c class\t- set the class of the LDAP objects (may contain more than one)\n"); 667 printf("\t-c class\t- set the class of the LDAP objects (may contain more than one)\n");
668 printf("\t-d <filename>\t- Debug to file. This is a binary log. Use readpstlog to print it\n"); 668 printf("\t-d <filename>\t- Debug to file. This is a binary log. Use readpstlog to print it\n");
669 printf("\t-h\t- Help. This screen\n"); 669 printf("\t-h\t- Help. This screen\n");
670 printf("\t-l line\t- extra line to insert in the LDIF file for each contact\n"); 670 printf("\t-l line\t- extra line to insert in the LDIF file for each contact\n");
671 printf("\t-o\t- use old schema, default is new schema\n"); 671 printf("\t-o\t- use old schema, default is new schema\n");
672 return 0; 672 }
673 } 673
674 674
675 675 void version(void) {
676 int32_t version() {
677 printf("pst2ldif v%s\n", VERSION); 676 printf("pst2ldif v%s\n", VERSION);
678 #if BYTE_ORDER == BIG_ENDIAN 677 #if BYTE_ORDER == BIG_ENDIAN
679 printf("Big Endian implementation being used.\n"); 678 printf("Big Endian implementation being used.\n");
680 #elif BYTE_ORDER == LITTLE_ENDIAN 679 #elif BYTE_ORDER == LITTLE_ENDIAN
681 printf("Little Endian implementation being used.\n"); 680 printf("Little Endian implementation being used.\n");
683 # error "Byte order not supported by this library" 682 # error "Byte order not supported by this library"
684 #endif 683 #endif
685 #ifdef __GNUC__ 684 #ifdef __GNUC__
686 printf("GCC %d.%d : %s %s\n", __GNUC__, __GNUC_MINOR__, __DATE__, __TIME__); 685 printf("GCC %d.%d : %s %s\n", __GNUC__, __GNUC_MINOR__, __DATE__, __TIME__);
687 #endif 686 #endif
688 return 0;
689 } 687 }
690 688
691 689
692 char *check_filename(char *fname) { 690 char *check_filename(char *fname) {
693 char *t = fname; 691 char *t = fname;