1 | /*
|
---|
2 | * Copyright (C) 2004 Chris Morgan
|
---|
3 | *
|
---|
4 | * This library is free software; you can redistribute it and/or
|
---|
5 | * modify it under the terms of the GNU Lesser General Public
|
---|
6 | * License as published by the Free Software Foundation; either
|
---|
7 | * version 2.1 of the License, or (at your option) any later version.
|
---|
8 | *
|
---|
9 | * This library is distributed in the hope that it will be useful,
|
---|
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
12 | * Lesser General Public License for more details.
|
---|
13 | *
|
---|
14 | * You should have received a copy of the GNU Lesser General Public
|
---|
15 | * License along with this library; if not, write to the Free Software
|
---|
16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
---|
17 | */
|
---|
18 |
|
---|
19 | /*
|
---|
20 | * Sun LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
|
---|
21 | * other than GPL or LGPL is available it will apply instead, Sun elects to use only
|
---|
22 | * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
|
---|
23 | * a choice of LGPL license versions is made available with the language indicating
|
---|
24 | * that LGPLv2 or any later version may be used, or where a choice of which version
|
---|
25 | * of the LGPL is applied is otherwise unspecified.
|
---|
26 | */
|
---|
27 |
|
---|
28 | #ifndef _XCMC_H
|
---|
29 | #define _XCMC_H
|
---|
30 |
|
---|
31 | #ifdef __cplusplus
|
---|
32 | extern "C" {
|
---|
33 | #endif
|
---|
34 |
|
---|
35 | typedef char CMC_sint8;
|
---|
36 | typedef short CMC_sint16;
|
---|
37 | typedef LONG CMC_sint32;
|
---|
38 | typedef unsigned short int CMC_uint16;
|
---|
39 | typedef ULONG CMC_uint32;
|
---|
40 | typedef void* CMC_buffer;
|
---|
41 | typedef char* CMC_string;
|
---|
42 |
|
---|
43 | typedef CMC_uint16 CMC_boolean;
|
---|
44 | typedef CMC_sint32 CMC_enum;
|
---|
45 | typedef CMC_uint32 CMC_return_code;
|
---|
46 | typedef CMC_uint32 CMC_flags;
|
---|
47 | typedef CMC_string CMC_object_identifier;
|
---|
48 | typedef CMC_uint32 CMC_session_id;
|
---|
49 | typedef CMC_uint32 CMC_ui_id;
|
---|
50 |
|
---|
51 | #define CMC_FALSE ((CMC_boolean)0)
|
---|
52 | #define CMC_TRUE ((CMC_boolean)1)
|
---|
53 |
|
---|
54 | #define CMC_SUCCESS ((CMC_return_code) 0)
|
---|
55 |
|
---|
56 | #define CMC_E_AMBIGUOUS_RECIPIENT ((CMC_return_code) 1)
|
---|
57 | #define CMC_E_ATTACHMENT_NOT_FOUND ((CMC_return_code) 2)
|
---|
58 | #define CMC_E_ATTACHMENT_OPEN_FAILURE ((CMC_return_code) 3)
|
---|
59 | #define CMC_E_ATTACHMENT_READ_FAILURE ((CMC_return_code) 4)
|
---|
60 | #define CMC_E_ATTACHMENT_WRITE_FAILURE ((CMC_return_code) 5)
|
---|
61 | #define CMC_E_COUNTED_STRING_UNSUPPORTED ((CMC_return_code) 6)
|
---|
62 | #define CMC_E_DISK_FULL ((CMC_return_code) 7)
|
---|
63 | #define CMC_E_FAILURE ((CMC_return_code) 8)
|
---|
64 | #define CMC_E_INSUFFICIENT_MEMORY ((CMC_return_code) 9)
|
---|
65 | #define CMC_E_INVALID_CONFIGURATION ((CMC_return_code) 10)
|
---|
66 | #define CMC_E_INVALID_ENUM ((CMC_return_code) 11)
|
---|
67 | #define CMC_E_INVALID_FLAG ((CMC_return_code) 12)
|
---|
68 | #define CMC_E_INVALID_MEMORY ((CMC_return_code) 13)
|
---|
69 | #define CMC_E_INVALID_MESSAGE_PARAMETER ((CMC_return_code) 14)
|
---|
70 | #define CMC_E_INVALID_MESSAGE_REFERENCE ((CMC_return_code) 15)
|
---|
71 | #define CMC_E_INVALID_PARAMETER ((CMC_return_code) 16)
|
---|
72 | #define CMC_E_INVALID_SESSION_ID ((CMC_return_code) 17)
|
---|
73 | #define CMC_E_INVALID_UI_ID ((CMC_return_code) 18)
|
---|
74 | #define CMC_E_LOGON_FAILURE ((CMC_return_code) 19)
|
---|
75 | #define CMC_E_MESSAGE_IN_USE ((CMC_return_code) 20)
|
---|
76 | #define CMC_E_NOT_SUPPORTED ((CMC_return_code) 21)
|
---|
77 | #define CMC_E_PASSWORD_REQUIRED ((CMC_return_code) 22)
|
---|
78 | #define CMC_E_RECIPIENT_NOT_FOUND ((CMC_return_code) 23)
|
---|
79 | #define CMC_E_SERVICE_UNAVAILABLE ((CMC_return_code) 24)
|
---|
80 | #define CMC_E_TEXT_TOO_LARGE ((CMC_return_code) 25)
|
---|
81 | #define CMC_E_TOO_MANY_FILES ((CMC_return_code) 26)
|
---|
82 | #define CMC_E_TOO_MANY_RECIPIENTS ((CMC_return_code) 27)
|
---|
83 | #define CMC_E_UNABLE_TO_NOT_MARK_AS_READ ((CMC_return_code) 28)
|
---|
84 | #define CMC_E_UNRECOGNIZED_MESSAGE_TYPE ((CMC_return_code) 29)
|
---|
85 | #define CMC_E_UNSUPPORTED_ACTION ((CMC_return_code) 30)
|
---|
86 | #define CMC_E_UNSUPPORTED_CHARACTER_SET ((CMC_return_code) 31)
|
---|
87 | #define CMC_E_UNSUPPORTED_DATA_EXT ((CMC_return_code) 32)
|
---|
88 | #define CMC_E_UNSUPPORTED_FLAG ((CMC_return_code) 33)
|
---|
89 | #define CMC_E_UNSUPPORTED_FUNCTION_EXT ((CMC_return_code) 34)
|
---|
90 | #define CMC_E_UNSUPPORTED_VERSION ((CMC_return_code) 35)
|
---|
91 | #define CMC_E_USER_CANCEL ((CMC_return_code) 36)
|
---|
92 | #define CMC_E_USER_NOT_LOGGED_ON ((CMC_return_code) 37)
|
---|
93 |
|
---|
94 | #define CMC_ERROR_DISPLAYED ((CMC_return_code) 0x00008000)
|
---|
95 | #define CMC_ERROR_RSV_MASK ((CMC_return_code) 0x0000FFFF)
|
---|
96 | #define CMC_ERROR_IMPL_MASK ((CMC_return_code) 0xFFFF0000)
|
---|
97 |
|
---|
98 | typedef struct {
|
---|
99 | CMC_uint32 length;
|
---|
100 | char string[1];
|
---|
101 | } CMC_counted_string;
|
---|
102 |
|
---|
103 | typedef CMC_counted_string CMC_message_reference;
|
---|
104 |
|
---|
105 | typedef struct {
|
---|
106 | CMC_sint8 second;
|
---|
107 | CMC_sint8 minute;
|
---|
108 | CMC_sint8 hour;
|
---|
109 | CMC_sint8 day;
|
---|
110 | CMC_sint8 month;
|
---|
111 | CMC_sint8 year;
|
---|
112 | CMC_sint8 isdst;
|
---|
113 | CMC_sint8 unused1;
|
---|
114 | CMC_sint16 tmzone;
|
---|
115 | CMC_sint16 unused2;
|
---|
116 | } CMC_time;
|
---|
117 |
|
---|
118 | #define CMC_NO_TIMEZONE ((CMC_sint16) 0x8000)
|
---|
119 |
|
---|
120 |
|
---|
121 | typedef struct {
|
---|
122 | CMC_uint32 item_code;
|
---|
123 | CMC_uint32 item_data;
|
---|
124 | CMC_buffer item_reference;
|
---|
125 | CMC_flags extension_flags;
|
---|
126 | } CMC_extension;
|
---|
127 |
|
---|
128 | #define CMC_EXT_REQUIRED ((CMC_flags) 0x00010000)
|
---|
129 | #define CMC_EXT_OUTPUT ((CMC_flags) 0x00020000)
|
---|
130 | #define CMC_EXT_LAST_ELEMENT ((CMC_flags) 0x80000000)
|
---|
131 | #define CMC_EXT_RSV_FLAG_MASK ((CMC_flags) 0xFFFF0000)
|
---|
132 | #define CMC_EXT_ITEM_FLAG_MASK ((CMC_flags) 0x0000FFFF)
|
---|
133 |
|
---|
134 |
|
---|
135 | typedef struct CMC_attachment_s {
|
---|
136 | CMC_string attach_title;
|
---|
137 | CMC_object_identifier attach_type;
|
---|
138 | CMC_string attach_filename;
|
---|
139 | CMC_flags attach_flags;
|
---|
140 | CMC_extension *attach_extensions;
|
---|
141 | } CMC_attachment;
|
---|
142 |
|
---|
143 | #define CMC_ATT_APP_OWNS_FILE ((CMC_flags) 1)
|
---|
144 | #define CMC_ATT_LAST_ELEMENT ((CMC_flags) 0x80000000)
|
---|
145 |
|
---|
146 | #define CMC_ATT_OID_BINARY "? ? ? ? ? ?"
|
---|
147 | #define CMC_ATT_OID_TEXT "? ? ? ? ? ?"
|
---|
148 |
|
---|
149 |
|
---|
150 | typedef struct {
|
---|
151 | CMC_string name;
|
---|
152 | CMC_enum name_type;
|
---|
153 | CMC_string address;
|
---|
154 | CMC_enum role;
|
---|
155 | CMC_flags recip_flags;
|
---|
156 | CMC_extension *recip_extensions;
|
---|
157 | } CMC_recipient;
|
---|
158 |
|
---|
159 | #define CMC_TYPE_UNKNOWN ((CMC_enum) 0)
|
---|
160 | #define CMC_TYPE_INDIVIDUAL ((CMC_enum) 1)
|
---|
161 | #define CMC_TYPE_GROUP ((CMC_enum) 2)
|
---|
162 |
|
---|
163 | #define CMC_ROLE_TO ((CMC_enum) 0)
|
---|
164 | #define CMC_ROLE_CC ((CMC_enum) 1)
|
---|
165 | #define CMC_ROLE_BCC ((CMC_enum) 2)
|
---|
166 | #define CMC_ROLE_ORIGINATOR ((CMC_enum) 3)
|
---|
167 | #define CMC_ROLE_AUTHORIZING_USER ((CMC_enum) 4)
|
---|
168 |
|
---|
169 | #define CMC_RECIP_IGNORE ((CMC_flags) 1)
|
---|
170 | #define CMC_RECIP_LIST_TRUNCATED ((CMC_flags) 2)
|
---|
171 | #define CMC_RECIP_LAST_ELEMENT ((CMC_flags) 0x80000000)
|
---|
172 |
|
---|
173 |
|
---|
174 | typedef struct {
|
---|
175 | CMC_message_reference *message_reference;
|
---|
176 | CMC_string message_type;
|
---|
177 | CMC_string subject;
|
---|
178 | CMC_time time_sent;
|
---|
179 | CMC_string text_note;
|
---|
180 | CMC_recipient *recipients;
|
---|
181 | CMC_attachment *attachments;
|
---|
182 | CMC_flags message_flags;
|
---|
183 | CMC_extension *message_extensions;
|
---|
184 | } CMC_message;
|
---|
185 |
|
---|
186 | #define CMC_MSG_READ ((CMC_flags) 1)
|
---|
187 | #define CMC_MSG_TEXT_NOTE_AS_FILE ((CMC_flags) 2)
|
---|
188 | #define CMC_MSG_UNSENT ((CMC_flags) 4)
|
---|
189 | #define CMC_MSG_LAST_ELEMENT ((CMC_flags) 0x80000000)
|
---|
190 |
|
---|
191 |
|
---|
192 | typedef struct {
|
---|
193 | CMC_message_reference *message_reference;
|
---|
194 | CMC_string message_type;
|
---|
195 | CMC_string subject;
|
---|
196 | CMC_time time_sent;
|
---|
197 | CMC_uint32 byte_length;
|
---|
198 | CMC_recipient *originator;
|
---|
199 | CMC_flags summary_flags;
|
---|
200 | CMC_extension *message_summary_extensions;
|
---|
201 | } CMC_message_summary;
|
---|
202 |
|
---|
203 | #define CMC_SUM_READ ((CMC_flags) 1)
|
---|
204 | #define CMC_SUM_UNSENT ((CMC_flags) 2)
|
---|
205 | #define CMC_SUM_LAST_ELEMENT ((CMC_flags) 0x80000000)
|
---|
206 |
|
---|
207 | #define CMC_ERROR_UI_ALLOWED ((CMC_flags) 0x01000000)
|
---|
208 | #define CMC_LOGON_UI_ALLOWED ((CMC_flags) 0x02000000)
|
---|
209 | #define CMC_COUNTED_STRING_TYPE ((CMC_flags) 0x04000000)
|
---|
210 |
|
---|
211 | CMC_return_code WINAPI cmc_send(
|
---|
212 | CMC_session_id session,
|
---|
213 | CMC_message *message,
|
---|
214 | CMC_flags send_flags,
|
---|
215 | CMC_ui_id ui_id,
|
---|
216 | CMC_extension *send_extensions
|
---|
217 | );
|
---|
218 |
|
---|
219 | #define CMC_SEND_UI_REQUESTED ((CMC_flags) 1)
|
---|
220 |
|
---|
221 |
|
---|
222 | CMC_return_code WINAPI cmc_send_documents(
|
---|
223 | CMC_string recipient_addresses,
|
---|
224 | CMC_string subject,
|
---|
225 | CMC_string text_note,
|
---|
226 | CMC_flags send_doc_flags,
|
---|
227 | CMC_string file_paths,
|
---|
228 | CMC_string file_names,
|
---|
229 | CMC_string delimiter,
|
---|
230 | CMC_ui_id ui_id
|
---|
231 | );
|
---|
232 |
|
---|
233 | #define CMC_FIRST_ATTACH_AS_TEXT_NOTE ((CMC_flags) 2)
|
---|
234 |
|
---|
235 |
|
---|
236 | CMC_return_code WINAPI cmc_act_on(
|
---|
237 | CMC_session_id session,
|
---|
238 | CMC_message_reference *message_reference,
|
---|
239 | CMC_enum operation,
|
---|
240 | CMC_flags act_on_flags,
|
---|
241 | CMC_ui_id ui_id,
|
---|
242 | CMC_extension *act_on_extensions
|
---|
243 | );
|
---|
244 |
|
---|
245 | #define CMC_ACT_ON_EXTENDED ((CMC_enum) 0)
|
---|
246 | #define CMC_ACT_ON_DELETE ((CMC_enum) 1)
|
---|
247 |
|
---|
248 |
|
---|
249 | CMC_return_code WINAPI cmc_list(
|
---|
250 | CMC_session_id session,
|
---|
251 | CMC_string message_type,
|
---|
252 | CMC_flags list_flags,
|
---|
253 | CMC_message_reference *seed,
|
---|
254 | CMC_uint32 *count,
|
---|
255 | CMC_ui_id ui_id,
|
---|
256 | CMC_message_summary **result,
|
---|
257 | CMC_extension *list_extensions
|
---|
258 | );
|
---|
259 |
|
---|
260 | #define CMC_LIST_UNREAD_ONLY ((CMC_flags) 1)
|
---|
261 | #define CMC_LIST_MSG_REFS_ONLY ((CMC_flags) 2)
|
---|
262 | #define CMC_LIST_COUNT_ONLY ((CMC_flags) 4)
|
---|
263 |
|
---|
264 | #define CMC_LENGTH_UNKNOWN 0xFFFFFFFF
|
---|
265 |
|
---|
266 |
|
---|
267 | CMC_return_code WINAPI cmc_read(
|
---|
268 | CMC_session_id session,
|
---|
269 | CMC_message_reference *message_reference,
|
---|
270 | CMC_flags read_flags,
|
---|
271 | CMC_message **message,
|
---|
272 | CMC_ui_id ui_id,
|
---|
273 | CMC_extension *read_extensions
|
---|
274 | );
|
---|
275 |
|
---|
276 | #define CMC_DO_NOT_MARK_AS_READ ((CMC_flags) 1)
|
---|
277 | #define CMC_MSG_AND_ATT_HDRS_ONLY ((CMC_flags) 2)
|
---|
278 | #define CMC_READ_FIRST_UNREAD_MESSAGE ((CMC_flags) 4)
|
---|
279 |
|
---|
280 |
|
---|
281 | CMC_return_code WINAPI cmc_look_up(
|
---|
282 | CMC_session_id session,
|
---|
283 | CMC_recipient *recipient_in,
|
---|
284 | CMC_flags look_up_flags,
|
---|
285 | CMC_ui_id ui_id,
|
---|
286 | CMC_uint32 *count,
|
---|
287 | CMC_recipient **recipient_out,
|
---|
288 | CMC_extension *look_up_extensions
|
---|
289 | );
|
---|
290 |
|
---|
291 | #define CMC_LOOKUP_RESOLVE_PREFIX_SEARCH ((CMC_flags) 1)
|
---|
292 | #define CMC_LOOKUP_RESOLVE_IDENTITY ((CMC_flags) 2)
|
---|
293 | #define CMC_LOOKUP_RESOLVE_UI ((CMC_flags) 4)
|
---|
294 | #define CMC_LOOKUP_DETAILS_UI ((CMC_flags) 8)
|
---|
295 | #define CMC_LOOKUP_ADDRESSING_UI ((CMC_flags) 16)
|
---|
296 |
|
---|
297 |
|
---|
298 | CMC_return_code WINAPI cmc_free( CMC_buffer memory );
|
---|
299 |
|
---|
300 | CMC_return_code WINAPI cmc_logoff(
|
---|
301 | CMC_session_id session,
|
---|
302 | CMC_ui_id ui_id,
|
---|
303 | CMC_flags logoff_flags,
|
---|
304 | CMC_extension *logoff_extensions
|
---|
305 | );
|
---|
306 |
|
---|
307 | CMC_return_code WINAPI cmc_logon(
|
---|
308 | CMC_string service,
|
---|
309 | CMC_string user,
|
---|
310 | CMC_string password,
|
---|
311 | CMC_object_identifier character_set,
|
---|
312 | CMC_ui_id ui_id,
|
---|
313 | CMC_uint16 caller_cmc_version,
|
---|
314 | CMC_flags logon_flags,
|
---|
315 | CMC_session_id *session,
|
---|
316 | CMC_extension *logon_extensions
|
---|
317 | );
|
---|
318 |
|
---|
319 | #define CMC_VERSION ((CMC_uint16) 100)
|
---|
320 |
|
---|
321 | CMC_return_code WINAPI cmc_query_configuration(
|
---|
322 | CMC_session_id session,
|
---|
323 | CMC_enum item,
|
---|
324 | CMC_buffer reference,
|
---|
325 | CMC_extension *config_extensions
|
---|
326 | );
|
---|
327 |
|
---|
328 | #define CMC_CONFIG_CHARACTER_SET ((CMC_enum) 1)
|
---|
329 | #define CMC_CONFIG_LINE_TERM ((CMC_enum) 2)
|
---|
330 | #define CMC_CONFIG_DEFAULT_SERVICE ((CMC_enum) 3)
|
---|
331 | #define CMC_CONFIG_DEFAULT_USER ((CMC_enum) 4)
|
---|
332 | #define CMC_CONFIG_REQ_PASSWORD ((CMC_enum) 5)
|
---|
333 | #define CMC_CONFIG_REQ_SERVICE ((CMC_enum) 6)
|
---|
334 | #define CMC_CONFIG_REQ_USER ((CMC_enum) 7)
|
---|
335 | #define CMC_CONFIG_UI_AVAIL ((CMC_enum) 8)
|
---|
336 | #define CMC_CONFIG_SUP_NOMKMSGREAD ((CMC_enum) 9)
|
---|
337 | #define CMC_CONFIG_SUP_COUNTED_STR ((CMC_enum) 10)
|
---|
338 | #define CMC_CONFIG_VER_IMPLEM ((CMC_enum) 11)
|
---|
339 | #define CMC_CONFIG_VER_SPEC ((CMC_enum) 12)
|
---|
340 |
|
---|
341 | #define CMC_LINE_TERM_CRLF ((CMC_enum) 0)
|
---|
342 | #define CMC_LINE_TERM_CR ((CMC_enum) 1)
|
---|
343 | #define CMC_LINE_TERM_LF ((CMC_enum) 2)
|
---|
344 |
|
---|
345 | #define CMC_REQUIRED_NO ((CMC_enum) 0)
|
---|
346 | #define CMC_REQUIRED_YES ((CMC_enum) 1)
|
---|
347 | #define CMC_REQUIRED_OPT ((CMC_enum) 2)
|
---|
348 |
|
---|
349 | #define CMC_CHAR_CP437 "1 2 840 113556 3 2 437"
|
---|
350 | #define CMC_CHAR_CP850 "1 2 840 113556 3 2 85"
|
---|
351 | #define CMC_CHAR_CP1252 "1 2 840 113556 3 2 1252"
|
---|
352 | #define CMC_CHAR_ISTRING "1 2 840 113556 3 2 0"
|
---|
353 | #define CMC_CHAR_UNICODE "1 2 840 113556 3 2 1"
|
---|
354 |
|
---|
355 | #ifdef __cplusplus
|
---|
356 | }
|
---|
357 | #endif
|
---|
358 |
|
---|
359 | #endif /* #ifndef _XCMC_H */
|
---|