home *** CD-ROM | disk | FTP | other *** search
/ C Programming Starter Kit 2.0 / SamsPublishing-CProgrammingStarterKit-v2.0-Win31.iso / bc45 / msinc.pak / XCMC.H < prev    next >
C/C++ Source or Header  |  1997-07-23  |  14KB  |  390 lines

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