⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cspublic.h

📁 能够连接各种数据库的API
💻 H
📖 第 1 页 / 共 3 页
字号:
*/#define CS_MIN_RES_CAP		CS_RES_NOMSG#define CS_MAX_RES_CAP		CS_DATA_NOUCHAR/*** Minimum and maximum of all capabilities defined above.*/#define CS_MIN_CAPVALUE		CS_REQ_LANG#define CS_MAX_CAPVALUE		CS_DATA_UCHAR/*** Size of area to store capabilities. The array len must be greater thanS_CAP_ARRAYLEN** additional capabilities to be added.*/#define CS_CAP_ARRAYLEN		16/*** Maximum OID length (bytes)*/#define CS_MAX_OIDLEN		255/*** Index used by access macros so that the first byte in the array will** contain the high order bit.*/#define CS_CAP_IDX(B)		((CS_CAP_ARRAYLEN - (B)/ CS_BITS_PER_BYTE) - 1)/*** Data structure defining storage for capabilities.*/typedef	struct _cs_cap_type{	CS_BYTE		mask[CS_CAP_ARRAYLEN];} CS_CAP_TYPE;/*** Access macros for CS_CAP_TYPE structure.*/#define	CS_SET_CAPMASK(M, B)	((M)->mask[CS_CAP_IDX(B)] |= \					(1 << ((B) % CS_BITS_PER_BYTE)))#define	CS_CLR_CAPMASK(M, B)	((M)->mask[CS_CAP_IDX(B)] &= \					~(1 << ((B) % CS_BITS_PER_BYTE)))#define	CS_TST_CAPMASK(M, B)	((M)->mask[CS_CAP_IDX(B)] & \					(1 << ((B) % CS_BITS_PER_BYTE)))/********************************************************************************* Defines used in Open Client/Server structures.*******************************************************************************//*** Define I/O types in the CS_IODESC structure.*/#define CS_IODATA		(CS_INT)1600/*** Define status values for the status field of the CS_SERVERMSG and** CS_CLIENTMSG structures.*/#define CS_HASEED		(CS_INT)0x1#define CS_FIRST_CHUNK		(CS_INT)0x2#define CS_LAST_CHUNK		(CS_INT)0x4/********************************************************************************* Hidden information structures.*******************************************************************************/#ifndef CS__INTERNAL_STRUCTS/*** If passing code through lint, define the hidden structures as void.*/#ifdef lint#ifndef CS_LOGINFO#define CS_LOGINFO	CS_VOID#endif /* CS_LOGINFO */#ifndef CS_BLKDESC#define CS_BLKDESC      CS_VOID#endif /* CS_BLKDESC */#ifndef CS_BLK_ROW#define CS_BLK_ROW	CS_VOID#endif /* CS_BLK_ROW */#else /* lint *//*** Use anonymous structure tags to define the hidden structures.*/typedef struct _csloginfo	CS_LOGINFO;typedef struct _cs_blkdesc	CS_BLKDESC;typedef	struct _bulkrow		CS_BLK_ROW; #endif /* lint */#endif /* CS__INTERNAL_STRUCTS *//********************************************************************************* User-accessible information structures.*******************************************************************************//*** Define the I/O descriptor structure used by Open Client/Server.**** iotype		Indicates the type of I/O to perform. For text**			and image operations, iotype always has the**			value CS_IODATA.**** datatype		The datatype of the data object. The only legal**			values for datatype are CS_TEXT_TYPE and**			CS_IMAGE_TYPE.**** *locale		A pointer to a CS_LOCALE structure containing**		 	localization information for the text or image**			value. Set locale to NULL if localization**			information is not required.**** usertype		The SQL Server user-defined datatype of the data**			object, if any.**** total_txtlen		The total length, in bytes, of the text or image**			value.**** offset		Reserved for future use.**** log_on_update	Whether the update for this text object should**			be logged or not.**** name			The name of the text or image column. name is a**			string of the form table.column.**** namelen		The actual length of name**** timestamp	 	The text timestamp of the column. A text**			timestamp marks the time of a text or image**			column's last modification.**** timestamplen		The length, in bytes, of timestamp.**** textptr		The text pointer for the column. A text pointer**			is an internal server pointer that points to the**			data for a text or image column. textptr identifies**			the target column in a send-data operation.**** textptrlen		The length, in bytes, of textptr.*/typedef struct _cs_iodesc{	CS_INT		iotype;	CS_INT		datatype; 	CS_LOCALE	*locale; 	CS_INT		usertype;	CS_INT		total_txtlen;	CS_INT		offset;	CS_BOOL		log_on_update;	CS_CHAR		name[CS_OBJ_NAME]; 	CS_INT		namelen;	CS_BYTE		timestamp[CS_TS_SIZE];	CS_INT		timestamplen;	CS_BYTE		textptr[CS_TP_SIZE];	CS_INT		textptrlen;} CS_IODESC;/*** Define the browse descriptor structure used by Open Client/Server.**** status		A bit mask of either CS_EXPRESSION and/or CS_RENAMED. **** isbrowse		CS_TRUE the column can be browse-mode updated.**** origname		The original name of the column in the database.**** orignlen		Length of origname in bytes.**** tablenum		The number of the table to which the column**			belongs. The first table in a select statement's**			from-list is table number 1, the second number 2,**			and so forth.**** tablename		The name of the table to which the column belongs.**** tabnlen		Length of tablename in bytes.***/typedef struct _cs_browsedesc{	CS_INT		status;	CS_BOOL		isbrowse;	CS_CHAR		origname[CS_MAX_NAME];	CS_INT		orignlen;	CS_INT		tablenum;	CS_CHAR		tablename[CS_OBJ_NAME];	CS_INT		tabnlen;} CS_BROWSEDESC;/*** Define the server message structure used by Open Client/Server.**** msgnumber		The server message number.**** state		The server error state.**** severity		The severity of the message.**** text			The text of the error string. If an application**			is not sequencing messages, text is guaranteed **			to be null-terminated, even if it has been**			truncated. If an application is sequencing**			messages, text is null-terminated only if it is**			the last chunk of a sequenced message.**** textlen		The length, in bytes, of text.**** svrname		The name of the server that generated the message.**** svrnlen		The length, in bytes, of svrname.**** proc			The name of the stored procedure which caused**			the message, if any.**** proclen		The length, in bytes, of proc.**** line			The line number, if any, of the line that caused**			the message. line can be a line number in a**			stored procedure or a line number in a command**			batch.**** status		A bitmask used to indicate various types of**			information, such as whether or not extended**			error data is included with the message.**** sqlstate		SQL state information.**** sqlstatelen		The length, in bytes, of sqlstate.***/typedef struct _cs_servermsg{	CS_MSGNUM	msgnumber;	CS_INT		state;	CS_INT		severity;	CS_CHAR		text[CS_MAX_MSG];	CS_INT		textlen;	CS_CHAR		svrname[CS_MAX_NAME];	CS_INT		svrnlen;	CS_CHAR		proc[CS_MAX_NAME];	CS_INT		proclen;	CS_INT		line;	CS_INT		status;	CS_BYTE		sqlstate[CS_SQLSTATE_SIZE];	CS_INT		sqlstatelen;} CS_SERVERMSG;/*** Define the client message structure used by Open Client/Server.**** severity		A symbolic value representing the severity of**			the message.**** msgnumber		The message number. For information on how to**			interpret this number in Client-Library**			applications, see the Client-Library Messages**			topics in the Open Client documentation.**** msgstring		The message string. If an application is not**			sequencing messages, msgstring is guaranteed to**			be null-terminated, even if it has been truncated.**			If an application is sequencing messages,**			msgstring is null-terminated only if it is the**			last chunk of a sequenced message.**** msgstringlen		The length, in bytes, of msgstring.**** osnumber		An error may have involved interactions the**			operating system (OS). If so, the OS error**			number would be stored here. Otherwise,**			this will be zero.**** osstring		The operating system error text (if any).**** osstringlen		The length, in bytes, of osstring.**** status		A bitmask used to indicate various types of**			information, such as whether or not this is the**			first, a middle, or the last chunk of an error**			message.**** sqlstate		SQL state information.**** sqlstatelen		The length, in bytes, of sqlstate.***/typedef struct _cs_clientmsg{	CS_INT		severity;	CS_MSGNUM	msgnumber;	CS_CHAR		msgstring[CS_MAX_MSG];	CS_INT		msgstringlen;	CS_INT		osnumber;	CS_CHAR		osstring[CS_MAX_MSG];	CS_INT		osstringlen;	CS_INT		status;	CS_BYTE		sqlstate[CS_SQLSTATE_SIZE];	CS_INT		sqlstatelen;} CS_CLIENTMSG;/********************************************************************************* Define user-accessable functions for Client/Server Library here.*******************************************************************************//*** Declare all functions.*/CS_START_EXTERN_C/* cscalc.c */extern CS_RETCODE CS_PUBLIC cs_calc PROTOTYPE((	CS_CONTEXT *context,	CS_INT op,	CS_INT datatype,	CS_VOID *var1,	CS_VOID *var2,	CS_VOID *dest	));/* cscmp.c */extern CS_RETCODE CS_PUBLIC cs_cmp PROTOTYPE((	CS_CONTEXT *context,	CS_INT datatype,	CS_VOID *var1,	CS_VOID *var2,	CS_INT *result	));/* cscnvrt.c */extern CS_RETCODE CS_PUBLIC cs_convert PROTOTYPE((	CS_CONTEXT *context,	CS_DATAFMT *srcfmt,	CS_VOID *srcdata,	CS_DATAFMT *destfmt,	CS_VOID *destdata,	CS_INT *outlen	));extern CS_RETCODE CS_PUBLIC cs_will_convert PROTOTYPE((	CS_CONTEXT *context,	CS_INT srctype,	CS_INT desttype,	CS_BOOL *result	));extern CS_RETCODE CS_PUBLIC cs_set_convert PROTOTYPE((	CS_CONTEXT *context,	CS_INT	action,	CS_INT srctype,	CS_INT desttype,	CS_CONV_FUNC *buffer	));extern CS_RETCODE CS_PUBLIC cs_setnull PROTOTYPE((	CS_CONTEXT *context,	CS_DATAFMT *datafmt,	CS_VOID *buf,	CS_INT buflen	));/* csconfig.c */extern CS_RETCODE CS_PUBLIC cs_config PROTOTYPE((	CS_CONTEXT *context,	CS_INT action,	CS_INT property,	CS_VOID *buf,	CS_INT buflen,	CS_INT *outlen	));/* csctxall.c */extern CS_RETCODE CS_PUBLIC cs_ctx_alloc PROTOTYPE((	CS_INT version,	CS_CONTEXT **outptr	));/* csctxdrp.c */extern CS_RETCODE CS_PUBLIC cs_ctx_drop PROTOTYPE((	CS_CONTEXT *context	));/* csctxglb.c */extern CS_RETCODE CS_PUBLIC cs_ctx_global PROTOTYPE((	CS_INT version,	CS_CONTEXT **outptr	));/* csobjs.c */extern CS_RETCODE CS_PUBLIC cs_objects PROTOTYPE((	CS_CONTEXT 	*context,	CS_INT		action,	CS_OBJNAME	*objname,	CS_OBJDATA	*objdata	));/* csdiag.c */extern CS_RETCODE CS_PUBLIC cs_diag PROTOTYPE((	CS_CONTEXT *context,	CS_INT operation,	CS_INT type,	CS_INT idx,	CS_VOID *buffer	));/* csdtcrak.c */extern CS_RETCODE CS_PUBLIC cs_dt_crack PROTOTYPE((	CS_CONTEXT *context,	CS_INT datetype,	CS_VOID *dateval,	CS_DATEREC *daterec	));/* csdtinfo.c */extern CS_RETCODE CS_PUBLIC cs_dt_info PROTOTYPE((	CS_CONTEXT *context,	CS_INT action,	CS_LOCALE *locale,	CS_INT type,	CS_INT item,	CS_VOID *buffer,	CS_INT buflen,	CS_INT *outlen	));/* csloc.c */extern CS_RETCODE CS_PUBLIC cs_locale PROTOTYPE((	CS_CONTEXT *context,	CS_INT action,	CS_LOCALE *locale,	CS_INT type,	CS_CHAR *buffer,	CS_INT buflen,	CS_INT *outlen	));/* cslocall.c */extern CS_RETCODE CS_PUBLIC cs_loc_alloc PROTOTYPE((	CS_CONTEXT *context,	CS_LOCALE **loc_pointer	));/* cslocdrp.c */extern CS_RETCODE CS_PUBLIC cs_loc_drop PROTOTYPE((	CS_CONTEXT *context,	CS_LOCALE *locale	));/* csstr.c */#ifdef CS__INTERNAL_STRUCTSextern CS_RETCODE CS_VARARGS cs_strbuild PROTOTYPE((	CS_CONTEXT *context,	...	));#elseextern CS_RETCODE CS_VARARGS cs_strbuild PROTOTYPE((	CS_CONTEXT *context,	CS_CHAR *buf,	CS_INT buflen,	CS_INT *outlen,	CS_CHAR *text,	CS_INT textlen,	...	));#endif /* CS__INTERNAL_STRUCTS *//* csstrcmp.c */extern CS_RETCODE CS_PUBLIC cs_strcmp PROTOTYPE((	CS_CONTEXT *context,	CS_LOCALE *locale,	CS_INT type,	CS_CHAR *str1,	CS_INT len1,	CS_CHAR *str2,	CS_INT len2,	CS_INT *result	));/* cstime.c */extern CS_RETCODE CS_PUBLIC cs_time PROTOTYPE((	CS_CONTEXT *context,	CS_LOCALE *locale,	CS_VOID	 *buf,	CS_INT	buflen,	CS_INT  *outlen,	CS_DATEREC *drec	));/* csmancnt.c */extern CS_RETCODE CS_PUBLIC cs_manage_convert PROTOTYPE((	CS_CONTEXT	*context,	CS_INT		action,	CS_INT		srctype, 	CS_CHAR		*srcname,	CS_INT		srcnamelen,	CS_INT		desttype,	CS_CHAR		*destname,	CS_INT		destnamelen,	CS_INT		*maxmultiplier,	CS_CONV_FUNC	*func	));/* csmaxmul.c */extern CS_RETCODE CS_PUBLIC cs_conv_mult PROTOTYPE((	CS_CONTEXT	*context,	CS_LOCALE       *srcloc,	CS_LOCALE       *destloc,	CS_INT          *multiplier	));	CS_END_EXTERN_C#endif /* __CSPUBLIC_H__ */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -