📄 cstypes.h
字号:
/*** Unsigned types (CS_UINT can be found in csconfig.h).*/typedef unsigned short CS_USHORT;/*** The datetime structures.*/typedef struct _cs_datetime{ CS_INT dtdays; /* number of days since 1/1/1900 */ CS_INT dttime; /* number 300th second since mid */} CS_DATETIME;typedef struct _cs_datetime4{ CS_USHORT days; /* number of days since 1/1/1900 */ CS_USHORT minutes; /* number of minutes since midnight */} CS_DATETIME4;/*** The money structures.*/typedef struct _cs_money{ CS_INT mnyhigh; CS_UINT mnylow;} CS_MONEY;typedef struct _cs_money4{ CS_INT mny4;} CS_MONEY4;/*** The numeric structures.*/typedef struct _cs_numeric{ CS_BYTE precision; CS_BYTE scale; CS_BYTE array[CS_MAX_NUMLEN];} CS_NUMERIC;typedef CS_NUMERIC CS_DECIMAL;/*** The var (pascal like) structures. Please don't confuse these datatypes** with the Sybase server "varchar" column type.*/typedef struct _cs_varychar{ CS_SMALLINT len; /* length of the string */ CS_CHAR str[CS_MAX_CHAR]; /* string, no NULL terminator */} CS_VARCHAR;typedef struct _cs_varybin{ CS_SMALLINT len; /* length of the binary array */ CS_BYTE array[CS_MAX_CHAR]; /* the array itself. */} CS_VARBINARY;/*** Datetime value information.*/typedef struct _cs_daterec{ CS_INT dateyear; /* 1900 to the future */ CS_INT datemonth; /* 0 - 11 */ CS_INT datedmonth; /* 1 - 31 */ CS_INT datedyear; /* 1 - 366 */ CS_INT datedweek; /* 0 - 6 (Mon. - Sun.) */ CS_INT datehour; /* 0 - 23 */ CS_INT dateminute; /* 0 - 59 */ CS_INT datesecond; /* 0 - 59 */ CS_INT datemsecond; /* 0 - 997 */ CS_INT datetzone; /* 0 - 127 */} CS_DATEREC;/********************************************************************************* Hidden information structures.*******************************************************************************/#ifndef CS__INTERNAL_STRUCTS/*** If passing code through lint, define the hidden structures as void.*/#ifdef lint#ifndef CS_CONTEXT#define CS_CONTEXT CS_VOID#endif /* CS_CONTEXT */#ifndef CS_LOCALE#define CS_LOCALE CS_VOID#endif /* CS_LOCALE */#ifndef CS_CONNECTION#define CS_CONNECTION CS_VOID#endif /* CS_CONNECTION */#ifndef CS_COMMAND#define CS_COMMAND CS_VOID#endif /* CS_COMMAND */ #ifndef CS_DS_OBJECT#define CS_DS_OBJECT CS_VOID#endif /* CS_DS_OBJECT */ #ifndef CS_DS_RESULT#define CS_DS_RESULT CS_VOID#endif /* CS_DS_RESULT */ #else /* lint *//*** Use anonymous structure tags to define the hidden structures.*/typedef struct _cscontext CS_CONTEXT;typedef struct _cslocale CS_LOCALE;typedef struct _csconnection CS_CONNECTION;typedef struct _cscommand CS_COMMAND;typedef struct _csdsobject CS_DS_OBJECT;typedef struct _csdsresult CS_DS_RESULT;#endif /* lint */#endif /* CS__INTERNAL_STRUCTS *//********************************************************************************* User-accessible information structures.*******************************************************************************//*** The data format structure used by Open Client/Server.**** name[CS_MAX_NAME] The name of the data.**** namelen The actual length of the name.**** datatype The datatype field indicates what Sybase** or user defined datatype is being represented.**** format The format field tells whether or not data** should be padded to the full length of the** variable. This will only be used if the type** of the variable is character or binary. The ** format field also tells whether the data** should be null-terminated (for char** variables, only). This is a bit field in which** the format values are or'd together.** ** maxlength The max length the data might be.**** scale This is used if dataytype needs it (e.g.** CS_NUMERIC)**** precision This is used if dataytype needs it.**** status Additional data status values. This is a bit** field in which the status values are or'd** together.**** count If binding data, the count field tells how** many rows should be bound.**** usertype User-defined datatype code passed back from** the Server.**** *locale Pointer to the locale for this data.*/typedef struct _cs_datafmt{ CS_CHAR name[CS_MAX_NAME]; CS_INT namelen; CS_INT datatype; CS_INT format; CS_INT maxlength; CS_INT scale; CS_INT precision; CS_INT status; CS_INT count; CS_INT usertype; CS_LOCALE *locale;} CS_DATAFMT;/*** The object name structure used by Client-Library cs_object() API. **** thinkexists indicates whether the application expects ** this object to exist. **** object_type The type of the object. This field is the ** first part of a 5-part key.**** last_name The `last name' associated with the object of ** interest, if any. This field is the second ** part of a 5-part key.**** lnlen The length, in bytes, of last_name.**** first_name The `first name' associated with the object of ** interest, if any. This field is the third part ** of a 5-part key.**** fnlen The length, in bytes, of first_name.**** scope Data that describes the scope of the object. ** This field is the fourth part of a 5-part key.**** scopelen The length, in bytes, of scope. **** thread Platform-specific data that is used to distinguish ** threads in a multi-threaded execution environment.** This field is the fifth part of a 5-part key.**** threadlen The length, in bytes, of thread. */typedef struct _cs_objname{ CS_BOOL thinkexists; CS_INT object_type; CS_CHAR last_name[CS_MAX_NAME]; CS_INT lnlen; CS_CHAR first_name[CS_MAX_NAME]; CS_INT fnlen; CS_VOID *scope; CS_INT scopelen; CS_VOID *thread; CS_INT threadlen;} CS_OBJNAME;/*** The object data structure used by Client-Library cs_object() API. **** actuallyexists Indicates whether this object actually exists. ** cs_objects sets actuallyexists to CS_TRUE ** if it finds a matching object. ** cs_objects sets actuallyexists to CS_FALSE ** if it does not find a matching object.**** connection A pointer to the CS_CONNECTION structure ** representing the connection in which the object exists.**** command A pointer to the CS_COMMAND structure representing the ** command space with which the object is associated, ** if any.**** buffer A pointer to data space. An application can ** use buffer to associate data with a saved object.**** buflen The length, in bytes, of *buffer. ** */typedef struct _cs_objdata{ CS_BOOL actuallyexists; CS_CONNECTION *connection; CS_COMMAND *command; CS_VOID *buffer; CS_INT buflen;} CS_OBJDATA;/*** Definition of a pointer to a function for all conversion routines.*/CS_START_EXTERN_Ctypedef CS_RETCODE (CS_PUBLIC * CS_CONV_FUNC)PROTOTYPE(( CS_CONTEXT *context, CS_DATAFMT *srcfmt, CS_VOID *src, CS_DATAFMT *destfmt, CS_VOID *dest, CS_INT *destlen ));/*** Pointers to the thread primitive functions used in Open Client.*/typedef CS_RETCODE (CS_PUBLIC * CS_THRDM_FUNC)PROTOTYPE(( CS_THRDRES *resource ));typedef CS_RETCODE (CS_PUBLIC * CS_THRDE_FUNC)PROTOTYPE(( CS_THRDRES *resource ));typedef CS_RETCODE (CS_PUBLIC * CS_THRDC_FUNC)PROTOTYPE(( CS_THRDRES **resource ));typedef CS_RETCODE (CS_PUBLIC * CS_THRDW_FUNC)PROTOTYPE(( CS_THRDRES *resource, CS_INT millisecs ));typedef CS_RETCODE (CS_PUBLIC * CS_THRDID_FUNC)PROTOTYPE(( CS_VOID *buffer, CS_INT buflen, CS_INT *outlen ));CS_END_EXTERN_C/*** Define the thread primitive structure. This structure is used by** application programs to pass thread primitives into Client-Library.** These primitives are used internally in Client-Library to run in a** threaded environment.**** create_mutex_fn Create a recursive mutex.**** delete_mutex_fn Delete a mutex.**** take_mutex_fn Lock a mutex.**** release_mutex_fn Release a mutex.**** create_event_fn Create an event variable.**** delete_event_fn Delete an event variable.**** signal_event_fn Signal event variable.**** reset_event_fn Reset event variable.**** waitfor_event_fn Wait for event to be signaled.**** thread_id_fn Return id of currently executing thread.*/typedef struct _cs_thread{ CS_THRDC_FUNC create_mutex_fn; CS_THRDM_FUNC delete_mutex_fn; CS_THRDM_FUNC take_mutex_fn; CS_THRDM_FUNC release_mutex_fn; CS_THRDC_FUNC create_event_fn; CS_THRDE_FUNC delete_event_fn; CS_THRDE_FUNC signal_event_fn; CS_THRDE_FUNC reset_event_fn; CS_THRDW_FUNC waitfor_event_fn; CS_THRDID_FUNC thread_id_fn;} CS_THREAD;/*** Directory Service definitions*//*** Token name for predefined OID strings.*/#define CS_OID_SYBASE "1.3.6.1.4.1.897"#define CS_OID_DIRECTORY "1.3.6.1.4.1.897.4" #define CS_OID_OBJCLASS "1.3.6.1.4.1.897.4.1" #define CS_OID_ATTRTYPE "1.3.6.1.4.1.897.4.2" #define CS_OID_ATTRSYNTAX "1.3.6.1.4.1.897.4.3" #define CS_OID_OBJSERVER "1.3.6.1.4.1.897.4.1.1"#define CS_OID_ATTRVERSION "1.3.6.1.4.1.897.4.2.1" #define CS_OID_ATTRSERVNAME "1.3.6.1.4.1.897.4.2.2" #define CS_OID_ATTRSERVICE "1.3.6.1.4.1.897.4.2.3" #define CS_OID_ATTRSTATUS "1.3.6.1.4.1.897.4.2.4" #define CS_OID_ATTRADDRESS "1.3.6.1.4.1.897.4.2.5" #define CS_OID_ATTRSECMECH "1.3.6.1.4.1.897.4.2.6" #define CS_OID_ATTRRETRYCOUNT "1.3.6.1.4.1.897.4.2.7" #define CS_OID_ATTRLOOPDELAY "1.3.6.1.4.1.897.4.2.8" /*** Current status of server object.*/#define CS_STATUS_ACTIVE (CS_INT)1#define CS_STATUS_STOPPED (CS_INT)2#define CS_STATUS_FAILED (CS_INT)3#define CS_STATUS_UNKNOWN (CS_INT)4/*** Server object access type*/#define CS_ACCESS_CLIENT (CS_INT)1#define CS_ACCESS_ADMIN (CS_INT)2#define CS_ACCESS_MGMTAGENT (CS_INT)3/*** String Attribute Value**** This structure is used to describe a string attribute** value.**** str_length Length of string.** str_buffer String data.*/typedef struct _cs_string{ CS_INT str_length; CS_CHAR str_buffer[CS_MAX_DS_STRING];} CS_STRING;/*** Transport Address attribute value**** This structure is used to describe a server address attribute** value. **** addr_accesstype Access type provided on transport** address.** addr_trantype Transport address type** addr_tranaddress The address string.*/typedef struct _cs_tranaddr{ CS_INT addr_accesstype; CS_STRING addr_trantype; CS_STRING addr_tranaddress;} CS_TRANADDR;/*** Object Identifier** ** This structure is used to represent an Object ** Identifier.**** oid_length Length of Object Identifier.** oid_buffer Buffer containing object identifier.*/typedef struct _cs_oid{ CS_INT oid_length; CS_CHAR oid_buffer[CS_MAX_DS_STRING];} CS_OID;/*** Attribute Value** ** This union is used to represent an attribute value.***/typedef union _cs_attrvalue{ CS_STRING value_string; CS_BOOL value_boolean; CS_INT value_enumeration; CS_INT value_integer; CS_OID value_oid; CS_TRANADDR value_tranaddr;} CS_ATTRVALUE;/*** Attribute ** ** This structure describes an attribute. ***/typedef struct _cs_attribute{ CS_OID attr_type; CS_INT attr_syntax; CS_INT attr_numvals;} CS_ATTRIBUTE;/*** Syntax identifier tokens for the CS_ATTRIBUTE union.*/#define CS_ATTR_SYNTAX_NOOP (CS_INT) 0#define CS_ATTR_SYNTAX_STRING (CS_INT) 1#define CS_ATTR_SYNTAX_INTEGER (CS_INT) 2#define CS_ATTR_SYNTAX_BOOLEAN (CS_INT) 3#define CS_ATTR_SYNTAX_ENUMERATION (CS_INT) 4#define CS_ATTR_SYNTAX_TRANADDR (CS_INT) 5#define CS_ATTR_SYNTAX_OID (CS_INT) 6/* ** Structure for defining directory lookup criteria when using** ct_ds_lookup api.*/typedef struct _cs_ds_lookup_info{ CS_OID *objclass; CS_CHAR *path; CS_INT pathlen; CS_DS_OBJECT *attrfilter; CS_DS_OBJECT *attrselect;} CS_DS_LOOKUP_INFO;/*** Predefined signal handlers for client and server signal handler** libraries.*/#define CS_SIGNAL_IGNORE -1#define CS_SIGNAL_DEFAULT -2#define CS_ASYNC_RESTORE -3#define CS_SIGNAL_BLOCK -4#define CS_SIGNAL_UNBLOCK -5#endif /* __CSTYPES_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -