Mercurial > libpst
comparison src/pst2ldif.cpp @ 114:e213bfcf9aa7 stable-0-6-24
patch from Chris Eagle to build on cygwin
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Thu, 11 Dec 2008 11:58:22 -0800 |
parents | 1b2a4fac1303 |
children | 0f1492b7fe8b |
comparison
equal
deleted
inserted
replaced
113:f04499f1ef90 | 114:e213bfcf9aa7 |
---|---|
369 char utf8_buffer[utf8_len]; | 369 char utf8_buffer[utf8_len]; |
370 char *utf8_p = utf8_buffer; | 370 char *utf8_p = utf8_buffer; |
371 | 371 |
372 iconv(cd, NULL, NULL, NULL, NULL); | 372 iconv(cd, NULL, NULL, NULL, NULL); |
373 p = buffer; | 373 p = buffer; |
374 int ret = iconv(cd, &p, &inlen, &utf8_p, &utf8_len); | 374 int ret = iconv(cd, (ICONV_CONST char**)&p, &inlen, &utf8_p, &utf8_len); |
375 | 375 |
376 if (ret >= 0) { | 376 if (ret >= 0) { |
377 *utf8_p = 0; | 377 *utf8_p = 0; |
378 p = base64_encode(utf8_buffer, utf8_p - utf8_buffer); | 378 p = base64_encode(utf8_buffer, utf8_p - utf8_buffer); |
379 } | 379 } |
655 | 655 |
656 return 0; | 656 return 0; |
657 } | 657 } |
658 | 658 |
659 | 659 |
660 int usage() { | 660 int32_t usage() { |
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"); |
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 return 0; |
673 } | 673 } |
674 | 674 |
675 | 675 |
676 int version() { | 676 int32_t version() { |
677 printf("pst2ldif v%s\n", VERSION); | 677 printf("pst2ldif v%s\n", VERSION); |
678 #if BYTE_ORDER == BIG_ENDIAN | 678 #if BYTE_ORDER == BIG_ENDIAN |
679 printf("Big Endian implementation being used.\n"); | 679 printf("Big Endian implementation being used.\n"); |
680 #elif BYTE_ORDER == LITTLE_ENDIAN | 680 #elif BYTE_ORDER == LITTLE_ENDIAN |
681 printf("Little Endian implementation being used.\n"); | 681 printf("Little Endian implementation being used.\n"); |
743 char *utf8_p = utf8_buffer; | 743 char *utf8_p = utf8_buffer; |
744 | 744 |
745 utf8_buffer = (char *)malloc(utf8_len); | 745 utf8_buffer = (char *)malloc(utf8_len); |
746 utf8_p = utf8_buffer; | 746 utf8_p = utf8_buffer; |
747 iconv(cd, NULL, NULL, NULL, NULL); | 747 iconv(cd, NULL, NULL, NULL, NULL); |
748 if (iconv(cd, &p, &inlen, &utf8_p, &utf8_len) >= 0) { | 748 if (iconv(cd, (ICONV_CONST char**)&p, &inlen, &utf8_p, &utf8_len) >= 0) { |
749 *utf8_p = 0; | 749 *utf8_p = 0; |
750 value = utf8_buffer; | 750 value = utf8_buffer; |
751 } | 751 } |
752 } | 752 } |
753 | 753 |