home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 June / PCFJune.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / xcmc.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  13.8 KB  |  384 lines

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