XCMC.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  1. /*BEGIN CMC INTERFACE */
  2. #ifndef _XCMC_H
  3. #define _XCMC_H
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. /*BASIC DATA TYPES*/
  8. #ifndef DIFFERENT_PLATFORM
  9. typedef char CMC_sint8;
  10. typedef short CMC_sint16;
  11. typedef long int CMC_sint32;
  12. typedef unsigned short int CMC_uint16;
  13. typedef unsigned long int CMC_uint32;
  14. typedef void far * CMC_buffer;
  15. typedef char far * CMC_string;
  16. #endif
  17. typedef CMC_uint16 CMC_boolean;
  18. typedef CMC_sint32 CMC_enum;
  19. typedef CMC_uint32 CMC_return_code;
  20. typedef CMC_uint32 CMC_flags;
  21. typedef CMC_string CMC_object_identifier;
  22. #define CMC_FALSE ((CMC_boolean)0)
  23. #define CMC_TRUE ((CMC_boolean)1)
  24. /*DATA STRUCTURES*/
  25. /*COUNTED STRING*/
  26. typedef struct {
  27. CMC_uint32 length;
  28. char string[1];
  29. } CMC_counted_string;
  30. /*SESSION ID*/
  31. typedef CMC_uint32 CMC_session_id;
  32. /*TIME*/
  33. /* unusedX fields needed to align struct on 4-byte boundary */
  34. typedef struct {
  35. CMC_sint8 second;
  36. CMC_sint8 minute;
  37. CMC_sint8 hour;
  38. CMC_sint8 day;
  39. CMC_sint8 month;
  40. CMC_sint8 year;
  41. CMC_sint8 isdst;
  42. CMC_sint8 unused1;
  43. CMC_sint16 tmzone;
  44. CMC_sint16 unused2;
  45. } CMC_time;
  46. #define CMC_NO_TIMEZONE ((CMC_sint16) 0x8000)
  47. typedef CMC_uint32 CMC_ui_id;
  48. /*EXTENSION*/
  49. typedef struct {
  50. CMC_uint32 item_code;
  51. CMC_uint32 item_data;
  52. CMC_buffer item_reference;
  53. CMC_flags extension_flags;
  54. } CMC_extension;
  55. /* EXTENSION FLAGS */
  56. #define CMC_EXT_REQUIRED ((CMC_flags) 0x00010000)
  57. #define CMC_EXT_OUTPUT ((CMC_flags) 0x00020000)
  58. #define CMC_EXT_LAST_ELEMENT ((CMC_flags) 0x80000000)
  59. #define CMC_EXT_RSV_FLAG_MASK ((CMC_flags) 0xFFFF0000)
  60. #define CMC_EXT_ITEM_FLAG_MASK ((CMC_flags) 0x0000FFFF)
  61. /*ATTACHMENT*/
  62. typedef struct {
  63. CMC_string attach_title;
  64. CMC_object_identifier attach_type;
  65. CMC_string attach_filename;
  66. CMC_flags attach_flags;
  67. CMC_extension FAR *attach_extensions;
  68. } CMC_attachment;
  69. /* ATTACHMENT FLAGS */
  70. #define CMC_ATT_APP_OWNS_FILE ((CMC_flags) 1)
  71. #define CMC_ATT_LAST_ELEMENT ((CMC_flags) 0x80000000)
  72. #define CMC_ATT_OID_BINARY "? ? ? ? ? ?"
  73. #define CMC_ATT_OID_TEXT "? ? ? ? ? ?"
  74. /*MESSAGE REFERENCE*/
  75. typedef CMC_counted_string CMC_message_reference;
  76. /*RECIPIENT*/
  77. typedef struct {
  78. CMC_string name;
  79. CMC_enum name_type;
  80. CMC_string address;
  81. CMC_enum role;
  82. CMC_flags recip_flags;
  83. CMC_extension FAR *recip_extensions;
  84. } CMC_recipient;
  85. /* NAME TYPES */
  86. #define CMC_TYPE_UNKNOWN ((CMC_enum) 0)
  87. #define CMC_TYPE_INDIVIDUAL ((CMC_enum) 1)
  88. #define CMC_TYPE_GROUP ((CMC_enum) 2)
  89. /* ROLES */
  90. #define CMC_ROLE_TO ((CMC_enum) 0)
  91. #define CMC_ROLE_CC ((CMC_enum) 1)
  92. #define CMC_ROLE_BCC ((CMC_enum) 2)
  93. #define CMC_ROLE_ORIGINATOR ((CMC_enum) 3)
  94. #define CMC_ROLE_AUTHORIZING_USER ((CMC_enum) 4)
  95. /* RECIPIENT FLAGS */
  96. #define CMC_RECIP_IGNORE ((CMC_flags) 1)
  97. #define CMC_RECIP_LIST_TRUNCATED ((CMC_flags) 2)
  98. #define CMC_RECIP_LAST_ELEMENT ((CMC_flags) 0x80000000)
  99. /*MESSAGE*/
  100. typedef struct {
  101. CMC_message_reference FAR *message_reference;
  102. CMC_string message_type;
  103. CMC_string subject;
  104. CMC_time time_sent;
  105. CMC_string text_note;
  106. CMC_recipient FAR *recipients;
  107. CMC_attachment FAR *attachments;
  108. CMC_flags message_flags;
  109. CMC_extension FAR *message_extensions;
  110. } CMC_message;
  111. /* MESSAGE FLAGS */
  112. #define CMC_MSG_READ ((CMC_flags) 1)
  113. #define CMC_MSG_TEXT_NOTE_AS_FILE ((CMC_flags) 2)
  114. #define CMC_MSG_UNSENT ((CMC_flags) 4)
  115. #define CMC_MSG_LAST_ELEMENT ((CMC_flags) 0x80000000)
  116. /*MESSAGE SUMMARY*/
  117. typedef struct {
  118. CMC_message_reference FAR *message_reference;
  119. CMC_string message_type;
  120. CMC_string subject;
  121. CMC_time time_sent;
  122. CMC_uint32 byte_length;
  123. CMC_recipient FAR *originator;
  124. CMC_flags summary_flags;
  125. CMC_extension FAR *message_summary_extensions;
  126. } CMC_message_summary;
  127. /* MESSAGE SUMMARY FLAGS */
  128. #define CMC_SUM_READ ((CMC_flags) 1)
  129. #define CMC_SUM_UNSENT ((CMC_flags) 2)
  130. #define CMC_SUM_LAST_ELEMENT ((CMC_flags) 0x80000000)
  131. /*CMC FUNCTIONS */
  132. /*CROSS FUNCTION FLAGS */
  133. #define CMC_ERROR_UI_ALLOWED ((CMC_flags) 0x01000000)
  134. #define CMC_LOGON_UI_ALLOWED ((CMC_flags) 0x02000000)
  135. #define CMC_COUNTED_STRING_TYPE ((CMC_flags) 0x04000000)
  136. /*SEND*/
  137. CMC_return_code FAR PASCAL
  138. cmc_send(
  139. CMC_session_id session,
  140. CMC_message FAR *message,
  141. CMC_flags send_flags,
  142. CMC_ui_id ui_id,
  143. CMC_extension FAR *send_extensions
  144. );
  145. #define CMC_SEND_UI_REQUESTED ((CMC_flags) 1)
  146. /*SEND DOCUMENT*/
  147. CMC_return_code FAR PASCAL
  148. cmc_send_documents(
  149. CMC_string recipient_addresses,
  150. CMC_string subject,
  151. CMC_string text_note,
  152. CMC_flags send_doc_flags,
  153. CMC_string file_paths,
  154. CMC_string file_names,
  155. CMC_string delimiter,
  156. CMC_ui_id ui_id
  157. );
  158. #define CMC_FIRST_ATTACH_AS_TEXT_NOTE ((CMC_flags) 2)
  159. /*ACT ON*/
  160. CMC_return_code FAR PASCAL
  161. cmc_act_on(
  162. CMC_session_id session,
  163. CMC_message_reference FAR *message_reference,
  164. CMC_enum operation,
  165. CMC_flags act_on_flags,
  166. CMC_ui_id ui_id,
  167. CMC_extension FAR *act_on_extensions
  168. );
  169. #define CMC_ACT_ON_EXTENDED ((CMC_enum) 0)
  170. #define CMC_ACT_ON_DELETE ((CMC_enum) 1)
  171. /*LIST*/
  172. CMC_return_code FAR PASCAL
  173. cmc_list(
  174. CMC_session_id session,
  175. CMC_string message_type,
  176. CMC_flags list_flags,
  177. CMC_message_reference FAR *seed,
  178. CMC_uint32 FAR *count,
  179. CMC_ui_id ui_id,
  180. CMC_message_summary FAR * FAR *result,
  181. CMC_extension FAR *list_extensions
  182. );
  183. #define CMC_LIST_UNREAD_ONLY ((CMC_flags) 1)
  184. #define CMC_LIST_MSG_REFS_ONLY ((CMC_flags) 2)
  185. #define CMC_LIST_COUNT_ONLY ((CMC_flags) 4)
  186. #define CMC_LENGTH_UNKNOWN 0xFFFFFFFF
  187. /*READ*/
  188. CMC_return_code FAR PASCAL
  189. cmc_read(
  190. CMC_session_id session,
  191. CMC_message_reference FAR *message_reference,
  192. CMC_flags read_flags,
  193. CMC_message FAR * FAR *message,
  194. CMC_ui_id ui_id,
  195. CMC_extension FAR *read_extensions
  196. );
  197. #define CMC_DO_NOT_MARK_AS_READ ((CMC_flags) 1)
  198. #define CMC_MSG_AND_ATT_HDRS_ONLY ((CMC_flags) 2)
  199. #define CMC_READ_FIRST_UNREAD_MESSAGE ((CMC_flags) 4)
  200. /*LOOK UP*/
  201. CMC_return_code FAR PASCAL
  202. cmc_look_up(
  203. CMC_session_id session,
  204. CMC_recipient FAR *recipient_in,
  205. CMC_flags look_up_flags,
  206. CMC_ui_id ui_id,
  207. CMC_uint32 FAR *count,
  208. CMC_recipient FAR * FAR *recipient_out,
  209. CMC_extension FAR *look_up_extensions
  210. );
  211. #define CMC_LOOKUP_RESOLVE_PREFIX_SEARCH ((CMC_flags) 1)
  212. #define CMC_LOOKUP_RESOLVE_IDENTITY ((CMC_flags) 2)
  213. #define CMC_LOOKUP_RESOLVE_UI ((CMC_flags) 4)
  214. #define CMC_LOOKUP_DETAILS_UI ((CMC_flags) 8)
  215. #define CMC_LOOKUP_ADDRESSING_UI ((CMC_flags) 16)
  216. /*FREE*/
  217. CMC_return_code FAR PASCAL
  218. cmc_free(
  219. CMC_buffer memory
  220. );
  221. /* LOGOFF */
  222. CMC_return_code FAR PASCAL
  223. cmc_logoff(
  224. CMC_session_id session,
  225. CMC_ui_id ui_id,
  226. CMC_flags logoff_flags,
  227. CMC_extension FAR *logoff_extensions
  228. );
  229. #define CMC_LOGOFF_UI_ALLOWED ((CMC_flags) 1)
  230. /* LOGON */
  231. CMC_return_code FAR PASCAL
  232. cmc_logon(
  233. CMC_string service,
  234. CMC_string user,
  235. CMC_string password,
  236. CMC_object_identifier character_set,
  237. CMC_ui_id ui_id,
  238. CMC_uint16 caller_cmc_version,
  239. CMC_flags logon_flags,
  240. CMC_session_id FAR *session,
  241. CMC_extension FAR *logon_extensions
  242. );
  243. #define CMC_VERSION ((CMC_uint16) 100)
  244. /* QUERY CONFIGURATION */
  245. CMC_return_code FAR PASCAL
  246. cmc_query_configuration(
  247. CMC_session_id session,
  248. CMC_enum item,
  249. CMC_buffer reference,
  250. CMC_extension FAR *config_extensions
  251. );
  252. /*QUERY CONFIGURATION ENUMS */
  253. #define CMC_CONFIG_CHARACTER_SET ((CMC_enum) 1)
  254. #define CMC_CONFIG_LINE_TERM ((CMC_enum) 2)
  255. #define CMC_CONFIG_DEFAULT_SERVICE ((CMC_enum) 3)
  256. #define CMC_CONFIG_DEFAULT_USER ((CMC_enum) 4)
  257. #define CMC_CONFIG_REQ_PASSWORD ((CMC_enum) 5)
  258. #define CMC_CONFIG_REQ_SERVICE ((CMC_enum) 6)
  259. #define CMC_CONFIG_REQ_USER ((CMC_enum) 7)
  260. #define CMC_CONFIG_UI_AVAIL ((CMC_enum) 8)
  261. #define CMC_CONFIG_SUP_NOMKMSGREAD ((CMC_enum) 9)
  262. #define CMC_CONFIG_SUP_COUNTED_STR ((CMC_enum) 10)
  263. #define CMC_CONFIG_VER_IMPLEM ((CMC_enum) 11)
  264. #define CMC_CONFIG_VER_SPEC ((CMC_enum) 12)
  265. /* CONFIG LINE TERM ENUM */
  266. #define CMC_LINE_TERM_CRLF ((CMC_enum) 0)
  267. #define CMC_LINE_TERM_CR ((CMC_enum) 1)
  268. #define CMC_LINE_TERM_LF ((CMC_enum) 2)
  269. /* CONFIG REQUIRED LOGON PARAMETER ENUM */
  270. #define CMC_REQUIRED_NO ((CMC_enum) 0)
  271. #define CMC_REQUIRED_YES ((CMC_enum) 1)
  272. #define CMC_REQUIRED_OPT ((CMC_enum) 2)
  273. /* DEFINED OBJECT ID'S FOR CHARACTER SETS */
  274. #define CMC_CHAR_CP437 "1 2 840 113556 3 2 437"
  275. #define CMC_CHAR_CP850 "1 2 840 113556 3 2 850"
  276. #define CMC_CHAR_CP1252 "1 2 840 113556 3 2 1252"
  277. #define CMC_CHAR_ISTRING "1 2 840 113556 3 2 0"
  278. #define CMC_CHAR_UNICODE "1 2 840 113556 3 2 1"
  279. /* RETURN CODE FLAGS */
  280. #define CMC_ERROR_DISPLAYED ((CMC_return_code) 0x00008000)
  281. #define CMC_ERROR_RSV_MASK ((CMC_return_code) 0x0000FFFF)
  282. #define CMC_ERROR_IMPL_MASK ((CMC_return_code) 0xFFFF0000)
  283. /* RETURN CODES */
  284. #define CMC_SUCCESS ((CMC_return_code) 0)
  285. #define CMC_E_AMBIGUOUS_RECIPIENT ((CMC_return_code) 1)
  286. #define CMC_E_ATTACHMENT_NOT_FOUND ((CMC_return_code) 2)
  287. #define CMC_E_ATTACHMENT_OPEN_FAILURE ((CMC_return_code) 3)
  288. #define CMC_E_ATTACHMENT_READ_FAILURE ((CMC_return_code) 4)
  289. #define CMC_E_ATTACHMENT_WRITE_FAILURE ((CMC_return_code) 5)
  290. #define CMC_E_COUNTED_STRING_UNSUPPORTED ((CMC_return_code) 6)
  291. #define CMC_E_DISK_FULL ((CMC_return_code) 7)
  292. #define CMC_E_FAILURE ((CMC_return_code) 8)
  293. #define CMC_E_INSUFFICIENT_MEMORY ((CMC_return_code) 9)
  294. #define CMC_E_INVALID_CONFIGURATION ((CMC_return_code) 10)
  295. #define CMC_E_INVALID_ENUM ((CMC_return_code) 11)
  296. #define CMC_E_INVALID_FLAG ((CMC_return_code) 12)
  297. #define CMC_E_INVALID_MEMORY ((CMC_return_code) 13)
  298. #define CMC_E_INVALID_MESSAGE_PARAMETER ((CMC_return_code) 14)
  299. #define CMC_E_INVALID_MESSAGE_REFERENCE ((CMC_return_code) 15)
  300. #define CMC_E_INVALID_PARAMETER ((CMC_return_code) 16)
  301. #define CMC_E_INVALID_SESSION_ID ((CMC_return_code) 17)
  302. #define CMC_E_INVALID_UI_ID ((CMC_return_code) 18)
  303. #define CMC_E_LOGON_FAILURE ((CMC_return_code) 19)
  304. #define CMC_E_MESSAGE_IN_USE ((CMC_return_code) 20)
  305. #define CMC_E_NOT_SUPPORTED ((CMC_return_code) 21)
  306. #define CMC_E_PASSWORD_REQUIRED ((CMC_return_code) 22)
  307. #define CMC_E_RECIPIENT_NOT_FOUND ((CMC_return_code) 23)
  308. #define CMC_E_SERVICE_UNAVAILABLE ((CMC_return_code) 24)
  309. #define CMC_E_TEXT_TOO_LARGE ((CMC_return_code) 25)
  310. #define CMC_E_TOO_MANY_FILES ((CMC_return_code) 26)
  311. #define CMC_E_TOO_MANY_RECIPIENTS ((CMC_return_code) 27)
  312. #define CMC_E_UNABLE_TO_NOT_MARK_AS_READ ((CMC_return_code) 28)
  313. #define CMC_E_UNRECOGNIZED_MESSAGE_TYPE ((CMC_return_code) 29)
  314. #define CMC_E_UNSUPPORTED_ACTION ((CMC_return_code) 30)
  315. #define CMC_E_UNSUPPORTED_CHARACTER_SET ((CMC_return_code) 31)
  316. #define CMC_E_UNSUPPORTED_DATA_EXT ((CMC_return_code) 32)
  317. #define CMC_E_UNSUPPORTED_FLAG ((CMC_return_code) 33)
  318. #define CMC_E_UNSUPPORTED_FUNCTION_EXT ((CMC_return_code) 34)
  319. #define CMC_E_UNSUPPORTED_VERSION ((CMC_return_code) 35)
  320. #define CMC_E_USER_CANCEL ((CMC_return_code) 36)
  321. #define CMC_E_USER_NOT_LOGGED_ON ((CMC_return_code) 37)
  322. #ifdef __cplusplus
  323. } /* extern "C" */
  324. #endif
  325. #endif /* _XCMC_H */