4 #include "tnef-types.h"
7 #define STD_ARGLIST (TNEFStruct *TNEF, int id, unsigned char *data, int size)
8 DWORD SwapDWord(BYTE *p);
9 WORD SwapWord(BYTE *p);
12 void TNEFInitMapi(MAPIProps *p);
13 void TNEFInitAttachment(Attachment *p);
14 void TNEFInitialize(TNEFStruct *TNEF);
15 void TNEFFree(TNEFStruct *TNEF);
16 void TNEFFreeAttachment(Attachment *p);
17 void TNEFFreeMapiProps(MAPIProps *p);
18 int TNEFCheckForSignature(DWORD sig);
19 int TNEFParseMemory(BYTE *memory, long size, TNEFStruct *TNEF);
20 int TNEFParseFile(char *filename, TNEFStruct *TNEF);
21 int TNEFParse(TNEFStruct *TNEF);
22 variableLength *MAPIFindUserProp(MAPIProps *p, unsigned int ID);
23 variableLength *MAPIFindProperty(MAPIProps *p, unsigned int ID);
24 int MAPISysTimetoDTR(BYTE *data, dtr *thedate);
25 void MAPIPrint(MAPIProps *p);
26 char* to_utf8(int len, char* buf);
27 WORD SwapWord(BYTE *p);
28 DWORD SwapDWord(BYTE *p);
29 DDWORD SwapDDWord(BYTE *p);
30 variableLength *MAPIFindUserProp(MAPIProps *p, unsigned int ID);
31 variableLength *MAPIFindProperty(MAPIProps *p, unsigned int ID);
32 unsigned char * DecompressRTF(variableLength *p, int *size);
34 /* ------------------------------------- */
35 /* TNEF Down-level Attributes/Properties */
36 /* ------------------------------------- */
38 #define atpTriples ((WORD) 0x0000)
39 #define atpString ((WORD) 0x0001)
40 #define atpText ((WORD) 0x0002)
41 #define atpDate ((WORD) 0x0003)
42 #define atpShort ((WORD) 0x0004)
43 #define atpLong ((WORD) 0x0005)
44 #define atpByte ((WORD) 0x0006)
45 #define atpWord ((WORD) 0x0007)
46 #define atpDword ((WORD) 0x0008)
47 #define atpMax ((WORD) 0x0009)
49 #define LVL_MESSAGE ((BYTE) 0x01)
50 #define LVL_ATTACHMENT ((BYTE) 0x02)
52 #define ATT_ID(_att) ((WORD) ((_att) & 0x0000FFFF))
53 #define ATT_TYPE(_att) ((WORD) (((_att) >> 16) & 0x0000FFFF))
54 #define ATT(_atp, _id) ((((DWORD) (_atp)) << 16) | ((WORD) (_id)))
56 #define attNull ATT( 0, 0x0000)
57 #define attFrom ATT( atpTriples, 0x8000) /* PR_ORIGINATOR_RETURN_ADDRESS */
58 #define attSubject ATT( atpString, 0x8004) /* PR_SUBJECT */
59 #define attDateSent ATT( atpDate, 0x8005) /* PR_CLIENT_SUBMIT_TIME */
60 #define attDateRecd ATT( atpDate, 0x8006) /* PR_MESSAGE_DELIVERY_TIME */
61 #define attMessageStatus ATT( atpByte, 0x8007) /* PR_MESSAGE_FLAGS */
62 #define attMessageClass ATT( atpWord, 0x8008) /* PR_MESSAGE_CLASS */
63 #define attMessageID ATT( atpString, 0x8009) /* PR_MESSAGE_ID */
64 #define attParentID ATT( atpString, 0x800A) /* PR_PARENT_ID */
65 #define attConversationID ATT( atpString, 0x800B) /* PR_CONVERSATION_ID */
66 #define attBody ATT( atpText, 0x800C) /* PR_BODY */
67 #define attPriority ATT( atpShort, 0x800D) /* PR_IMPORTANCE */
68 #define attAttachData ATT( atpByte, 0x800F) /* PR_ATTACH_DATA_xxx */
69 #define attAttachTitle ATT( atpString, 0x8010) /* PR_ATTACH_FILENAME */
70 #define attAttachMetaFile ATT( atpByte, 0x8011) /* PR_ATTACH_RENDERING */
71 #define attAttachCreateDate ATT( atpDate, 0x8012) /* PR_CREATION_TIME */
72 #define attAttachModifyDate ATT( atpDate, 0x8013) /* PR_LAST_MODIFICATION_TIME */
73 #define attDateModified ATT( atpDate, 0x8020) /* PR_LAST_MODIFICATION_TIME */
74 #define attAttachTransportFilename ATT( atpByte, 0x9001) /* PR_ATTACH_TRANSPORT_NAME */
75 #define attAttachRenddata ATT( atpByte, 0x9002)
76 #define attMAPIProps ATT( atpByte, 0x9003)
77 #define attRecipTable ATT( atpByte, 0x9004) /* PR_MESSAGE_RECIPIENTS */
78 #define attAttachment ATT( atpByte, 0x9005)
79 #define attTnefVersion ATT( atpDword, 0x9006)
80 #define attOemCodepage ATT( atpByte, 0x9007)
81 #define attOriginalMessageClass ATT( atpWord, 0x0006) /* PR_ORIG_MESSAGE_CLASS */
83 #define attOwner ATT( atpByte, 0x0000) /* PR_RCVD_REPRESENTING_xxx or
84 PR_SENT_REPRESENTING_xxx */
85 #define attSentFor ATT( atpByte, 0x0001) /* PR_SENT_REPRESENTING_xxx */
86 #define attDelegate ATT( atpByte, 0x0002) /* PR_RCVD_REPRESENTING_xxx */
87 #define attDateStart ATT( atpDate, 0x0006) /* PR_DATE_START */
88 #define attDateEnd ATT( atpDate, 0x0007) /* PR_DATE_END */
89 #define attAidOwner ATT( atpLong, 0x0008) /* PR_OWNER_APPT_ID */
90 #define attRequestRes ATT( atpShort, 0x0009) /* PR_RESPONSE_REQUESTED */
95 int (*handler) STD_ARGLIST;