📄 sdsyb.pas
字号:
{*
** Locale type information. CS_LC_MONETARY and CS_LC_NUMERIC are defined
** for future use.
*}
CS_LC_COLLATE = TCS_INT( 1);
CS_LC_CTYPE = TCS_INT( 2);
CS_LC_MESSAGE = TCS_INT( 3);
CS_LC_MONETARY = TCS_INT( 4);
CS_LC_NUMERIC = TCS_INT( 5);
CS_LC_TIME = TCS_INT( 6);
CS_LC_ALL = TCS_INT( 7);
CS_SYB_LANG = TCS_INT( 8);
CS_SYB_CHARSET = TCS_INT( 9);
CS_SYB_SORTORDER = TCS_INT(10);
CS_SYB_COLLATE = CS_SYB_SORTORDER;
CS_SYB_LANG_CHARSET = TCS_INT(11);
CS_SYB_TIME = TCS_INT(12);
CS_SYB_MONETARY = TCS_INT(13);
CS_SYB_NUMERIC = TCS_INT(14);
{*
** Object type information for the cs_objects() API.
*}
CS_CONNECTNAME = TCS_INT( 1);
CS_CURSORNAME = TCS_INT( 2);
CS_STATEMENTNAME = TCS_INT( 3);
CS_CURRENT_CONNECTION = TCS_INT( 4);
CS_MIN_USERDATA = TCS_INT(100);
{*
** Info type information for the ct_ds_objinfo() API.
*}
CS_DS_CLASSOID = TCS_INT(1);
CS_DS_DIST_NAME = TCS_INT(2);
CS_DS_NUMATTR = TCS_INT(3);
CS_DS_ATTRIBUTE = TCS_INT(4);
CS_DS_ATTRVALS = TCS_INT(5);
{*******************************************************************************
**
** Common datatype typedefs and structures used in client/server applications.
**
*******************************************************************************}
type
{*
** Define client/server datatypes.
**
** CS_FLOAT is defined in csconfig.h
*}
TCS_TINYINT = UCHAR; // 1 byte integer
TCS_SMALLINT = SHORT; // 2 byte integer
TCS_CHAR = Char; // char type
TCS_BINARY = UCHAR; // binary type
TCS_BIT = UCHAR; // bit type
TCS_REAL = Single; // 4 byte float type
TCS_BYTE = UCHAR; // 1 byte byte
TCS_TEXT = UCHAR; // text data
TCS_IMAGE = UCHAR; // image data
TCS_LONGCHAR = UCHAR; // long char type
TCS_LONGBINARY= UCHAR; // long binary type
TCS_LONG = LongInt; // long integer type
TCS_VOIDDATA = TCS_INT; // void data
TCS_UNICHAR = Word; // 2-byte unichar type
PCS_CHAR = TSDCharPtr;
PCS_SMALLINT = ^TCS_SMALLINT;
{
typedef struct cs_ctx_globs CS_CTX_GLOBS;
typedef struct cs_ctx_locglobs CS_CTX_LOCGLOBS;
}
{*
** The following typedefs are platform specific.
**
** CS_VOID (compiler void differences)
** CS_THRDRES (compiler void differences)
** CS_INT (need to force it to 4 bytes)
**
** Please see the csconfig.h file for the actual definitions.
*}
//** Unsigned types (CS_UINT can be found in csconfig.h).
TCS_USHORT = Word;
{*
** The datetime structures.
*}
_cs_datetime = record
dtdays: TCS_INT; // number of days since 1/1/1900
dttime: TCS_INT; // number 300th second since mid
end;
TCS_DATETIME = _cs_datetime;
PCS_DATETIME = ^TCS_DATETIME;
_cs_datetime4 = record
days: TCS_USHORT; // number of days since 1/1/1900
minutes: TCS_USHORT; // number of minutes since midnight
end;
TCS_DATETIME4 = _cs_datetime4;
PCS_DATETIME4 = ^TCS_DATETIME4;
{*
** The money structures.
*}
_cs_money = record
mnyhigh: TCS_INT;
mnylow: TCS_UINT;
end;
TCS_MONEY = _cs_money;
_cs_money4 = record
mny4: TCS_INT;
end;
TCS_MONEY4 = TCS_INT;
{*
** The numeric structures.
*}
_cs_numeric = record
precision: TCS_BYTE;
scale: TCS_BYTE;
num: array[0..CS_MAX_NUMLEN-1] of TCS_BYTE;
end;
TCS_NUMERIC = _cs_numeric;
TCS_DECIMAL = TCS_NUMERIC;
{*
** The var (pascal like) structures. Please don't confuse these datatypes
** with the Sybase server "varchar" column type.
*}
_cs_varychar = record
len: TCS_SMALLINT; // length of the string
str: array[0..CS_MAX_CHAR-1] of TCS_CHAR; // string, no NULL terminator
end;
TCS_VARCHAR = _cs_varychar;
_cs_varybin = record
len: TCS_SMALLINT; // length of the binary array
arr: array[0..CS_MAX_CHAR-1] of TCS_BYTE; // the array itself.
end;
TCS_VARBINARY = _cs_varybin;
{*
** Datetime value information.
*}
_cs_daterec = record
dateyear: TCS_INT; // 1900 to the future
datemonth: TCS_INT; // 0 - 11
datedmonth: TCS_INT; // 1 - 31
datedyear: TCS_INT; // 1 - 366
datedweek: TCS_INT; // 0 - 6 (Mon. - Sun.)
datehour: TCS_INT; // 0 - 23
dateminute: TCS_INT; // 0 - 59
datesecond: TCS_INT; // 0 - 59
datemsecond:TCS_INT; // 0 - 997
datetzone: TCS_INT; // 0 - 127
end;
TCS_DATEREC = _cs_daterec;
PCS_DATEREC = ^TCS_DATEREC;
{*******************************************************************************
**
** Hidden information structures.
**
*******************************************************************************}
type
{*
** If passing code through lint, define the hidden structures as void.
*}
TCS_CONTEXT = TCS_VOID;
TCS_LOCALE = TCS_VOID;
TCS_CONNECTION= TCS_VOID;
TCS_COMMAND = TCS_VOID;
TCS_DS_OBJECT = TCS_VOID;
TCS_DS_RESULT = TCS_VOID;
{$IFDEF SD_CLR}
PCS_CONTEXT = TCS_VOID;
PCS_LOCALE = TCS_VOID;
PCS_CONNECTION= TCS_VOID;
PCS_COMMAND = TCS_VOID;
PCS_DS_OBJECT = TCS_VOID;
PCS_DS_RESULT = TCS_VOID;
{$ELSE}
PCS_CONTEXT = ^TCS_CONTEXT;
PCS_LOCALE = ^TCS_LOCALE;
PCS_CONNECTION= ^TCS_CONNECTION;
PCS_COMMAND = ^TCS_COMMAND;
PCS_DS_OBJECT = ^TCS_DS_OBJECT;
PCS_DS_RESULT = ^TCS_DS_RESULT;
{$ENDIF}
{*
** 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;
}
{*******************************************************************************
**
** 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.
*}
{$IFDEF SD_CLR}
[StructLayout(LayoutKind.Sequential)]
TCS_DATAFMT = record
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = CS_MAX_NAME)]
name: string;
namelen: TCS_INT;
datatype: TCS_INT;
format: TCS_INT;
maxlength: TCS_INT;
scale: TCS_INT;
precision: TCS_INT;
status: TCS_INT;
count: TCS_INT;
usertype: TCS_INT;
locale: PCS_LOCALE;
end;
{$ELSE}
_cs_datafmt = record
name: array[0..CS_MAX_NAME-1] of TCS_CHAR;
namelen: TCS_INT;
datatype: TCS_INT;
format: TCS_INT;
maxlength: TCS_INT;
scale: TCS_INT;
precision: TCS_INT;
status: TCS_INT;
count: TCS_INT;
usertype: TCS_INT;
locale: PCS_LOCALE;
end;
TCS_DATAFMT = _cs_datafmt;
PCS_DATAFMT = ^TCS_DATAFMT;
{$ENDIF}
{*
** 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.
*}
_cs_objname = record
thinkexists:TCS_BOOL;
object_type:TCS_INT;
last_name: array[0..CS_MAX_NAME-1] of TCS_CHAR;
lnlen: TCS_INT;
first_name: array[0..CS_MAX_NAME-1] of TCS_CHAR;
fnlen: TCS_INT;
scope: PCS_VOID;
scopelen: TCS_INT;
thread: PCS_VOID;
threadlen: TCS_INT;
end;
TCS_OBJNAME = _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.
**
*}
_cs_objdata = record
actuallyexists: TCS_BOOL;
connection: PCS_CONNECTION;
command: PCS_COMMAND;
buffer: PCS_VOID;
buflen: TCS_INT;
end;
TCS_OBJDATA = _cs_objdata;
{*
** Definition of a pointer to a function for all conversion routines.
*}
type
TCS_CONV_FUNC = function (
context: PCS_CONTEXT;
var srcfmt: TCS_DATAFMT;
src: PCS_VOID;
var destfmt: TCS_DATAFMT;
dest: PCS_VOID;
var destlen: TCS_INT
): TCS_RETCODE; stdcall;
{*
** Pointers to the thread primitive functions used in Open Client.
*}
TCS_THRDM_FUNC= function (
var resource: TCS_THRDRES
): TCS_RETCODE; stdcall;
TCS_THRDE_FUNC= function (
var resource: TCS_THRDRES
): TCS_RETCODE; stdcall;
TCS_THRDC_FUNC= function (
var resource: PCS_THRDRES
): TCS_RETCODE; stdcall;
TCS_THRDW_FUNC= function (
var resource: TCS_THRDRES;
millisecs: TCS_INT
): TCS_RETCODE; stdcall;
TCS_THRDID_FUNC= function (
buffer: PCS_VOID;
buflen: TCS_INT;
var outlen: TCS_INT
): TCS_RETCODE; stdcall;
{*
** 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.
*}
_cs_thread = record
create_mutex_fn: TCS_THRDC_FUNC;
delete_mutex_fn: TCS_THRDM_FUNC;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -