comparison src/libpst.c @ 24:f4643b609bdf stable-0-5-3 **INVALID**

switch to automake/autoconf
author carl
date Mon, 20 Feb 2006 15:14:54 -0800
parents c508ee15dfca
children 51d826f31329
comparison
equal deleted inserted replaced
23:f86fa9e378a2 24:f4643b609bdf
470 return 1; 470 return 1;
471 } 471 }
472 472
473 473
474 #define BLOCK_SIZE 516 // index blocks 474 #define BLOCK_SIZE 516 // index blocks
475 #define DESC_BLOCK_SIZE 520 // descriptor blocks 475 #define DESC_BLOCK_SIZE 516 // descriptor blocks was 520 but bogus
476 #define ITEM_COUNT_OFFSET 0x1f0 // count byte 476 #define ITEM_COUNT_OFFSET 0x1f0 // count byte
477 #define LEVEL_INDICATOR_OFFSET 0x1f3 // node or leaf 477 #define LEVEL_INDICATOR_OFFSET 0x1f3 // node or leaf
478 #define BACKLINK_OFFSET 0x1f8 // backlink u1 value 478 #define BACKLINK_OFFSET 0x1f8 // backlink u1 value
479 #define ITEM_SIZE 12 479 #define ITEM_SIZE 12
480 #define DESC_SIZE 16 480 #define DESC_SIZE 16
1308 } else { 1308 } else {
1309 na_ptr->items[x]->id = table_rec.type; 1309 na_ptr->items[x]->id = table_rec.type;
1310 } 1310 }
1311 na_ptr->items[x]->type = 0; // checked later before it is set 1311 na_ptr->items[x]->type = 0; // checked later before it is set
1312 /* Reference Types 1312 /* Reference Types
1313 1313 0x0002 - Signed 16bit value
1314 2 - 0x0002 - Signed 16bit value 1314 0x0003 - Signed 32bit value
1315 3 - 0x0003 - Signed 32bit value 1315 0x0004 - 4-byte floating point
1316 4 - 0x0004 - 4-byte floating point 1316 0x0005 - Floating point double
1317 5 - 0x0005 - Floating point double 1317 0x0006 - Signed 64-bit int
1318 6 - 0x0006 - Signed 64-bit int 1318 0x0007 - Application Time
1319 7 - 0x0007 - Application Time 1319 0x000A - 32-bit error value
1320 10 - 0x000A - 32-bit error value 1320 0x000B - Boolean (non-zero = true)
1321 11 - 0x000B - Boolean (non-zero = true) 1321 0x000D - Embedded Object
1322 13 - 0x000D - Embedded Object 1322 0x0014 - 8-byte signed integer (64-bit)
1323 20 - 0x0014 - 8-byte signed integer (64-bit) 1323 0x001E - Null terminated String
1324 30 - 0x001E - Null terminated String 1324 0x001F - Unicode string
1325 31 - 0x001F - Unicode string 1325 0x0040 - Systime - Filetime structure
1326 64 - 0x0040 - Systime - Filetime structure 1326 0x0048 - OLE Guid
1327 72 - 0x0048 - OLE Guid 1327 0x0102 - Binary data
1328 258 - 0x0102 - Binary data 1328 0x1003 - Array of 32bit values
1329 1329 0x1014 - Array of 64bit values
1330 - 0x1003 - Array of 32bit values 1330 0x101E - Array of Strings
1331 - 0x1014 - Array of 64bit values 1331 0x1102 - Array of Binary data
1332 - 0x101E - Array of Strings
1333 - 0x1102 - Array of Binary data
1334 */ 1332 */
1335 1333
1336 if (table_rec.ref_type == 0x0003 || table_rec.ref_type == 0x000b 1334 if (table_rec.ref_type == 0x0002 || table_rec.ref_type == 0x0003 || table_rec.ref_type == 0x000b) {
1337 || table_rec.ref_type == 0x0002) { //contains data 1335 //contains data
1338 na_ptr->items[x]->data = xmalloc(sizeof(int32_t)); 1336 na_ptr->items[x]->data = xmalloc(sizeof(int32_t));
1339 memcpy(na_ptr->items[x]->data, &(table_rec.value), sizeof(int32_t)); 1337 memcpy(na_ptr->items[x]->data, &(table_rec.value), sizeof(int32_t));
1340
1341 na_ptr->items[x]->size = sizeof(int32_t); 1338 na_ptr->items[x]->size = sizeof(int32_t);
1342 na_ptr->items[x]->type = table_rec.ref_type; 1339 na_ptr->items[x]->type = table_rec.ref_type;
1343 1340
1344 } else if (table_rec.ref_type == 0x0005 || table_rec.ref_type == 0x000D 1341 } else if (table_rec.ref_type == 0x0005 || table_rec.ref_type == 0x000D
1345 || table_rec.ref_type == 0x1003 || table_rec.ref_type == 0x0014 1342 || table_rec.ref_type == 0x1003 || table_rec.ref_type == 0x0014
1346 || table_rec.ref_type == 0x001E || table_rec.ref_type == 0x0102 1343 || table_rec.ref_type == 0x001E || table_rec.ref_type == 0x0102
1347 || table_rec.ref_type == 0x0040 || table_rec.ref_type == 0x101E 1344 || table_rec.ref_type == 0x0040 || table_rec.ref_type == 0x101E
1348 || table_rec.ref_type == 0x0048 || table_rec.ref_type == 0x1102 1345 || table_rec.ref_type == 0x0048 || table_rec.ref_type == 0x1102
1349 || table_rec.ref_type == 0x1014) { 1346 || table_rec.ref_type == 0x1014) {
1350 //contains index_ref to data 1347 //contains index_ref to data
1351 LE32_CPU(table_rec.value); 1348 LE32_CPU(table_rec.value);
1352 if ((table_rec.value & 0x0000000F) == 0xF) { 1349 if ((table_rec.value & 0x0000000F) == 0xF) {
1353 // if value ends in 'F' then this should be an id2 value 1350 // if value ends in 'F' then this should be an id2 value
1354 DEBUG_EMAIL(("Found id2 [%#x] value. Will follow it\n", table_rec.value)); 1351 DEBUG_EMAIL(("Found id2 [%#x] value. Will follow it\n", table_rec.value));
1397 na_ptr->items[x]->type = type_d_rec->id; 1394 na_ptr->items[x]->type = type_d_rec->id;
1398 } 1395 }
1399 } 1396 }
1400 } else { 1397 } else {
1401 DEBUG_EMAIL(("Ignoring 0 value in offset\n")); 1398 DEBUG_EMAIL(("Ignoring 0 value in offset\n"));
1402 if (na_ptr->items[x]->data) 1399 if (na_ptr->items[x]->data) free (na_ptr->items[x]->data);
1403 free (na_ptr->items[x]->data);
1404 na_ptr->items[x]->data = NULL; 1400 na_ptr->items[x]->data = NULL;
1405
1406 free(na_ptr->items[x]); 1401 free(na_ptr->items[x]);
1407
1408 na_ptr->count_item--; // remove this item from the destination list 1402 na_ptr->count_item--; // remove this item from the destination list
1409 continue; 1403 continue;
1410 } 1404 }
1411 if (na_ptr->items[x]->type == 0) 1405 if (na_ptr->items[x]->type == 0)
1412 //it can be used to convey information 1406 //it can be used to convey information
2263 (t==3?"Attach by Ref. Resolve": 2257 (t==3?"Attach by Ref. Resolve":
2264 (t==4?"Attach by Ref. Only": 2258 (t==4?"Attach by Ref. Only":
2265 (t==5?"Embedded Message":"OLE")))))),t)); 2259 (t==5?"Embedded Message":"OLE")))))),t));
2266 //INC_CHECK_X(); 2260 //INC_CHECK_X();
2267 break; 2261 break;
2262 case 0x3707: // PR_ATTACH_LONG_FILENAME Attachment filename (long?)
2263 DEBUG_EMAIL(("Attachment Filename long - "));
2264 NULL_CHECK(attach);
2265 MOVE_NEXT(attach);
2266 LIST_COPY(attach->filename2, (char*));
2267 DEBUG_EMAIL(("%s\n", attach->filename2));
2268 //INC_CHECK_X();
2269 break;
2268 case 0x370B: // PR_RENDERING_POSITION 2270 case 0x370B: // PR_RENDERING_POSITION
2269 // position in characters that the attachment appears in the plain text body 2271 // position in characters that the attachment appears in the plain text body
2270 DEBUG_EMAIL(("Attachment Position - ")); 2272 DEBUG_EMAIL(("Attachment Position - "));
2271 NULL_CHECK(attach); 2273 NULL_CHECK(attach);
2272 MOVE_NEXT(attach); 2274 MOVE_NEXT(attach);
2273 memcpy(&(attach->position), list->items[x]->data, sizeof(attach->position)); 2275 memcpy(&(attach->position), list->items[x]->data, sizeof(attach->position));
2274 LE32_CPU(attach->position); 2276 LE32_CPU(attach->position);
2275 DEBUG_EMAIL(("%i [%#x]\n", attach->position)); 2277 DEBUG_EMAIL(("%i [%#x]\n", attach->position));
2276 //INC_CHECK_X();
2277 break;
2278 case 0x3707: // PR_ATTACH_LONG_FILENAME Attachment filename (long?)
2279 DEBUG_EMAIL(("Attachment Filename long - "));
2280 NULL_CHECK(attach);
2281 MOVE_NEXT(attach);
2282 LIST_COPY(attach->filename2, (char*));
2283 DEBUG_EMAIL(("%s\n", attach->filename2));
2284 //INC_CHECK_X(); 2278 //INC_CHECK_X();
2285 break; 2279 break;
2286 case 0x370E: // PR_ATTACH_MIME_TAG Mime type of encoding 2280 case 0x370E: // PR_ATTACH_MIME_TAG Mime type of encoding
2287 DEBUG_EMAIL(("Attachment mime encoding - ")); 2281 DEBUG_EMAIL(("Attachment mime encoding - "));
2288 NULL_CHECK(attach); 2282 NULL_CHECK(attach);