21,7 → 21,6 |
#include <stddef.h> |
#include <stdint.h> |
#include <assert.h> |
#include <time.h> |
|
#include "ff.h" |
#include "symtab.h" |
154,7 → 153,7 |
return x + pad; |
} |
|
size_t fixpipl(PIPropertyList *pipl, size_t origsize, char* title, char* component, char* category, long *event_id) { |
size_t fixpipl(PIPropertyList *pipl, size_t origsize, char* title, char* category, long *event_id) { |
PIProperty *prop; |
char *p; |
struct hstm_data { |
170,11 → 169,9 |
unsigned long hash; |
size_t realLength; |
size_t roundedLength; |
unsigned long componentVersion; |
time_t curTime; |
char szScope[0x300]; |
|
pipl->count += 4; // 4 more keys in PiPL: catg, name, cmpt, hstm |
pipl->count += 3; // 3 more keys in PiPL: name, catg, hstm |
|
p = (char*)pipl + origsize; |
prop = (PIProperty*)p; |
195,17 → 192,6 |
Photoshop (tested with Photoshop 7) will crash if the propertyLength follows the definition of PICA. |
*/ |
|
/* add Category property key */ |
|
prop->vendorID = kPhotoshopSignature; |
prop->propertyKey = PICategoryProperty; |
prop->propertyID = 0; |
prop->propertyLength = (SPInt32)roundToNext4(strlen(category) + 1); |
memset(prop->propertyData, 0x00, prop->propertyLength); // fill padding with 00h bytes (cosmetics) |
myc2pstrcpy((StringPtr)prop->propertyData, category); |
p += offsetof(PIProperty, propertyData) + prop->propertyLength; // skip past new property record, and any padding |
prop = (PIProperty*)p; |
|
/* add Title/Name property key */ |
|
prop->vendorID = kPhotoshopSignature; |
214,21 → 200,22 |
prop->propertyLength = (SPInt32)roundToNext4(strlen(title) + 1); |
memset(prop->propertyData, 0x00, prop->propertyLength); // fill padding with 00h bytes (cosmetics) |
myc2pstrcpy((StringPtr)prop->propertyData, title); |
p += offsetof(PIProperty, propertyData) + prop->propertyLength; // skip past new property record, and any padding |
|
// skip past new property record, and any padding |
p += offsetof(PIProperty, propertyData) + prop->propertyLength; |
prop = (PIProperty*)p; |
|
/* add Component property key */ |
/* add Category property key */ |
|
prop->vendorID = kPhotoshopSignature; |
prop->propertyKey = PIComponentProperty; |
prop->propertyKey = PICategoryProperty; |
prop->propertyID = 0; |
time(&curTime); |
componentVersion = (unsigned long)curTime - 946681200/*01.Jan.2000 00:00:00*/; |
prop->propertyLength = (SPInt32)roundToNext4(strlen(component) + 1 + sizeof(componentVersion)); |
|
prop->propertyLength = (SPInt32)roundToNext4(strlen(category) + 1); |
memset(prop->propertyData, 0x00, prop->propertyLength); // fill padding with 00h bytes (cosmetics) |
memcpy(prop->propertyData, &componentVersion, sizeof(componentVersion)); |
strcpy((char*)(prop->propertyData+sizeof(componentVersion)), component); |
p += offsetof(PIProperty, propertyData) + prop->propertyLength; // skip past new property record, and any padding |
myc2pstrcpy((StringPtr)prop->propertyData, category); |
|
p += offsetof(PIProperty, propertyData) + prop->propertyLength; |
prop = (PIProperty*)p; |
|
/* add HasTerminology property key */ |