Mercurial > libpst
comparison src/readpst.c @ 50:fb3818370dd6 stable-0-6-4
more fixes for 64 bit format
author | carl |
---|---|
date | Sat, 19 Jan 2008 16:30:16 -0800 |
parents | f66078abed38 |
children | 034641c26ab9 |
comparison
equal
deleted
inserted
replaced
49:17654fbdf76b | 50:fb3818370dd6 |
---|---|
202 DEBUG_MAIN(("main: Processing Journal Entry\n")); | 202 DEBUG_MAIN(("main: Processing Journal Entry\n")); |
203 if (ff.type != PST_TYPE_JOURNAL) { | 203 if (ff.type != PST_TYPE_JOURNAL) { |
204 DEBUG_MAIN(("main: I have a journal entry, but the folder isn't a journal folder. Processing anyway\n")); | 204 DEBUG_MAIN(("main: I have a journal entry, but the folder isn't a journal folder. Processing anyway\n")); |
205 } | 205 } |
206 fprintf(ff.output, "BEGIN:VJOURNAL\n"); | 206 fprintf(ff.output, "BEGIN:VJOURNAL\n"); |
207 if (item->email->subject) | 207 if (item->email && item->email->subject && item->email->subject->subj) |
208 fprintf(ff.output, "SUMMARY:%s\n", pst_rfc2426_escape(item->email->subject->subj)); | 208 fprintf(ff.output, "SUMMARY:%s\n", pst_rfc2426_escape(item->email->subject->subj)); |
209 if (item->email->body) | 209 if (item->email && item->email->body) |
210 fprintf(ff.output, "DESCRIPTION:%s\n", pst_rfc2426_escape(item->email->body)); | 210 fprintf(ff.output, "DESCRIPTION:%s\n", pst_rfc2426_escape(item->email->body)); |
211 if (item->journal->start) | 211 if (item->journal->start) |
212 fprintf(ff.output, "DTSTART;VALUE=DATE-TIME:%s\n", pst_rfc2445_datetime_format(item->journal->start)); | 212 fprintf(ff.output, "DTSTART;VALUE=DATE-TIME:%s\n", pst_rfc2445_datetime_format(item->journal->start)); |
213 fprintf(ff.output, "END:VJOURNAL\n\n"); | 213 fprintf(ff.output, "END:VJOURNAL\n\n"); |
214 | 214 |
457 } | 457 } |
458 | 458 |
459 | 459 |
460 int version() { | 460 int version() { |
461 DEBUG_ENT("version"); | 461 DEBUG_ENT("version"); |
462 printf("ReadPST v%s\n", VERSION); | 462 printf("ReadPST / LibPST v%s\n", VERSION); |
463 #if BYTE_ORDER == BIG_ENDIAN | 463 #if BYTE_ORDER == BIG_ENDIAN |
464 printf("Big Endian implementation being used.\n"); | 464 printf("Big Endian implementation being used.\n"); |
465 #elif BYTE_ORDER == LITTLE_ENDIAN | 465 #elif BYTE_ORDER == LITTLE_ENDIAN |
466 printf("Little Endian implementation being used.\n"); | 466 printf("Little Endian implementation being used.\n"); |
467 #else | 467 #else |
1095 // We can only call rfc escape once per printf, since the second call | 1095 // We can only call rfc escape once per printf, since the second call |
1096 // may free the buffer returned by the first call. | 1096 // may free the buffer returned by the first call. |
1097 // I had tried to place those into a single printf - Carl. | 1097 // I had tried to place those into a single printf - Carl. |
1098 | 1098 |
1099 DEBUG_ENT("write_vcard"); | 1099 DEBUG_ENT("write_vcard"); |
1100 // the specification I am following is (hopefully) PST_RFC2426 vCard Mime Directory Profile | 1100 // the specification I am following is (hopefully) RFC2426 vCard Mime Directory Profile |
1101 fprintf(f_output, "BEGIN:VCARD\n"); | 1101 fprintf(f_output, "BEGIN:VCARD\n"); |
1102 fprintf(f_output, "FN:%s\n", pst_rfc2426_escape(contact->fullname)); | 1102 fprintf(f_output, "FN:%s\n", pst_rfc2426_escape(contact->fullname)); |
1103 | 1103 |
1104 //fprintf(f_output, "N:%s;%s;%s;%s;%s\n", | 1104 //fprintf(f_output, "N:%s;%s;%s;%s;%s\n", |
1105 fprintf(f_output, "N:%s;", (!contact->surname) ? "" : pst_rfc2426_escape(contact->surname)); | 1105 fprintf(f_output, "N:%s;", (!contact->surname) ? "" : pst_rfc2426_escape(contact->surname)); |
1211 if (appointment && appointment->location) | 1211 if (appointment && appointment->location) |
1212 fprintf(f_output, "LOCATION:%s\n", | 1212 fprintf(f_output, "LOCATION:%s\n", |
1213 pst_rfc2426_escape(appointment->location)); | 1213 pst_rfc2426_escape(appointment->location)); |
1214 if (appointment) { | 1214 if (appointment) { |
1215 switch (appointment->showas) { | 1215 switch (appointment->showas) { |
1216 case PST_FREEBUSY_TENTATIVE: | 1216 case PST_FREEBUSY_TENTATIVE: |
1217 fprintf(f_output, "STATUS:TENTATIVE\n"); | 1217 fprintf(f_output, "STATUS:TENTATIVE\n"); |
1218 break; | 1218 break; |
1219 case PST_FREEBUSY_FREE: | 1219 case PST_FREEBUSY_FREE: |
1220 // mark as transparent and as confirmed | 1220 // mark as transparent and as confirmed |
1221 fprintf(f_output, "TRANSP:TRANSPARENT\n"); | 1221 fprintf(f_output, "TRANSP:TRANSPARENT\n"); |
1222 case PST_FREEBUSY_BUSY: | 1222 case PST_FREEBUSY_BUSY: |
1223 case PST_FREEBUSY_OUT_OF_OFFICE: | 1223 case PST_FREEBUSY_OUT_OF_OFFICE: |
1224 fprintf(f_output, "STATUS:CONFIRMED\n"); | 1224 fprintf(f_output, "STATUS:CONFIRMED\n"); |
1225 break; | 1225 break; |
1226 } | 1226 } |
1227 switch (appointment->label) { | 1227 switch (appointment->label) { |
1228 case PST_APP_LABEL_NONE: | 1228 case PST_APP_LABEL_NONE: |
1229 fprintf(f_output, "CATEGORIES:NONE\n"); | 1229 fprintf(f_output, "CATEGORIES:NONE\n"); |
1230 break; | 1230 break; |
1231 case PST_APP_LABEL_IMPORTANT: | 1231 case PST_APP_LABEL_IMPORTANT: |
1232 fprintf(f_output, "CATEGORIES:IMPORTANT\n"); | 1232 fprintf(f_output, "CATEGORIES:IMPORTANT\n"); |
1233 break; | 1233 break; |
1234 case PST_APP_LABEL_BUSINESS: | 1234 case PST_APP_LABEL_BUSINESS: |
1235 fprintf(f_output, "CATEGORIES:BUSINESS\n"); | 1235 fprintf(f_output, "CATEGORIES:BUSINESS\n"); |
1236 break; | 1236 break; |
1237 case PST_APP_LABEL_PERSONAL: | 1237 case PST_APP_LABEL_PERSONAL: |
1238 fprintf(f_output, "CATEGORIES:PERSONAL\n"); | 1238 fprintf(f_output, "CATEGORIES:PERSONAL\n"); |
1239 break; | 1239 break; |
1240 case PST_APP_LABEL_VACATION: | 1240 case PST_APP_LABEL_VACATION: |
1241 fprintf(f_output, "CATEGORIES:VACATION\n"); | 1241 fprintf(f_output, "CATEGORIES:VACATION\n"); |
1242 break; | 1242 break; |
1243 case PST_APP_LABEL_MUST_ATTEND: | 1243 case PST_APP_LABEL_MUST_ATTEND: |
1244 fprintf(f_output, "CATEGORIES:MUST-ATTEND\n"); | 1244 fprintf(f_output, "CATEGORIES:MUST-ATTEND\n"); |
1245 break; | 1245 break; |
1246 case PST_APP_LABEL_TRAVEL_REQ: | 1246 case PST_APP_LABEL_TRAVEL_REQ: |
1247 fprintf(f_output, "CATEGORIES:TRAVEL-REQUIRED\n"); | 1247 fprintf(f_output, "CATEGORIES:TRAVEL-REQUIRED\n"); |
1248 break; | 1248 break; |
1249 case PST_APP_LABEL_NEEDS_PREP: | 1249 case PST_APP_LABEL_NEEDS_PREP: |
1250 fprintf(f_output, "CATEGORIES:NEEDS-PREPARATION\n"); | 1250 fprintf(f_output, "CATEGORIES:NEEDS-PREPARATION\n"); |
1251 break; | 1251 break; |
1252 case PST_APP_LABEL_BIRTHDAY: | 1252 case PST_APP_LABEL_BIRTHDAY: |
1253 fprintf(f_output, "CATEGORIES:BIRTHDAY\n"); | 1253 fprintf(f_output, "CATEGORIES:BIRTHDAY\n"); |
1254 break; | 1254 break; |
1255 case PST_APP_LABEL_ANNIVERSARY: | 1255 case PST_APP_LABEL_ANNIVERSARY: |
1256 fprintf(f_output, "CATEGORIES:ANNIVERSARY\n"); | 1256 fprintf(f_output, "CATEGORIES:ANNIVERSARY\n"); |
1257 break; | 1257 break; |
1258 case PST_APP_LABEL_PHONE_CALL: | 1258 case PST_APP_LABEL_PHONE_CALL: |
1259 fprintf(f_output, "CATEGORIES:PHONE-CALL\n"); | 1259 fprintf(f_output, "CATEGORIES:PHONE-CALL\n"); |
1260 break; | 1260 break; |
1261 } | 1261 } |
1262 } | 1262 } |
1263 fprintf(f_output, "END:VEVENT\n\n"); | 1263 fprintf(f_output, "END:VEVENT\n\n"); |
1264 } | 1264 } |
1265 | 1265 |