home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / CBuilder / Setup / BCB / data.z / xcmc.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-09  |  13.8 KB  |  392 lines

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