1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
/*
* Copyright (c) 2018 Oliver Giles <ohw.giles@gmail.com>
*
* This software is licensed under the GNU Lesser General Public License
* (version 2.1 or later). See the COPYING file in this distribution.
*/
[CCode (cheader_filename = "ytnef.h")]
namespace Ytnef {
[CCode (cname ="variableLength", has_type_id = false)]
public struct VariableLength {
[CCode (array_length_cname = "size")]
uint8[] data;
}
[CCode (cname = "MAPI_UNDEFINED")]
public VariableLength* MAPI_UNDEFINED;
[CCode (cname = "int", cprefix = "PT_", has_type_id = false)]
public enum PropType {
STRING8
}
[CCode (cname = "int", cprefix = "PR_", has_type_id = false)]
public enum PropID {
DISPLAY_NAME,
ATTACH_LONG_FILENAME
}
[CCode (cname = "PROP_TAG")]
public static int PROP_TAG(PropType type, PropID id);
[CCode (cname = "MAPIProps", has_type_id = false)]
public struct MAPIProps {
}
[CCode (cname = "Attachment", has_type_id = false)]
public struct Attachment {
VariableLength Title;
VariableLength FileData;
MAPIProps MAPI;
Attachment? next;
}
[CCode (cname = "TNEFStruct", destroy_function="TNEFFree", has_type_id = false)]
public struct TNEFStruct {
[CCode (cname = "TNEFInitialize")]
public TNEFStruct();
Attachment starting_attach;
}
[CCode (cname = "TNEFParseMemory", has_type_id = false)]
public static int ParseMemory(uint8[] data, ref TNEFStruct tnef);
[CCode (cname = "MAPIFindProperty")]
public static unowned VariableLength* MAPIFindProperty(MAPIProps MAPI, uint tag);
}
|