📄 mbapi.h
字号:
/******************************************************************************
* Product Name : HULFT-Message
* Module Name : mbapi.h (MBAPI)
* Version : 2.1.0
* Description : HULFT-Message Client API header file
*
*
* Copyright (c) 2004-2006 SAISON INFORMATION SYSTEMS CO.,LTD. All Rights Reserved.
*
******************************************************************************
* File History :
* 2.0.0 2004/04/16 Initial release.
* 2.1.0 2006/04/01 update expire unit time.
*****************************************************************************/
#ifndef _MBAPI_H_
#define _MBAPI_H_
/******************************************************************************
* Definitions
*****************************************************************************/
/**************************
* Codeset Type
**************************/
#define MBA_CS_SJIS 'S' /* Codeset:Shift_JIS */
#define MBA_CS_EUC 'E' /* Codeset:EUC */
#define MBA_CS_UNICODE 'U' /* Codeset:Unicode */
#define MBA_CS_JEF 'J' /* Codeset:JEF */
#define MBA_CS_KEIS 'K' /* Codeset:KEIS */
#define MBA_CS_IBM 'I' /* Codeset:IBM */
/**************************
* JIS code type
**************************/
#define MBA_JT_83JIS '0' /* JIStype:83JIS */
#define MBA_JT_78JIS '1' /* JIStype:78JIS */
/**************************
* EBCDIC code type
**************************/
#define MBA_ET_KANA 'A' /* EBCDIC KANA */
#define MBA_ET_SML 'B' /* EBCDIC LOWER */
#define MBA_ET_ASCII 'C' /* EBCDIC ASCII */
#define MBA_ET_IBMSML 'E' /* EBCDIC IBM LOWER */
#define MBA_ET_IBMSMLEX 'F' /* EBCDIC IBM-EX LOWER */
/**************************
* Shift conversion mode
**************************/
#define MBA_SFT_CUT 'C' /* Cut the shift code */
#define MBA_SFT_SPACE 'S' /* Change the shift code to space */
#define MBA_SFT_ADD 'A' /* Add the shift code */
#define MBA_SFT_NONE 'N' /* None shift code */
/**************************
* Space conversion mode
**************************/
#define MBA_SP_FULL 'F' /* Space mode :Full */
#define MBA_SP_HALF 'H' /* Space mode :Half */
/**************************
* Queue-Open Mode
**************************/
#define MBA_OM_NORMAL 0 /* Queue Open Mode:Normal */
#define MBA_OM_ROUTE 1 /* Queue Open Mode:Routing */
#define MBA_OM_TRANS 2 /* Queue Open Mode:Transfer */
#define MBA_OM_SYSTEM 3 /* Queue Open Mode:System */
/**************************
* Queue-Message-Type
**************************/
#define MBA_MM_NORMAL 0 /* Message Type:Normal */
#define MBA_MM_PUBLISH 1 /* Message Type:Publish */
/**************************
* Queue-Share-Mode
**************************/
#define MBA_SH_ALL 0 /* Queue-Share Mode:Share */
#define MBA_SH_NONE 1 /* Queue-Share Mode:Not-Share*/
/**************************
* Wait Mode
**************************/
#define MBA_WM_WAIT 'W' /* Wait Mode:Wait */
#define MBA_WM_NOWAIT 'N' /* Wait Mode:Not-Wait */
/**************************
* Message-Data-Type
**************************/
#define MBA_DATA_TYPE_TEXT 'T' /* Data-Type:Text */
#define MBA_DATA_TYPE_FMT 'F' /* Data-Type:Format */
#define MBA_DATA_TYPE_BIN 'B' /* Data-Type:Binary */
/**************************
* Sync Mode
**************************/
#define MBA_SM_ASYNC 'A' /* Sync-Mode:Async */
#define MBA_SM_SYNC 'S' /* Sync-Mode:Sync */
/**************************
* Transaction Mode
**************************/
#define MBA_TM_NOTRANS 'N' /* Transaction Mode:Not-Transacciton */
#define MBA_TM_TRANS 'T' /* Transaction Mode:Transaction */
/**************************
* Get-Own-Message
**************************/
#define MBA_GM_GET 'G' /* Get-Own-Message:Get */
#define MBA_GM_NOTGET 'N' /* Get-Own-Message:Not-Get */
/**************************
* Message-Group-Type
**************************/
#define MBA_GT_GRP_START 1 /* Group-Type:Group-Header */
#define MBA_GT_GRP_DATA 2 /* Group-Type:Group-Data */
#define MBA_GT_GRP_END 3 /* Group-Type:Group-Trailer */
#define MBA_GT_SUB_START 4 /* Group-Type:Sub-Group-Header */
#define MBA_GT_SUB_DATA 5 /* Group-Type:Sub-Group-Data */
#define MBA_GT_SUB_END 6 /* Group-Type:Sub-Group-Trailer */
#define MBA_GT_SEG_START 7 /* Group-Type:Segment-Header */
#define MBA_GT_SEG_DATA 8 /* Group-Type:Segment-Data */
#define MBA_GT_SEG_END 9 /* Group-Type:Segment-Trailer */
/**************************
* Recover-Message
**************************/
#define MBA_RM_RECOVER 'R' /* Recovery-Message:Recovery */
#define MBA_RM_NORECOVER 'N' /* Recovery-Message:Not-Recovery */
/**************************
* Message-Search-Mode
**************************/
#define MBA_SC_HEAD 'H' /* Search Mode:Head */
#define MBA_SC_NEXT 'N' /* Search Mode:Next */
/**************************
* Message Type
**************************/
#define MBA_MSG_TYPE_MSG 'M' /* Message-Type:Normal */
#define MBA_MSG_TYPE_PUB 'P' /* Message-Type:Publish */
/**************************
* Topic Control
**************************/
#define MBA_TM_REGIST 1 /* Topic-Control:Regist */
#define MBA_TM_CANCEL 2 /* Topic-Control:Cancel */
/**************************
* Default Timeout
**************************/
#define MBA_DEF_TIMEOUT 600 /* default timeout */
/**************************
* String Length
**************************/
#define MBA_MAP_ID_LEN 16 /* Mapping ID length */
#define MBA_FMT_ID_LEN 16 /* Format ID length */
#define MBA_DEST_ID_LEN 16 /* Destination ID length */
#define MBA_ROUTE_ID_LEN 16 /* Routing ID length */
#define MBA_TOPIC_LEN 60 /* Topic name length */
#define MBA_HOST_NAME_LEN 68 /* Host name length */
#define MBA_QUEUE_NAME_LEN 20 /* Queue name length */
#define MBA_SESSION_ID_LEN (20+1) /* Session ID length */
#define MBA_COMMENT_LEN 255 /* Comment length */
#define MBA_MSG_ID_LEN 128 /* Message ID length */
#define MBA_USER_ID_LEN 128 /* User defined ID length */
#define MBA_GROUP_ID_LEN 128 /* Group ID length */
#define MBA_SHORTMSG_LEN 255 /* Short message length */
#define MBA_ERR_ERRMSG_LEN 255 /* Error message length */
/********************************
* Default Expire Unit Time Type
********************************/
#define MBA_EXPIRE_BY_HOUR 0x00
#define MBA_EXPIRE_BY_SECOND 0x10
/******************************************************************************
* Structure Definitions
*****************************************************************************/
/**************************
* MBCON
**************************/
typedef struct {
char Server[MBA_HOST_NAME_LEN+1];
unsigned short Port;
char Myhostname[MBA_HOST_NAME_LEN+1];
char Kanjicode;
char JisYear;
char Ebcdiccode;
unsigned int SockTime;
unsigned short RetryCnt;
unsigned short RetryTime;
char ReserveChar1[128];
char ReserveChar2[128];
char ReserveChar3[128];
int ReserveInt1;
int ReserveInt2;
int ReserveInt3;
} MBCON;
/**************************
* MBQ
**************************/
typedef struct {
char Queue[MBA_QUEUE_NAME_LEN+1];
int OpenMode;
int MsgMode;
int ShareMode;
char Wait_flag;
unsigned int Timeout;
char ReserveChar1[128];
char ReserveChar2[128];
char ReserveChar3[128];
int ReserveInt1;
int ReserveInt2;
int ReserveInt3;
} MBQ;
/**************************
* MBGRP
**************************/
typedef struct {
char GroupID[MBA_GROUP_ID_LEN+1];
int GroupType;
int GroupSeqNo;
int GroupSubNo;
int SegmentNo;
} MBGRP;
/**************************
* MBMSG
**************************/
typedef struct {
char MsgID[MBA_MSG_ID_LEN+1];
char UserDefineID[MBA_USER_ID_LEN+1];
char DestID[MBA_DEST_ID_LEN+1];
char RoutingID[MBA_ROUTE_ID_LEN+1];
char Topic[MBA_TOPIC_LEN+1];
char FormatID[MBA_FMT_ID_LEN+1];
char MappingID[MBA_MAP_ID_LEN+1];
char DataType;
void *Buf;
int Size;
int MsgSize;
char ReplyTo[MBA_QUEUE_NAME_LEN+1];
unsigned int Priority;
unsigned int Expire;
char Wait_flag;
char Sync_flag;
char Transaction_flag;
char Recover_flag;
char SendHost[MBA_HOST_NAME_LEN+1];
char GetOwnMsg;
unsigned int Timeout;
MBGRP Groupinfo;
char SearchMode;
char ShortMsg[MBA_SHORTMSG_LEN+1];
char SpaceMode;
char ShiftCode;
char ReserveChar1[128];
char ReserveChar2[128];
char ReserveChar3[128];
int ReserveInt1;
int ReserveInt2;
int Version; /* internal use */
char ExpireUnitTimeType;
char _FILLER[16];
} MBMSG;
/**************************
* MBERR
**************************/
typedef struct {
int ErrCode;
int DtlCode;
int SysCode;
char ErrMsg[MBA_ERR_ERRMSG_LEN +1];
} MBERR;
/**************************
* MBPSINFO
**************************/
typedef struct {
char Topic[MBA_TOPIC_LEN+1];
int RegMode;
char ReserveChar1[128];
char ReserveChar2[128];
char ReserveChar3[128];
int ReserveInt1;
int ReserveInt2;
int ReserveInt3;
} MBPSINFO;
typedef struct QHANDLE MBQHD;
typedef struct CONHANDLE MBHD;
/******************************************************************************
* Function Prototype
*****************************************************************************/
#if defined(WIN)
#define CALLING __stdcall
#else
#define CALLING
#endif
MBHD* CALLING MBCONN( MBCON*, size_t, MBERR* );
int CALLING MBDISCON( MBHD*, MBERR* );
MBQHD* CALLING MBOPEN( MBHD*, MBQ*, size_t, MBERR* );
int CALLING MBCLOSE( MBHD*, MBQHD*, MBERR* );
int CALLING MBINFO(MBHD*, MBQHD*, MBMSG*, size_t, MBERR* );
int CALLING MBINFOSP( MBHD*, MBQHD*, MBMSG*, size_t, MBERR* );
int CALLING MBGETSP( MBHD*, MBQHD*, MBMSG*, size_t, MBERR* );
int CALLING MBGET( MBHD*, MBQHD*, MBMSG*, size_t, MBERR* );
int CALLING MBPUT( MBHD*, MBQHD*, MBMSG*, size_t, MBERR* );
int CALLING MBCOMMIT( MBHD*, MBQHD*, MBERR* );
int CALLING MBROLLBK( MBHD*, MBQHD*, MBERR* );
int CALLING MBCHKMSG( MBHD *, MBQHD *, MBMSG *, MBERR * );
int CALLING MBINQ( MBHD *, char *, unsigned int *, unsigned int *, MBERR * );
int CALLING MBGETSID( MBHD *, char *, size_t, MBERR * );
#endif
/* _MBAPI_H_ */
/* end of file */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -