home *** CD-ROM | disk | FTP | other *** search
/ Delphi 5 for Professionals / DELPHI5.iso / Runimage / Delphi50 / Source / Vcl / ibheader.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1999-08-11  |  127.5 KB  |  2,974 lines

  1. {********************************************************}
  2. {                                                        }
  3. {       Borland Delphi Visual Component Library          }
  4. {       InterBase Express core components                }
  5. {                                                        }
  6. {       Copyright (c) 1998-1999 Inprise Corporation      }
  7. {                                                        }
  8. {    InterBase Express is based in part on the product   }
  9. {    Free IB Components, written by Gregory H. Deatz for }
  10. {    Hoagland, Longo, Moran, Dunst & Doukas Company.     }
  11. {    Free IB Components is used under license.           }
  12. {                                                        }
  13. {********************************************************}
  14.  
  15. unit IBHeader;
  16.  
  17. interface
  18.  
  19. uses
  20.   IBExternals;
  21.  
  22.  
  23. const
  24.   ISC_TRUE = 1;
  25.   ISC_FALSE = 0;
  26.   DSQL_close = 1;
  27.   DSQL_drop = 2;
  28.   IBASE_DLL = 'gds32.dll'; {do not localize}
  29.  
  30. const
  31.   SQLDA_VERSION1           = 1; (* pre V6.0 SQLDA *)
  32.   SQLDA_VERSION2           = 2; (*     V6.0 SQLDA *)
  33.   SQL_DIALECT_V5           = 1; (* meaning is same as DIALECT_xsqlda *)
  34.   SQL_DIALECT_V6_TRANSITION    = 2; (* flagging anything that is delimited
  35.                                        by double quotes as an error and
  36.                                        flagging keyword DATE as an error *)
  37.   SQL_DIALECT_V6           = 3; (* supports SQL delimited identifier,
  38.                                        SQLDATE/DATE, TIME, TIMESTAMP,
  39.                                        CURRENT_DATE, CURRENT_TIME,
  40.                                        CURRENT_TIMESTAMP, and 64-bit exact
  41.                                        numeric type *)
  42.   SQL_DIALECT_CURRENT           = SQL_DIALECT_V6; (* latest IB DIALECT *)
  43.  
  44.  
  45. type
  46.   (**********************************)
  47.   (** InterBase Handle Definitions **)
  48.   (**********************************)
  49.   TISC_ATT_HANDLE               = PVoid;
  50.   PISC_ATT_HANDLE               = ^TISC_ATT_HANDLE;
  51.   TISC_BLOB_HANDLE              = PVoid;
  52.   PISC_BLOB_HANDLE              = ^TISC_BLOB_HANDLE;
  53.   TISC_DB_HANDLE                = PVoid;
  54.   PISC_DB_HANDLE                = ^TISC_DB_HANDLE;
  55.   TISC_FORM_HANDLE              = PVoid;
  56.   PISC_FORM_HANDLE              = ^TISC_FORM_HANDLE;
  57.   TISC_REQ_HANDLE               = PVoid;
  58.   PISC_REQ_HANDLE               = ^TISC_REQ_HANDLE;
  59.   TISC_STMT_HANDLE              = PVoid;
  60.   PISC_STMT_HANDLE              = ^TISC_STMT_HANDLE;
  61.   TISC_SVC_HANDLE               = PVoid;
  62.   PISC_SVC_HANDLE               = ^TISC_SVC_HANDLE;
  63.   TISC_TR_HANDLE                = PVoid;
  64.   PISC_TR_HANDLE                = ^TISC_TR_HANDLE;
  65.   TISC_WIN_HANDLE               = PVoid;
  66.   PISC_WIN_HANDLE               = ^TISC_WIN_HANDLE;
  67.   TISC_CALLBACK                 = procedure;
  68.   ISC_SVC_HANDLE               = ISC_LONG;
  69.  
  70.   (*******************************************************************)
  71.   (* Time & Date Support                                             *)
  72.   (*******************************************************************)
  73. const
  74.   TIME_SECONDS_PRECISION       = 10000;
  75.   TIME_SECONDS_PRECISION_SCALE = -4;
  76.  
  77. type
  78.   ISC_DATE = Long;
  79.   PISC_DATE = ^ISC_DATE;
  80.   ISC_TIME = ULong;
  81.   PISC_TIME = ^ISC_TIME;
  82.   TISC_TIMESTAMP = record
  83.     timestamp_date: ISC_DATE;
  84.     timestamp_time: ISC_TIME;
  85.   end;
  86.   PISC_TIMESTAMP = ^TISC_TIMESTAMP;
  87.  
  88.   (*********************************************************************)
  89.   (** Blob id structure                                               **)
  90.   (*********************************************************************)
  91.   TGDS_QUAD = record
  92.     gds_quad_high      : ISC_LONG;
  93.     gds_quad_low       : UISC_LONG;
  94.   end;
  95.   TGDS__QUAD           = TGDS_QUAD;
  96.   TISC_QUAD            = TGDS_QUAD;
  97.   PGDS_QUAD            = ^TGDS_QUAD;
  98.   PGDS__QUAD           = ^TGDS__QUAD;
  99.   PISC_QUAD            = ^TISC_QUAD;
  100.  
  101.   TISC_ARRAY_BOUND = record
  102.     array_bound_lower  : short;
  103.     array_bound_upper  : short;
  104.   end;
  105.   PISC_ARRAY_BOUND     = ^TISC_ARRAY_BOUND;
  106.   TISC_ARRAY_DESC = record
  107.     array_desc_dtype            : UChar;
  108.     array_desc_scale            : Char;
  109.     array_desc_length           : UShort;
  110.     array_desc_field_name       : array[0..31] of Char;
  111.     array_desc_relation_name    : array[0..31] of Char;
  112.     array_desc_dimensions       : Short;
  113.     array_desc_flags            : Short;
  114.     array_desc_bounds           : array[0..15] of TISC_ARRAY_BOUND;
  115.   end; // TISC_ARRAY_DESC
  116.   PISC_ARRAY_DESC = ^TISC_ARRAY_DESC;
  117.  
  118.   TISC_BLOB_DESC = record
  119.     blob_desc_subtype           : Short;
  120.     blob_desc_charset           : Short;
  121.     blob_desc_segment_size      : Short;
  122.     blob_desc_field_name        : array[0..31] of UChar;
  123.     blob_desc_relation_name     : array[0..31] of UChar;
  124.   end; // TISC_BLOB_DESC
  125.   PISC_BLOB_DESC = ^TISC_BLOB_DESC;
  126.  
  127.   (*****************************)
  128.   (** Blob control structure  **)
  129.   (*****************************)
  130.   TISC_BLOB_CTL_SOURCE_FUNCTION = function: ISC_STATUS; // ISC_FAR
  131.   PISC_BLOB_CTL                 = ^TISC_BLOB_CTL;        // ISC_FAR
  132.   TISC_BLOB_CTL = record
  133.     (** Source filter **)
  134.     ctl_source                  : TISC_BLOB_CTL_SOURCE_FUNCTION;
  135.     (** Argument to pass to source filter **)
  136.     ctl_source_handle           : PISC_BLOB_CTL;
  137.     ctl_to_sub_type             : Short;      (** Target type **)
  138.     ctl_from_sub_type           : Short;    (** Source type **)
  139.     ctl_buffer_length           : UShort;    (** Length of buffer **)
  140.     ctl_segment_length          : UShort;      (** Length of current segment **)
  141.     ctl_bpb_length              : UShort;    (** Length of blob parameter **)
  142.                             (** block **)
  143.     ctl_bpb                     : PChar;    (** Address of blob parameter **)
  144.                         (** block **)
  145.     ctl_buffer                  : PUChar;    (** Address of segment buffer **)
  146.     ctl_max_segment             : ISC_LONG;    (** Length of longest segment **)
  147.     ctl_number_segments     : ISC_LONG;     (** Total number of segments **)
  148.     ctl_total_length            : ISC_LONG;      (** Total length of blob **)
  149.     ctl_status                  : PISC_STATUS;    (** Address of status vector **)
  150.     ctl_data                    : array[0..7] of long; (** Application specific data **)
  151.   end;
  152.   (*****************************)
  153.   (** Blob stream definitions **)
  154.   (*****************************)
  155.   TBSTREAM = record
  156.     bstr_blob                   : PVoid;      (** Blob handle **)
  157.     bstr_buffer                 : PChar;    (** Address of buffer **)
  158.     bstr_ptr                    : PChar;    (** Next character **)
  159.     bstr_length                 : Short;    (** Length of buffer **)
  160.     bstr_cnt                    : Short;    (** Characters in buffer **)
  161.     bstr_mode                   : Char;      (** (mode) ? OUTPUT : INPUT **)
  162.   end;
  163.   PBSTREAM                      = ^TBSTREAM;
  164.  
  165.   (*****************************)
  166.   (** Dynamic SQL definitions **)
  167.   (*****************************)
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.   (********************************)
  190.   (** Declare the extended SQLDA **)
  191.   (********************************)
  192.   TXSQLVAR = record
  193.     sqltype                     : Short;     (** datatype of field **)
  194.     sqlscale                    : Short;     (** scale factor **)
  195.     sqlsubtype                  : Short;     (** datatype subtype - BLOBs **)
  196.                          (** & text types only **)
  197.     sqllen                      : Short;     (** length of data area **)
  198.     sqldata                     : PChar;     (** address of data **)
  199.     sqlind                      : PShort;    (** address of indicator **)
  200.                                              (** variable **)
  201.     sqlname_length              : Short;     (** length of sqlname field **)
  202.     (** name of field, name length + space for NULL **)
  203.     sqlname                     : array[0..31] of Char;
  204.     relname_length              : Short;     (** length of relation name **)
  205.     (** field's relation name + space for NULL **)
  206.     relname                     : array[0..31] of Char;
  207.     ownname_length              : Short;     (** length of owner name **)
  208.     (** relation's owner name + space for NULL **)
  209.     ownname                     : array[0..31] of Char;
  210.     aliasname_length            : Short;     (** length of alias name **)
  211.     (** relation's alias name + space for NULL **)
  212.     aliasname                   : array[0..31] of Char;
  213.   end;  // TXSQLVAR
  214.   PXSQLVAR                      = ^TXSQLVAR;
  215.  
  216.   TXSQLDA = record
  217.     version                     : Short;     (** version of this XSQLDA **)
  218.     (** XSQLDA name field **)
  219.     sqldaid                     : array[0..7] of Char;
  220.     sqldabc                     : ISC_LONG;  (** length in bytes of SQLDA **)
  221.     sqln                        : Short;     (** number of fields allocated **)
  222.     sqld                        : Short;     (** actual number of fields **)
  223.     (** first field address **)
  224.     sqlvar                      : array[0..0] of TXSQLVAR;
  225.   end; // TXSQLDA
  226.   PXSQLDA                       = ^TXSQLDA;
  227.  
  228. (********************************************************)
  229. (** This record type is for passing arguments to       **)
  230. (** isc_start_transaction (See docs)                   **)
  231. (********************************************************)
  232.   TISC_START_TRANS = record
  233.     db_handle      : PISC_DB_HANDLE;
  234.     tpb_length     : UShort;
  235.     tpb_address    : PChar;
  236.   end;
  237.  
  238. (********************************************************)
  239. (** This record type is for passing arguments to       **)
  240. (** isc_start_multiple (see docs)                      **)
  241. (********************************************************)
  242.   TISC_TEB = record
  243.     db_handle      : PISC_DB_HANDLE;
  244.     tpb_length     : Long;
  245.     tpb_address    : PChar;
  246.   end;
  247.   PISC_TEB = ^TISC_TEB;
  248.   TISC_TEB_ARRAY = array[0..0] of TISC_TEB;
  249.   PISC_TEB_ARRAY = ^TISC_TEB_ARRAY;
  250.  
  251. (*****************************)
  252. (** OSRI database functions **)
  253. (*****************************)
  254.  
  255. Tisc_attach_database = function (status_vector            : PISC_STATUS;
  256.                                  db_name_length           : Short;
  257.                                  db_name                  : PChar;
  258.                                  db_handle                : PISC_DB_HANDLE;
  259.                      parm_buffer_length      : Short;
  260.                                  parm_buffer              : PChar): ISC_STATUS;
  261.                                 stdcall;
  262.  
  263. Tisc_array_gen_sdl = function   (status_vector            : PISC_STATUS;
  264.                                  isc_array_desc           : PISC_ARRAY_DESC;
  265.                                  isc_arg3                 : PShort;
  266.                                  isc_arg4                 : PChar;
  267.                                  isc_arg5                 : PShort): ISC_STATUS;
  268.                                 stdcall;
  269.  
  270. Tisc_array_get_slice = function (status_vector            : PISC_STATUS;
  271.                                  db_handle                : PISC_DB_HANDLE;
  272.                                  trans_handle             : PISC_TR_HANDLE;
  273.                  array_id                 : PISC_QUAD;
  274.                  descriptor               : PISC_ARRAY_DESC;
  275.                  dest_array               : PVoid;
  276.                  slice_length             : ISC_LONG): ISC_STATUS;
  277.                                 stdcall;
  278.  
  279. Tisc_array_lookup_bounds = function (status_vector        : PISC_STATUS;
  280.                                  db_handle                : PISC_DB_HANDLE;
  281.                                  trans_handle             : PISC_TR_HANDLE;
  282.                  table_name,
  283.                  column_name              : PChar;
  284.                  descriptor               : PISC_ARRAY_DESC): ISC_STATUS;
  285.                                 stdcall;
  286.  
  287. Tisc_array_lookup_desc = function (status_vector          : PISC_STATUS;
  288.                                  db_handle                : PISC_DB_HANDLE;
  289.                                  trans_handle             : PISC_TR_HANDLE;
  290.                  table_name,
  291.                  column_name              : PChar;
  292.                  descriptor               : PISC_ARRAY_DESC): ISC_STATUS;
  293.                                 stdcall;
  294.  
  295. Tisc_array_set_desc = function  (status_vector            : PISC_STATUS;
  296.                  table_name               : PChar;
  297.                  column_name              : PChar;
  298.                  sql_dtype,
  299.                                  sql_length,
  300.                                  sql_dimensions           : PShort;
  301.                                  descriptor               : PISC_ARRAY_DESC): ISC_STATUS;
  302.                                 stdcall;
  303.  
  304. Tisc_array_put_slice = function (status_vector            : PISC_STATUS;
  305.                                  db_handle                : PISC_DB_HANDLE;
  306.                                  trans_handle             : PISC_TR_HANDLE;
  307.                                  array_id                 : PISC_QUAD;
  308.                                  descriptor               : PISC_ARRAY_DESC;
  309.                                  source_array             : PVoid;
  310.                                  slice_length             : PISC_LONG): ISC_STATUS;
  311.                                 stdcall;
  312.  
  313. Tisc_blob_default_desc = procedure  (descriptor           : PISC_BLOB_DESC;
  314.                                  table_name               : PUChar;
  315.                                  column_name              : PUChar);
  316.                                 stdcall;
  317.  
  318. Tisc_blob_gen_bpb = function    (status_vector            : PISC_STATUS;
  319.                  to_descriptor,
  320.                                  from_descriptor          : PISC_BLOB_DESC;
  321.                                  bpb_buffer_length        : UShort;
  322.                                  bpb_buffer               : PUChar;
  323.                                  bpb_length               : PUShort): ISC_STATUS;
  324.                                 stdcall;
  325.  
  326. Tisc_blob_info = function       (status_vector            : PISC_STATUS;
  327.                  blob_handle              : PISC_BLOB_HANDLE;
  328.                  item_list_buffer_length  : Short;
  329.                   item_list_buffer         : PChar;
  330.                  result_buffer_length     : Short;
  331.                  result_buffer            : PChar): ISC_STATUS;
  332.                                 stdcall;
  333.  
  334. Tisc_blob_lookup_desc = function (status_vector           : PISC_STATUS;
  335.                                  db_handle                : PISC_DB_HANDLE;
  336.                                  trans_handle             : PISC_TR_HANDLE;
  337.                                  table_name,
  338.                                  column_name              : PChar;
  339.                                  descriptor               : PISC_BLOB_DESC;
  340.                                  global                   : PUChar): ISC_STATUS;
  341.                                 stdcall;
  342.  
  343. Tisc_blob_set_desc = function   (status_vector            : PISC_STATUS;
  344.                                  table_name,
  345.                                  column_name              : PChar;
  346.                                  subtype,
  347.                                  charset,
  348.                                  segment_size             : Short;
  349.                                  descriptor               : PISC_BLOB_DESC): ISC_STATUS;
  350.                                 stdcall;
  351.  
  352. Tisc_cancel_blob = function     (status_vector            : PISC_STATUS;
  353.                  blob_handle              : PISC_BLOB_HANDLE): ISC_STATUS;
  354.                                 stdcall;
  355.  
  356. Tisc_cancel_events = function   (status_vector            : PISC_STATUS;
  357.                                  db_handle                : PISC_DB_HANDLE;
  358.                  event_id                 : PISC_LONG): ISC_STATUS;
  359.                                 stdcall;
  360.  
  361. Tisc_close_blob = function      (status_vector            : PISC_STATUS;
  362.                                  blob_handle              : PISC_BLOB_HANDLE): ISC_STATUS;
  363.                                 stdcall;
  364.  
  365. Tisc_commit_retaining = function (status_vector           : PISC_STATUS;
  366.                  tran_handle              : PISC_TR_HANDLE): ISC_STATUS;
  367.                                 stdcall;
  368.  
  369. Tisc_commit_transaction = function  (status_vector        : PISC_STATUS;
  370.                  tran_handle              : PISC_TR_HANDLE): ISC_STATUS;
  371.                                 stdcall;
  372.  
  373. Tisc_create_blob = function     (status_vector            : PISC_STATUS;
  374.                  db_handle                : PISC_DB_HANDLE;
  375.                  tran_handle              : PISC_TR_HANDLE;
  376.                                  blob_handle              : PISC_BLOB_HANDLE;
  377.                  blob_id                  : PISC_QUAD): ISC_STATUS;
  378.                                 stdcall;
  379.  
  380. Tisc_create_blob2 = function    (status_vector            : PISC_STATUS;
  381.                  db_handle                : PISC_DB_HANDLE;
  382.                  tran_handle              : PISC_TR_HANDLE;
  383.                                  blob_handle              : PISC_BLOB_HANDLE;
  384.                                  blob_id                  : PISC_QUAD;
  385.                  bpb_length               : Short;
  386.                  bpb_address              : PChar): ISC_STATUS;
  387.                                 stdcall;
  388.  
  389. Tisc_create_database = function (status_vector            : PISC_STATUS;
  390.                  isc_arg2                 : Short;
  391.                  isc_arg3                 : PChar;
  392.                  db_handle                : PISC_DB_HANDLE;
  393.                  isc_arg5              : Short;
  394.                  isc_arg6                 : PChar;
  395.                  isc_arg7                 : Short): ISC_STATUS;
  396.                                 stdcall;
  397.  
  398. Tisc_database_info = function   (status_vector            : PISC_STATUS;
  399.                  db_handle                : PISC_DB_HANDLE;
  400.                                  item_list_buffer_length  : Short;
  401.                  item_list_buffer         : PChar;
  402.                                  result_buffer_length     : Short;
  403.                                  result_buffer            : PChar): ISC_STATUS;
  404.                                 stdcall;
  405.  
  406. Tisc_decode_date = procedure    (ib_date: PISC_QUAD;
  407.                                  tm_date: PCTimeStructure);
  408.                                 stdcall;
  409.  
  410. Tisc_decode_sql_date = procedure (ib_date: PISC_DATE;
  411.                                  tm_date: PCTimeStructure);
  412.                                 stdcall;
  413.  
  414. Tisc_decode_sql_time = procedure  (ib_time: PISC_TIME;
  415.                                  tm_date: PCTimeStructure);
  416.                                 stdcall;
  417.  
  418. Tisc_decode_timestamp = procedure  (ib_timestamp: PISC_TIMESTAMP;
  419.                                  tm_date: PCTimeStructure);
  420.                                 stdcall;
  421.  
  422. Tisc_detach_database = function (status_vector            : PISC_STATUS;
  423.                                  db_handle                : PISC_DB_HANDLE): ISC_STATUS;
  424.                                 stdcall;
  425.  
  426. Tisc_drop_database = function   (status_vector            : PISC_STATUS;
  427.                                  db_handle                : PISC_DB_HANDLE): ISC_STATUS;
  428.                                 stdcall;
  429.  
  430. Tisc_dsql_allocate_statement = function (status_vector    : PISC_STATUS;
  431.                                  db_handle                : PISC_DB_HANDLE;
  432.                  stmt_handle              : PISC_STMT_HANDLE): ISC_STATUS;
  433.                                 stdcall;
  434.  
  435. Tisc_dsql_alloc_statement2 = function (status_vector      : PISC_STATUS;
  436.                                  db_handle                : PISC_DB_HANDLE;
  437.                  stmt_handle              : PISC_STMT_HANDLE): ISC_STATUS;
  438.                                 stdcall;
  439.  
  440. Tisc_dsql_describe = function   (status_vector            : PISC_STATUS;
  441.                  stmt_handle              : PISC_STMT_HANDLE;
  442.                                  dialect                  : UShort;
  443.                                  xsqlda                   : PXSQLDA): ISC_STATUS;
  444.                                 stdcall;
  445.  
  446. Tisc_dsql_describe_bind = function  (status_vector        : PISC_STATUS;
  447.                  stmt_handle              : PISC_STMT_HANDLE;
  448.                                  dialect                  : UShort;
  449.                                  xsqlda                   : PXSQLDA): ISC_STATUS;
  450.                                 stdcall;
  451.  
  452. Tisc_dsql_exec_immed2 = function (status_vector           : PISC_STATUS;
  453.                  db_handle                : PISC_DB_HANDLE;
  454.                  tran_handle              : PISC_TR_HANDLE;
  455.                  length                   : UShort;
  456.                  statement                : PChar;
  457.                  dialect                  : UShort;
  458.                                  in_xsqlda,
  459.                  out_xsqlda               : PXSQLDA): ISC_STATUS;
  460.                                 stdcall;
  461.  
  462. Tisc_dsql_execute = function    (status_vector            : PISC_STATUS;
  463.                  tran_handle              : PISC_TR_HANDLE;
  464.                                  stmt_handle              : PISC_STMT_HANDLE;
  465.                                  dialect                  : UShort;
  466.                                  xsqlda                   : PXSQLDA): ISC_STATUS;
  467.                                 stdcall;
  468.  
  469. Tisc_dsql_execute2 = function   (status_vector            : PISC_STATUS;
  470.                  tran_handle              : PISC_TR_HANDLE;
  471.                                  stmt_handle              : PISC_STMT_HANDLE;
  472.                                  dialect                  : UShort;
  473.                                  in_xsqlda,
  474.                                  out_xsqlda               : PXSQLDA): ISC_STATUS;
  475.                                 stdcall;
  476.  
  477. Tisc_dsql_execute_immediate = function (status_vector     : PISC_STATUS;
  478.                  db_handle                : PISC_DB_HANDLE;
  479.                  tran_handle              : PISC_TR_HANDLE;
  480.                  length                   : UShort;
  481.                  statement                : PChar;
  482.                  dialect                  : UShort;
  483.                                  xsqlda                   : PXSQLDA): ISC_STATUS;
  484.                                 stdcall;
  485.  
  486. Tisc_dsql_fetch = function      (status_vector            : PISC_STATUS;
  487.                                  stmt_handle              : PISC_STMT_HANDLE;
  488.                  dialect                  : UShort;
  489.                  xsqlda                   : PXSQLDA): ISC_STATUS;
  490.                                 stdcall;
  491.  
  492. (*$ifdef SCROLLABLE_CURSORS*)
  493. Tisc_dsql_fetch2 = function     (status_vector            : PISC_STATUS;
  494.                                  stmt_handle              : PISC_STMT_HANDLE;
  495.                  dialect                  : UShort;
  496.                  xsqlda                   : PXSQLDA;
  497.                  isc_arg5                 : UShort;
  498.                  isc_arg6                 : Long): ISC_STATUS;
  499.                                 stdcall;
  500. (*$endif*)
  501.  
  502. Tisc_dsql_finish = function    (db_handle                : PISC_DB_HANDLE): ISC_STATUS;
  503.                                 stdcall;
  504.  
  505. Tisc_dsql_free_statement = function (status_vector        : PISC_STATUS;
  506.                                  stmt_handle              : PISC_STMT_HANDLE;
  507.                  options                  : UShort): ISC_STATUS;
  508.                                 stdcall;
  509.  
  510. Tisc_dsql_insert = function     (status_vector            : PISC_STATUS;
  511.                                  stmt_handle              : PISC_STMT_HANDLE;
  512.                  arg3                     : UShort;
  513.                  xsqlda                   : PXSQLDA): ISC_STATUS;
  514.                                 stdcall;
  515.  
  516. Tisc_dsql_prepare = function    (status_vector            : PISC_STATUS;
  517.                                  tran_handle              : PISC_TR_HANDLE;
  518.                                  stmt_handle              : PISC_STMT_HANDLE;
  519.                                  length                   : UShort;
  520.                                  statement                : PChar;
  521.                                  dialect                  : UShort;
  522.                                  xsqlda                   : PXSQLDA): ISC_STATUS;
  523.                                 stdcall;
  524.  
  525. Tisc_dsql_set_cursor_name = function (status_vector        : PISC_STATUS;
  526.                  stmt_handle               : PISC_STMT_HANDLE;
  527.                                  cursor_name               : PChar;
  528.                                  _type                     : UShort): ISC_STATUS;
  529.                                 stdcall;
  530.  
  531. Tisc_dsql_sql_info = function   (status_vector             : PISC_STATUS;
  532.                                  stmt_handle               : PISC_STMT_HANDLE;
  533.                  item_length               : Short;
  534.                                  items                     : PChar;
  535.                                  buffer_length             : Short;
  536.                                  buffer                    : PChar): ISC_STATUS;
  537.                                 stdcall;
  538.  
  539. Tisc_encode_date = procedure    (tm_date                    : PCTimeStructure;
  540.                  ib_date                    : PISC_QUAD);
  541.                                 stdcall;
  542.  
  543. Tisc_encode_sql_date = procedure (tm_date                   : PCTimeStructure;
  544.                  ib_date                    : PISC_DATE);
  545.                                 stdcall;
  546.  
  547. Tisc_encode_sql_time = procedure (tm_date                   : PCTimeStructure;
  548.                  ib_time                    : PISC_TIME);
  549.                                 stdcall;
  550.  
  551. Tisc_encode_timestamp = procedure (tm_date                  : PCTimeStructure;
  552.                  ib_timestamp               : PISC_TIMESTAMP);
  553.                                 stdcall;
  554.  
  555. Tisc_event_block = function     (event_buffer               : PPChar;
  556.                  result_buffer              : PPChar;
  557.                  id_count                   : UShort;
  558.                                  event_list                 : array of PChar): ISC_LONG;
  559.                                 cdecl;
  560.  
  561. Tisc_event_counts = procedure   (status_vector             : PISC_STATUS;
  562.                  buffer_length             : Short;
  563.                  event_buffer              : PChar;
  564.                  result_buffer             : PChar);
  565.                                 stdcall;
  566.  
  567. Tisc_expand_dpb = procedure     (dpb                       : PPChar;
  568.                  dpb_length                : PShort;
  569.                  item_list                 : array of Pointer);
  570.                                 cdecl;
  571.  
  572. Tisc_modify_dpb = function      (dpb                       : PPChar;
  573.                  isc_arg2,
  574.                                  isc_arg3                  : PShort;
  575.                                  isc_arg4                  : UShort;
  576.                  isc_arg5                  : PChar;
  577.                                  isc_arg6                  : Short): Int;
  578.                                 stdcall;
  579.  
  580. Tisc_free = function           (isc_arg1                  : PChar): ISC_LONG;
  581.                                 stdcall;
  582.  
  583. Tisc_get_segment = function     (status_vector             : PISC_STATUS;
  584.                  blob_handle               : PISC_BLOB_HANDLE;
  585.                                  actual_seg_length         : PUShort;
  586.                                  seg_buffer_length         : UShort;
  587.                  seg_buffer                : PChar): ISC_STATUS;
  588.                                 stdcall;
  589.  
  590. Tisc_get_slice = function       (status_vector             : PISC_STATUS;
  591.                                  db_handle                 : PISC_DB_HANDLE;
  592.                                  tran_handle               : PISC_TR_HANDLE;
  593.                                  isc_arg4                  : PISC_QUAD;
  594.                                  isc_arg5                  : Short;
  595.                  isc_arg6                  : PChar;
  596.                  isc_arg7                  : Short;
  597.                  isc_arg8                  : PISC_LONG;
  598.                  isc_arg9                  : ISC_LONG;
  599.                  isc_arg10                 : PVoid;
  600.                  isc_arg11                 : PISC_LONG): ISC_STATUS;
  601.                                 stdcall;
  602.  
  603. Tisc_interprete = function      (buffer                    : PChar;
  604.                  status_vector             : PPISC_STATUS): ISC_STATUS;
  605.                                 stdcall;
  606.  
  607. Tisc_open_blob = function       (status_vector             : PISC_STATUS;
  608.                                  db_handle                 : PISC_DB_HANDLE;
  609.                                  tran_handle               : PISC_TR_HANDLE;
  610.                  blob_handle               : PISC_BLOB_HANDLE;
  611.                  blob_id                   : PISC_QUAD): ISC_STATUS;
  612.                                 stdcall;
  613.  
  614. Tisc_open_blob2 = function      (status_vector             : PISC_STATUS;
  615.                                  db_handle                 : PISC_DB_HANDLE;
  616.                                  tran_handle               : PISC_TR_HANDLE;
  617.                  blob_handle               : PISC_BLOB_HANDLE;
  618.                  blob_id                   : PISC_QUAD;
  619.                  bpb_length                : Short;
  620.                  bpb_buffer                : PChar): ISC_STATUS;
  621.                                 stdcall;
  622.  
  623. Tisc_prepare_transaction2 = function (status_vector        : PISC_STATUS;
  624.                                  tran_handle               : PISC_TR_HANDLE;
  625.                                  msg_length                : Short;
  626.                  msg                       : PChar): ISC_STATUS;
  627.                                 stdcall;
  628.  
  629. Tisc_print_sqlerror = procedure (sqlcode                   : Short;
  630.                  status_vector             : PISC_STATUS);
  631.                                 stdcall;
  632.  
  633. Tisc_print_status = function   (status_vector              : PISC_STATUS): ISC_STATUS;
  634.                                 stdcall;
  635.  
  636. Tisc_put_segment = function     (status_vector             : PISC_STATUS;
  637.                  blob_handle               : PISC_BLOB_HANDLE;
  638.                  seg_buffer_len            : UShort;
  639.                  seg_buffer                : PChar): ISC_STATUS;
  640.                                 stdcall;
  641.  
  642. Tisc_put_slice = function       (status_vector             : PISC_STATUS;
  643.                                  db_handle                 : PISC_DB_HANDLE;
  644.                                  tran_handle               : PISC_TR_HANDLE;
  645.                  isc_arg4                  : PISC_QUAD;
  646.                  isc_arg5                  : Short;
  647.                  isc_arg6                  : PChar;
  648.                  isc_arg7                  : Short;
  649.                  isc_arg8                  : PISC_LONG;
  650.                  isc_arg9                  : ISC_LONG;
  651.                  isc_arg10                 : PVoid): ISC_STATUS;
  652.                                 stdcall;
  653.  
  654. Tisc_que_events = function      (status_vector             : PISC_STATUS;
  655.                                  db_handle                 : PISC_DB_HANDLE;
  656.                  event_id                  : PISC_LONG;
  657.                  length                    : Short;
  658.                  event_buffer              : PChar;
  659.                                  event_function            : TISC_CALLBACK;
  660.                  event_function_arg        : PVoid): ISC_STATUS;
  661.                                 stdcall;
  662.  
  663. Tisc_rollback_retaining = function (status_vector         : PISC_STATUS;
  664.                  tran_handle              : PISC_TR_HANDLE): ISC_STATUS;
  665.                                 stdcall;
  666.  
  667. Tisc_rollback_transaction = function (status_vector        : PISC_STATUS;
  668.                                  tran_handle               : PISC_TR_HANDLE): ISC_STATUS;
  669.                                 stdcall;
  670.  
  671. Tisc_start_multiple = function  (status_vector             : PISC_STATUS;
  672.                                  tran_handle               : PISC_TR_HANDLE;
  673.                                  db_handle_count           : Short;
  674.                  teb_vector_address        : PISC_TEB): ISC_STATUS;
  675.                                 stdcall;
  676.  
  677. Tisc_start_transaction = function (status_vector           : PISC_STATUS;
  678.                                  tran_handle               : PISC_TR_HANDLE;
  679.                                  db_handle_count           : Short;
  680.                                  db_handle                 : PISC_DB_HANDLE;
  681.                                  tpb_length                : UShort;
  682.                                  tpb_address               : PChar): ISC_STATUS;
  683.                                 cdecl;
  684.  
  685. Tisc_sqlcode = function        (status_vector             : PISC_STATUS): ISC_LONG;
  686.                                 stdcall;
  687.  
  688.  
  689. Tisc_sql_interprete = procedure (sqlcode                   : Short;
  690.                  buffer                    : PChar;
  691.                                  buffer_length             : Short);
  692.                                 stdcall;
  693.  
  694. Tisc_transaction_info = function (status_vector            : PISC_STATUS;
  695.                                  tran_handle               : PISC_TR_HANDLE;
  696.                                  item_list_buffer_length   : Short;
  697.                                  item_list_buffer          : PChar;
  698.                                  result_buffer_length      : Short;
  699.                                  result_buffer             : PChar): ISC_STATUS;
  700.                                 stdcall;
  701.  
  702. Tisc_transact_request = function (status_vector            : PISC_STATUS;
  703.                                  db_handle                 : PISC_DB_HANDLE;
  704.                                  tran_handle               : PISC_TR_HANDLE;
  705.                  isc_arg4                  : UShort;
  706.                                  isc_arg5                  : PChar;
  707.                  isc_arg6               : UShort;
  708.                  isc_arg7                  : PChar;
  709.                                  isc_arg8                  : UShort;
  710.                  isc_arg9                  : PChar): ISC_STATUS;
  711.                                 stdcall;
  712.  
  713. Tisc_vax_integer = function     (buffer                    : PChar;
  714.                  length                    : Short): ISC_LONG;
  715.                                 stdcall;
  716.  
  717. Tisc_portable_integer = function (buffer                   : PChar;
  718.                  length                    : Short): ISC_INT64;
  719.                                 stdcall;
  720.  
  721. (***************************************)
  722. (** Security Functions and structures **)
  723. (***************************************)
  724.  
  725. const
  726.   sec_uid_spec                        = $01;
  727.   sec_gid_spec                        = $02;
  728.   sec_server_spec                = $04;
  729.   sec_password_spec                    = $08;
  730.   sec_group_name_spec                    = $10;
  731.   sec_first_name_spec                    = $20;
  732.   sec_middle_name_spec                  = $40;
  733.   sec_last_name_spec                    = $80;
  734.   sec_dba_user_name_spec                = $100;
  735.   sec_dba_password_spec                 = $200;
  736.  
  737.   sec_protocol_tcpip                    = 1;
  738.   sec_protocol_netbeui                  = 2;
  739.   sec_protocol_spx                      = 3;
  740.   sec_protocol_local                    = 4;
  741.  
  742. type
  743.   TUserSecData = record
  744.     sec_flags: Short;             (** which fields are specified **)
  745.     uid: Int;                 (** the user's id **)
  746.     gid: int;                 (** the user's group id **)
  747.     protocol: Int;             (** protocol to use for connection **)
  748.     server: PChar;                   (** server to administer **)
  749.     user_name: PChar;                (** the user's name **)
  750.     password: PChar;                 (** the user's password **)
  751.     group_name: PChar;               (** the group name **)
  752.     first_name: PChar;                 (** the user's first name **)
  753.     middle_name: PChar;              (** the user's middle name **)
  754.     last_name: PChar;                 (** the user's last name **)
  755.     dba_user_name: PChar;            (** the dba user name **)
  756.     dba_password: PChar;             (** the dba password **)
  757.   end;
  758.   PUserSecData = ^TUserSecData;
  759.  
  760. Tisc_add_user = function        (status_vector             : PISC_STATUS;
  761.                                  user_sec_data             : PUserSecData): ISC_STATUS;
  762.                                 stdcall;
  763.  
  764. Tisc_delete_user = function     (status_vector             : PISC_STATUS;
  765.                                  user_sec_data             : PUserSecData): ISC_STATUS;
  766.                                 stdcall;
  767.  
  768. Tisc_modify_user = function     (status_vector             : PISC_STATUS;
  769.                                  user_sec_data             : PUserSecData): ISC_STATUS;
  770.                                 stdcall;
  771.  
  772. (************************************)
  773. (**  Other OSRI functions          **)
  774. (************************************)
  775.  
  776. Tisc_compile_request = function (status_vector             : PISC_STATUS;
  777.                                  db_handle                 : PISC_DB_HANDLE;
  778.                                  request_handle            : PISC_REQ_HANDLE;
  779.                  isc_arg4                  : Short;
  780.                  isc_arg5                  : PChar): ISC_STATUS;
  781.                                 stdcall;
  782.  
  783. Tisc_compile_request2 = function (status_vector            : PISC_STATUS;
  784.                                  db_handle                 : PISC_DB_HANDLE;
  785.                                  request_handle            : PISC_REQ_HANDLE;
  786.                  isc_arg4                  : Short;
  787.                  isc_arg5                  : PChar): ISC_STATUS;
  788.                                 stdcall;
  789.  
  790. Tisc_ddl = function             (status_vector             : PISC_STATUS;
  791.                      db_handle                 : PISC_DB_HANDLE;
  792.                      tran_handle               : PISC_TR_HANDLE;
  793.                      isc_arg4                  : Short;
  794.                      isc_arg5                  : PChar): ISC_STATUS;
  795.                                 stdcall;
  796.  
  797. Tisc_prepare_transaction = function (status_vector         : PISC_STATUS;
  798.                                  tran_handle               : PISC_TR_HANDLE): ISC_STATUS;
  799.                                 stdcall;
  800.  
  801.  
  802. Tisc_receive = function         (status_vector             : PISC_STATUS;
  803.                                  request_handle            : PISC_REQ_HANDLE;
  804.                  isc_arg3,
  805.                                  isc_arg4                  : Short;
  806.                  isc_arg5                  : PVoid;
  807.                  isc_arg6                  : Short): ISC_STATUS;
  808.                                 stdcall;
  809.  
  810. Tisc_receive2 = function        (status_vector             : PISC_STATUS;
  811.                                  request_handle            : PISC_REQ_HANDLE;
  812.                  isc_arg3,
  813.                                  isc_arg4                  : Short;
  814.                  isc_arg5                  : PVoid;
  815.                  isc_arg6,
  816.                                  isc_arg7                  : Short;
  817.                                  isc_arg8                  : Long): ISC_STATUS;
  818.                                 stdcall;
  819.  
  820. Tisc_reconnect_transaction = function (status_vector       : PISC_STATUS;
  821.                                  db_handle                 : PISC_DB_HANDLE;
  822.                                  tran_handle               : PISC_TR_HANDLE;
  823.                                  isc_arg4                  : Short;
  824.                                  isc_arg5                  : PChar): ISC_STATUS;
  825.                                 stdcall;
  826.  
  827. Tisc_release_request = function (status_vector             : PISC_STATUS;
  828.                                  request_handle            : PISC_REQ_HANDLE): ISC_STATUS;
  829.                                 stdcall;
  830.  
  831. Tisc_request_info = function    (status_vector             : PISC_STATUS;
  832.                                  request_handle            : PISC_REQ_HANDLE;
  833.                                  isc_arg3                  : Short;
  834.                                  isc_arg4                  : Short;
  835.                                  isc_arg5                  : PChar;
  836.                                  isc_arg6                  : Short;
  837.                                  isc_arg7                  : PChar): ISC_STATUS;
  838.                                 stdcall;
  839.  
  840. Tisc_seek_blob = function       (status_vector             : PISC_STATUS;
  841.                                  blob_handle               : PISC_BLOB_HANDLE;
  842.                                  isc_arg3                  : Short;
  843.                                  isc_arg4                  : ISC_LONG;
  844.                                  isc_arg5                  : PISC_LONG): ISC_STATUS;
  845.                                 stdcall;
  846.  
  847. Tisc_send = function            (status_vector             : PISC_STATUS;
  848.                  request_handle            : PISC_REQ_HANDLE;
  849.                  isc_arg3,
  850.                                  isc_arg4                  : Short;
  851.                  isc_arg5                  : PVoid;
  852.                  isc_arg6                  : Short): ISC_STATUS;
  853.                                 stdcall;
  854.  
  855. Tisc_start_and_send = function  (status_vector             : PISC_STATUS;
  856.                                  request_handle            : PISC_REQ_HANDLE;
  857.                  tran_handle               : PISC_TR_HANDLE;
  858.                  isc_arg4,
  859.                                  isc_arg5                  : Short;
  860.                                  isc_arg6                  : PVoid;
  861.                                  isc_arg7                  : Short): ISC_STATUS;
  862.                                 stdcall;
  863.  
  864. Tisc_start_request = function   (status_vector             : PISC_STATUS;
  865.                                  request_handle            : PISC_REQ_HANDLE;
  866.                                  tran_handle               : PISC_TR_HANDLE;
  867.                                  isc_arg4                  : Short): ISC_STATUS;
  868.                                 stdcall;
  869.  
  870. Tisc_unwind_request = function  (status_vector             : PISC_STATUS;
  871.                                  tran_handle               : PISC_TR_HANDLE;
  872.                                  isc_arg3                  : Short): ISC_STATUS;
  873.                                 stdcall;
  874.  
  875. Tisc_wait_for_event = function  (status_vector             : PISC_STATUS;
  876.                                  db_handle                 : PISC_DB_HANDLE;
  877.                                  length                    : Short;
  878.                                  event_buffer,
  879.                                  result_buffer             : PChar): ISC_STATUS;
  880.                                 stdcall;
  881.  
  882. (*******************************)
  883. (** Other Sql functions       **)
  884. (*******************************)
  885.  
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900.  
  901.  
  902.  
  903.  
  904.  
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.  
  932.  
  933.  
  934.  
  935.  
  936.  
  937.  
  938. Tisc_close = function           (status_vector             : PISC_STATUS;
  939.                                  isc_arg2                  : PChar): ISC_STATUS;
  940.                                 stdcall;
  941.  
  942. Tisc_declare = function         (status_vector             : PISC_STATUS;
  943.                                  isc_arg2,
  944.                                  isc_arg3                  : PChar): ISC_STATUS;
  945.                                 stdcall;
  946.  
  947. Tisc_describe = function        (status_vector             : PISC_STATUS;
  948.                                  isc_arg2                  : PChar;
  949.                                  isc_arg3                  : PXSQLDA): ISC_STATUS;
  950.                                 stdcall;
  951.  
  952. Tisc_describe_bind = function   (status_vector             : PISC_STATUS;
  953.                                  isc_arg2                  : PChar;
  954.                                  isc_arg3                  : PXSQLDA): ISC_STATUS;
  955.                                 stdcall;
  956.  
  957. Tisc_execute = function         (status_vector             : PISC_STATUS;
  958.                                  tran_handle               : PISC_TR_HANDLE;
  959.                                  isc_arg3                  : PChar;
  960.                                  isc_arg4                  : PXSQLDA): ISC_STATUS;
  961.                                 stdcall;
  962.  
  963. Tisc_execute_immediate = function (status_vector           : PISC_STATUS;
  964.                                  db_handle                 : PISC_DB_HANDLE;
  965.                                  tran_handle               : PISC_TR_HANDLE;
  966.                                  isc_arg4                  : PShort;
  967.                                  isc_arg5                  : PChar): ISC_STATUS;
  968.                                 stdcall;
  969.  
  970. Tisc_fetch = function           (status_vector             : PISC_STATUS;
  971.                  isc_arg2                  : PChar;
  972.                  isc_arg3                  : PXSQLDA): ISC_STATUS;
  973.                                 stdcall;
  974.  
  975. Tisc_open = function            (status_vector             : PISC_STATUS;
  976.                  tran_handle               : PISC_TR_HANDLE;
  977.                  isc_arg3                  : PChar;
  978.                  isc_arg4                  : PXSQLDA): ISC_STATUS;
  979.                                 stdcall;
  980.  
  981. Tisc_prepare = function         (status_vector             : PISC_STATUS;
  982.                                  db_handle                 : PISC_DB_HANDLE;
  983.                                  tran_handle               : PISC_TR_HANDLE;
  984.                                  isc_arg4                  : PChar;
  985.                                  isc_arg5                  : PShort;
  986.                                  isc_arg6                  : PChar;
  987.                                  isc_arg7                  : PXSQLDA): ISC_STATUS;
  988.                                 stdcall;
  989.  
  990.  
  991. (***************************************)
  992. (** Other Dynamic sql functions       **)
  993. (***************************************)
  994.  
  995. Tisc_dsql_execute_m = function  (status_vector             : PISC_STATUS;
  996.                                  tran_handle               : PISC_TR_HANDLE;
  997.                                  statement_handle          : PISC_STMT_HANDLE;
  998.                                  isc_arg4                  : UShort;
  999.                                  isc_arg5                  : PChar;
  1000.                                  isc_arg6                  : UShort;
  1001.                                  isc_arg7                  : UShort;
  1002.                                  isc_arg8                  : PChar): ISC_STATUS;
  1003.                                 stdcall;
  1004.  
  1005. Tisc_dsql_execute2_m = function (status_vector             : PISC_STATUS;
  1006.                                  tran_handle               : PISC_TR_HANDLE;
  1007.                                  statement_handle          : PISC_STMT_HANDLE;
  1008.                                  isc_arg4                  : UShort;
  1009.                                  isc_arg5                  : PChar;
  1010.                                  isc_arg6                  : UShort;
  1011.                                  isc_arg7                  : UShort;
  1012.                                  isc_arg8                  : PChar;
  1013.                                  isc_arg9                  : UShort;
  1014.                                  isc_arg10                 : PChar;
  1015.                                  isc_arg11                 : UShort;
  1016.                                  isc_arg12                 : UShort;
  1017.                                  isc_arg13                 : PChar): ISC_STATUS;
  1018.                                 stdcall;
  1019.  
  1020. Tisc_dsql_execute_immediate_m = function (status_vector    : PISC_STATUS;
  1021.                                  db_handle                 : PISC_DB_HANDLE;
  1022.                                  tran_handle               : PISC_TR_HANDLE;
  1023.                                  isc_arg4                  : UShort;
  1024.                                  isc_arg5                  : PChar;
  1025.                                  isc_arg6                  : UShort;
  1026.                                  isc_arg7                  : UShort;
  1027.                                  isc_arg8                  : PChar;
  1028.                                  isc_arg9                  : UShort;
  1029.                                  isc_arg10                 : UShort;
  1030.                                  isc_arg11                 : PChar): ISC_STATUS;
  1031.                                 stdcall;
  1032.  
  1033. Tisc_dsql_exec_immed3_m = function  (status_vector         : PISC_STATUS;
  1034.                                  db_handle                 : PISC_DB_HANDLE;
  1035.                                  tran_handle               : PISC_TR_HANDLE;
  1036.                                  isc_arg4                  : UShort;
  1037.                                  isc_arg5                  : PChar;
  1038.                                  isc_arg6                  : UShort;
  1039.                                  isc_arg7                  : UShort;
  1040.                                  isc_arg8                  : PChar;
  1041.                                  isc_arg9                  : UShort;
  1042.                                  isc_arg10                 : UShort;
  1043.                                  isc_arg11                 : PChar;
  1044.                                  isc_arg12                 : UShort;
  1045.                                  isc_arg13                 : PChar;
  1046.                                  isc_arg14                 : UShort;
  1047.                                  isc_arg15                 : UShort;
  1048.                                  isc_arg16                 : PChar): ISC_STATUS;
  1049.                                 stdcall;
  1050.  
  1051. Tisc_dsql_fetch_m = function    (status_vector             : PISC_STATUS;
  1052.                                  statement_handle          : PISC_STMT_HANDLE;
  1053.                                  isc_arg3                  : UShort;
  1054.                                  isc_arg4                  : PChar;
  1055.                                  isc_arg5                  : UShort;
  1056.                                  isc_arg6                  : UShort;
  1057.                                  isc_arg7                  : PChar): ISC_STATUS;
  1058.                                 stdcall;
  1059.  
  1060. (*$ifdef SCROLLABLE_CURSORS*)
  1061. Tisc_dsql_fetch2_m = function   (status_vector             : PISC_STATUS;
  1062.                                  statement_handle          : PISC_STMT_HANDLE;
  1063.                                  isc_arg3                  : UShort;
  1064.                                  isc_arg4                  : PChar;
  1065.                                  isc_arg5                  : UShort;
  1066.                                  isc_arg6                  : UShort;
  1067.                                  isc_arg7                  : PChar;
  1068.                                  isc_arg8                  : UShort;
  1069.                                  isc_arg9                  : Long): ISC_STATUS;
  1070.                                 stdcall;
  1071. (*$endif*)
  1072.  
  1073. Tisc_dsql_insert_m = function   (status_vector             : PISC_STATUS;
  1074.                                  statement_handle          : PISC_STMT_HANDLE;
  1075.                                  isc_arg3                  : UShort;
  1076.                                  isc_arg4                  : PChar;
  1077.                                  isc_arg5                  : UShort;
  1078.                                  isc_arg6                  : UShort;
  1079.                                  isc_arg7                  : PChar): ISC_STATUS;
  1080.                                 stdcall;
  1081.  
  1082. Tisc_dsql_prepare_m = function  (status_vector             : PISC_STATUS;
  1083.                                  tran_handle               : PISC_TR_HANDLE;
  1084.                                  statement_handle          : PISC_STMT_HANDLE;
  1085.                                  isc_arg4                  : UShort;
  1086.                                  isc_arg5                  : PChar;
  1087.                                  isc_arg6                  : UShort;
  1088.                                  isc_arg7                  : UShort;
  1089.                                  isc_arg8                  : PChar;
  1090.                                  isc_arg9                  : UShort;
  1091.                                  isc_arg10                 : PChar): ISC_STATUS;
  1092.                                 stdcall;
  1093.  
  1094. Tisc_dsql_release = function    (status_vector             : PISC_STATUS;
  1095.                                  isc_arg2                  : PChar): ISC_STATUS;
  1096.                                 stdcall;
  1097.  
  1098. Tisc_embed_dsql_close = function(status_vector             : PISC_STATUS;
  1099.                                  isc_arg2                  : PChar): ISC_STATUS;
  1100.                                 stdcall;
  1101.  
  1102. Tisc_embed_dsql_declare = function  (status_vector         : PISC_STATUS;
  1103.                                  isc_arg2                  : PChar;
  1104.                                  isc_arg3                  : PChar): ISC_STATUS;
  1105.                                 stdcall;
  1106.  
  1107. Tisc_embed_dsql_describe = function (status_vector         : PISC_STATUS;
  1108.                                  isc_arg2                  : PChar;
  1109.                                  isc_arg3                  : UShort;
  1110.                                  isc_arg4                  : PXSQLDA): ISC_STATUS;
  1111.                                 stdcall;
  1112.  
  1113. Tisc_embed_dsql_describe_bind = function (status_vector    : PISC_STATUS;
  1114.                  isc_arg2                  : PChar;
  1115.                                  isc_arg3                  : UShort;
  1116.                                  isc_arg4                  : PXSQLDA): ISC_STATUS;
  1117.                                 stdcall;
  1118.  
  1119. Tisc_embed_dsql_execute = function  (status_vector         : PISC_STATUS;
  1120.                                  tran_handle               : PISC_TR_HANDLE;
  1121.                                  isc_arg3                  : PChar;
  1122.                                  isc_arg4                  : UShort;
  1123.                                  isc_arg5                  : PXSQLDA): ISC_STATUS;
  1124.                                 stdcall;
  1125.  
  1126. Tisc_embed_dsql_execute2 = function (status_vector         : PISC_STATUS;
  1127.                  tran_handle               : PISC_TR_HANDLE;
  1128.                                  isc_arg3                  : PChar;
  1129.                                  isc_arg4                  : UShort;
  1130.                                  isc_arg5                  : PXSQLDA;
  1131.                                  isc_arg6                  : PXSQLDA): ISC_STATUS;
  1132.                                 stdcall;
  1133.  
  1134. Tisc_embed_dsql_execute_immed = function (status_vector    : PISC_STATUS;
  1135.                  db_handle                 : PISC_DB_HANDLE;
  1136.                                  tran_handle               : PISC_TR_HANDLE;
  1137.                                  isc_arg4                  : UShort;
  1138.                                  isc_arg5                  : PChar;
  1139.                                  isc_arg6                  : UShort;
  1140.                                  isc_arg7                  : PXSQLDA): ISC_STATUS;
  1141.                                 stdcall;
  1142.  
  1143. Tisc_embed_dsql_fetch = function(status_vector             : PISC_STATUS;
  1144.                                  isc_arg2                  : PChar;
  1145.                                  isc_arg3                  : UShort;
  1146.                                  isc_arg4                  : PXSQLDA): ISC_STATUS;
  1147.                                 stdcall;
  1148.  
  1149. (*$ifdef SCROLLABLE_CURSORS*)
  1150. Tisc_embed_dsql_fetch2 = function  (status_vector         : PISC_STATUS;
  1151.                                 isc_arg2                  : PChar;
  1152.                                 isc_arg3                  : UShort;
  1153.                                 isc_arg4                  : PXSQLDA;
  1154.                                 isc_arg5                  : UShort;
  1155.                                 isc_arg6                  : Long): ISC_STATUS;
  1156.                                 stdcall;
  1157. (*$endif*)
  1158.  
  1159. Tisc_embed_dsql_open = function (status_vector             : PISC_STATUS;
  1160.                                  tran_handle               : PISC_TR_HANDLE;
  1161.                                  isc_arg3                  : PChar;
  1162.                                  isc_arg4                  : UShort;
  1163.                                  isc_arg5                  : PXSQLDA): ISC_STATUS;
  1164.                                 stdcall;
  1165.  
  1166. Tisc_embed_dsql_open2 = function (status_vector            : PISC_STATUS;
  1167.                                  tran_handle               : PISC_TR_HANDLE;
  1168.                                  isc_arg3                  : PChar;
  1169.                                  isc_arg4                  : UShort;
  1170.                                  isc_arg5                  : PXSQLDA;
  1171.                                  isc_arg6                  : PXSQLDA): ISC_STATUS;
  1172.                                 stdcall;
  1173.  
  1174. Tisc_embed_dsql_insert = function (status_vector           : PISC_STATUS;
  1175.                                  isc_arg2                  : PChar;
  1176.                                  isc_arg3                  : UShort;
  1177.                                  isc_arg4                  : PXSQLDA): ISC_STATUS;
  1178.                                 stdcall;
  1179.  
  1180. Tisc_embed_dsql_prepare = function  (status_vector         : PISC_STATUS;
  1181.                                  db_handle                 : PISC_DB_HANDLE;
  1182.                                  tran_handle               : PISC_TR_HANDLE;
  1183.                                  isc_arg4                  : PChar;
  1184.                                  isc_arg5                  : UShort;
  1185.                                  isc_arg6                  : PChar;
  1186.                                  isc_arg7                  : UShort;
  1187.                                  isc_arg8                  : PXSQLDA): ISC_STATUS;
  1188.                                 stdcall;
  1189.  
  1190. Tisc_embed_dsql_release = function  (status_vector         : PISC_STATUS;
  1191.                                  isc_arg2                  : PChar): ISC_STATUS;
  1192.                                 stdcall;
  1193.  
  1194. (********************************)
  1195. (** Other Blob functions       **)
  1196. (********************************)
  1197.  
  1198. TBLOB_open = function           (blob_handle               : TISC_BLOB_HANDLE;
  1199.                                  isc_arg2                  : PChar;
  1200.                                  isc_arg3                  : int): PBSTREAM;
  1201.                                 stdcall;
  1202.  
  1203. TBLOB_put = function            (isc_arg1                  : char;
  1204.                  isc_arg2                  : PBSTREAM): Int;
  1205.                                 stdcall;
  1206.  
  1207. TBLOB_close = function         (isc_arg1                  : PBSTREAM): Int;
  1208.                                 stdcall;
  1209.  
  1210. TBLOB_get = function           (isc_arg1                  : PBSTREAM): Int;
  1211.                                 stdcall;
  1212.  
  1213. TBLOB_display = function        (isc_arg1                  : PISC_QUAD;
  1214.                                  db_handle                 : TISC_DB_HANDLE;
  1215.                                  tran_handle               : TISC_TR_HANDLE;
  1216.                                  isc_arg4                  : PChar): Int;
  1217.                                 stdcall;
  1218.  
  1219. TBLOB_dump = function           (isc_arg1                  : PISC_QUAD;
  1220.                  db_handle                 : TISC_DB_HANDLE;
  1221.                  tran_handle               : TISC_TR_HANDLE;
  1222.                                  isc_arg4                  : PChar): Int;
  1223.                                 stdcall;
  1224.  
  1225. TBLOB_edit = function           (isc_arg1                  : PISC_QUAD;
  1226.                  db_handle                 : TISC_DB_HANDLE;
  1227.                  tran_handle               : TISC_TR_HANDLE;
  1228.                                  isc_arg4                  : PChar): Int;
  1229.                                 stdcall;
  1230.  
  1231. TBLOB_load = function           (isc_arg1                  : PISC_QUAD;
  1232.                  db_handle                 : TISC_DB_HANDLE;
  1233.                  tran_handle               : TISC_TR_HANDLE;
  1234.                                  isc_arg4                  : PChar): Int;
  1235.                                 stdcall;
  1236.  
  1237. TBLOB_text_dump = function      (isc_arg1                  : PISC_QUAD;
  1238.                  db_handle                 : TISC_DB_HANDLE;
  1239.                  tran_handle               : TISC_TR_HANDLE;
  1240.                                  isc_arg4                  : PChar): Int;
  1241.                                 stdcall;
  1242.  
  1243. TBLOB_text_load = function      (isc_arg1                  : PISC_QUAD;
  1244.                  db_handle                 : TISC_DB_HANDLE;
  1245.                  tran_handle               : TISC_TR_HANDLE;
  1246.                                  isc_arg4                  : PChar): Int;
  1247.                                 stdcall;
  1248.  
  1249. TBopen = function               (isc_arg1                  : PISC_QUAD;
  1250.                  db_handle                 : TISC_DB_HANDLE;
  1251.                  tran_handle               : TISC_TR_HANDLE;
  1252.                                  isc_arg4                  : PChar): Int;
  1253.                                 stdcall;
  1254.  
  1255. TBopen2 = function              (isc_arg1                  : PISC_QUAD;
  1256.                  db_handle                 : TISC_DB_HANDLE;
  1257.                  tran_handle               : TISC_TR_HANDLE;
  1258.                                  isc_arg4                  : PChar;
  1259.                                  isc_arg5                  : UShort): PBSTREAM;
  1260.                                 stdcall;
  1261.  
  1262. (********************************)
  1263. (** Other Misc functions       **)
  1264. (********************************)
  1265.  
  1266. Tisc_ftof = function            (isc_arg1                  : PChar;
  1267.                  isc_arg2                  : UShort;
  1268.                  isc_arg3                  : PChar;
  1269.                  isc_arg4                  : UShort): ISC_LONG;
  1270.                                 stdcall;
  1271.  
  1272. Tisc_print_blr = function       (isc_arg1                  : PChar;
  1273.                                  isc_arg2                  : TISC_CALLBACK;
  1274.                                  isc_arg3                  : PVoid;
  1275.                                  isc_arg4                  : Short): ISC_STATUS;
  1276.                                 stdcall;
  1277.  
  1278. Tisc_set_debug = procedure     (isc_arg1                  : Int);
  1279.                                 stdcall;
  1280.  
  1281. Tisc_qtoq = procedure           (isc_arg1                  : PISC_QUAD;
  1282.                  isc_arg2                  : PISC_QUAD);
  1283.                                 stdcall;
  1284.  
  1285. Tisc_vtof = procedure           (isc_arg1                  : PChar;
  1286.                  isc_arg2                  : PChar;
  1287.                  isc_arg3                  : UShort);
  1288.                                 stdcall;
  1289.  
  1290. Tisc_vtov = procedure           (isc_arg1                  : PChar;
  1291.                  isc_arg2                  : PChar;
  1292.                  isc_arg3                  : Short);
  1293.                                 stdcall;
  1294.  
  1295. Tisc_version = function         (db_handle                 : PISC_DB_HANDLE;
  1296.                                  isc_arg2                  : TISC_CALLBACK;
  1297.                                  isc_arg3                  : PVoid): Int;
  1298.                                 stdcall;
  1299.  
  1300. Tisc_reset_fpe = function      (isc_arg1                  : UShort): ISC_LONG;
  1301.                                 stdcall;
  1302.  
  1303. (*******************************************)
  1304. (** Service manager functions             **)
  1305. (*******************************************)
  1306.  
  1307. Tisc_service_attach = function  (status_vector             : PISC_STATUS;
  1308.                                  isc_arg2                  : UShort;
  1309.                                  isc_arg3                  : PChar;
  1310.                                  service_handle            : PISC_SVC_HANDLE;
  1311.                                  isc_arg5                  : UShort;
  1312.                                  isc_arg6                  : PChar): ISC_STATUS;
  1313.                                 stdcall;
  1314.  
  1315. Tisc_service_detach = function (status_vector             : PISC_STATUS;
  1316.                                 service_handle            : PISC_SVC_HANDLE): ISC_STATUS;
  1317.                                 stdcall;
  1318.  
  1319. Tisc_service_query = function   (status_vector             : PISC_STATUS;
  1320.                                  service_handle            : PISC_SVC_HANDLE;
  1321.                                  recv_handle               : PISC_SVC_HANDLE;
  1322.                                  isc_arg4                  : UShort;
  1323.                                  isc_arg5                  : PChar;
  1324.                                  isc_arg6                  : UShort;
  1325.                                  isc_arg7                  : PChar;
  1326.                                  isc_arg8                  : UShort;
  1327.                                  isc_arg9                  : PChar): ISC_STATUS;
  1328.                                 stdcall;
  1329.  
  1330. Tisc_service_start = function  (status_vector             : PISC_STATUS;
  1331.                                 service_handle            : PISC_SVC_HANDLE;
  1332.                                 recv_handle               : PISC_SVC_HANDLE;
  1333.                                 isc_arg4                  : UShort;
  1334.                                 isc_arg5                  : PChar): ISC_STATUS;
  1335.                                 stdcall;
  1336.  
  1337. (*********************************)
  1338. (** Forms functions             **)
  1339. (*********************************)
  1340.  
  1341. Tisc_compile_map = function     (status_vector             : PISC_STATUS;
  1342.                                  form_handle               : PISC_FORM_HANDLE;
  1343.                                  request_handle            : PISC_REQ_HANDLE;
  1344.                                  isc_arg4                  : PShort;
  1345.                                  isc_arg5                  : PChar): ISC_STATUS;
  1346.                                 stdcall;
  1347.  
  1348. Tisc_compile_menu = function    (status_vector             : PISC_STATUS;
  1349.                                  form_handle               : PISC_FORM_HANDLE;
  1350.                                  request_handle            : PISC_REQ_HANDLE;
  1351.                                  isc_arg4                  : PShort;
  1352.                                  isc_arg5                  : PChar): ISC_STATUS;
  1353.                                 stdcall;
  1354.  
  1355. Tisc_compile_sub_map = function (status_vector             : PISC_STATUS;
  1356.                                  win_handle                : PISC_WIN_HANDLE;
  1357.                                  request_handle            : PISC_REQ_HANDLE;
  1358.                                  isc_arg4                  : PShort;
  1359.                                  isc_arg5                  : PChar): ISC_STATUS;
  1360.                                 stdcall;
  1361.  
  1362. Tisc_create_window = function   (status_vector             : PISC_STATUS;
  1363.                                  win_handle                : PISC_WIN_HANDLE;
  1364.                                  isc_arg3                  : PShort;
  1365.                                  isc_arg4                  : PChar;
  1366.                                  isc_arg5                  : PShort;
  1367.                                  isc_arg6                  : PShort): ISC_STATUS;
  1368.                                 stdcall;
  1369.  
  1370. Tisc_delete_window = function   (status_vector             : PISC_STATUS;
  1371.                                  win_handle                : PISC_WIN_HANDLE): ISC_STATUS;
  1372.                                 stdcall;
  1373.  
  1374. Tisc_drive_form = function      (status_vector             : PISC_STATUS;
  1375.                                  db_handle                 : PISC_DB_HANDLE;
  1376.                                  tran_handle               : PISC_TR_HANDLE;
  1377.                                  win_handle                : PISC_WIN_HANDLE;
  1378.                                  request_handle            : PISC_REQ_HANDLE;
  1379.                                  isc_arg6                  : PUChar;
  1380.                                  isc_arg7                  : PUChar): ISC_STATUS;
  1381.                                 stdcall;
  1382.  
  1383. Tisc_drive_menu = function      (status_vector             : PISC_STATUS;
  1384.                                  win_handle                : PISC_WIN_HANDLE;
  1385.                                  request_handle            : PISC_REQ_HANDLE;
  1386.                                  isc_arg4                  : PShort;
  1387.                                  isc_arg5                  : PChar;
  1388.                                  isc_arg6                  : PShort;
  1389.                                  isc_arg7                  : PChar;
  1390.                                  isc_arg8                  : PShort;
  1391.                                  isc_arg9                  : PShort;
  1392.                                  isc_arg10                 : PChar;
  1393.                                  isc_arg11                 : PISC_LONG): ISC_STATUS;
  1394.                                 stdcall;
  1395.  
  1396. Tisc_form_delete = function     (status_vector             : PISC_STATUS;
  1397.                                  form_handle               : PISC_FORM_HANDLE): ISC_STATUS;
  1398.                                 stdcall;
  1399.  
  1400. Tisc_form_fetch = function      (status_vector             : PISC_STATUS;
  1401.                                  db_handle                 : PISC_DB_HANDLE;
  1402.                                  tran_handle               : PISC_TR_HANDLE;
  1403.                                  request_handle            : PISC_REQ_HANDLE;
  1404.                                  isc_arg5                  : PUChar): ISC_STATUS;
  1405.                                 stdcall;
  1406.  
  1407. Tisc_form_insert = function     (status_vector             : PISC_STATUS;
  1408.                                  db_handle                 : PISC_DB_HANDLE;
  1409.                                  tran_handle               : PISC_TR_HANDLE;
  1410.                                  request_handle            : PISC_REQ_HANDLE;
  1411.                                  isc_arg5                  : PUChar): ISC_STATUS;
  1412.                                 stdcall;
  1413.  
  1414. Tisc_get_entree = function      (status_vector             : PISC_STATUS;
  1415.                                  request_handle            : PISC_REQ_HANDLE;
  1416.                                  isc_arg3                  : PShort;
  1417.                                  isc_arg4                  : PChar;
  1418.                                  isc_arg5                  : PISC_LONG;
  1419.                                  isc_arg6                  : PShort): ISC_STATUS;
  1420.                                 stdcall;
  1421.  
  1422. Tisc_initialize_menu = function (status_vector             : PISC_STATUS;
  1423.                                  request_handle            : PISC_REQ_HANDLE): ISC_STATUS;
  1424.                                 stdcall;
  1425.  
  1426. Tisc_menu = function            (status_vector             : PISC_STATUS;
  1427.                  win_handle                : PISC_WIN_HANDLE;
  1428.                  request_handle            : PISC_REQ_HANDLE;
  1429.                   isc_arg4                  : PShort;
  1430.                  isc_arg5                  : PChar): ISC_STATUS;
  1431.                                 stdcall;
  1432.  
  1433. Tisc_load_form = function       (status_vector             : PISC_STATUS;
  1434.                                  db_handle                 : PISC_DB_HANDLE;
  1435.                                  tran_handle               : PISC_TR_HANDLE;
  1436.                                  form_handle               : PISC_FORM_HANDLE;
  1437.                                  isc_arg5                  : PShort;
  1438.                                  isc_arg6                  : PChar): ISC_STATUS;
  1439.                                 stdcall;
  1440.  
  1441. Tisc_pop_window = function      (status_vector             : PISC_STATUS;
  1442.                                  win_handle                : PISC_WIN_HANDLE): ISC_STATUS;
  1443.                                 stdcall;
  1444.  
  1445. Tisc_put_entree = function      (status_vector             : PISC_STATUS;
  1446.                                  request_handle            : PISC_REQ_HANDLE;
  1447.                                  isc_arg3                  : PShort;
  1448.                                  isc_arg4                  : PChar;
  1449.                                  isc_arg5                  : PISC_LONG): ISC_STATUS;
  1450.                                 stdcall;
  1451.  
  1452. Tisc_reset_form = function      (status_vector             : PISC_STATUS;
  1453.                                  request_handle            : PISC_REQ_HANDLE): ISC_STATUS;
  1454.                                 stdcall;
  1455.  
  1456. Tisc_suspend_window = function  (status_vector             : PISC_STATUS;
  1457.                                  win_handle                : PISC_WIN_HANDLE): ISC_STATUS;
  1458.                                 stdcall;
  1459.  
  1460. (** Constants!!! **)
  1461. (*****************************************************)
  1462. (** Actions to pass to the blob filter (ctl_source) **)
  1463. (*****************************************************)
  1464.  
  1465. const
  1466.   isc_blob_filter_open           =          0;
  1467.   isc_blob_filter_get_segment    =          1;
  1468.   isc_blob_filter_close          =          2;
  1469.   isc_blob_filter_create         =          3;
  1470.   isc_blob_filter_put_segment    =          4;
  1471.   isc_blob_filter_alloc          =          5;
  1472.   isc_blob_filter_free           =          6;
  1473.   isc_blob_filter_seek           =          7;
  1474.  
  1475. (*********************)
  1476. (** Blr definitions **)
  1477. (*********************)
  1478.  
  1479.   // In pascal, how does one deal with the below "#define"?
  1480.   // blr_word(n) ((n) % 256), ((n) / 256)
  1481.   blr_text                       =         14;
  1482.   blr_text2                      =         15;
  1483.   blr_short                      =          7;
  1484.   blr_long                       =          8;
  1485.   blr_quad                       =          9;
  1486.   blr_float                      =         10;
  1487.   blr_double                     =         27;
  1488.   blr_d_float                    =         11;
  1489.   blr_timestamp                  =         35;
  1490.   blr_varying                    =         37;
  1491.   blr_varying2                   =         38;
  1492.   blr_blob                       =        261;
  1493.   blr_cstring                    =         40;
  1494.   blr_cstring2                   =         41;
  1495.   blr_blob_id                    =         45;
  1496.   blr_sql_date                   =         12;
  1497.   blr_sql_time                   =         13;
  1498.   blr_int64                      =         16;
  1499.   blr_date                       =         blr_timestamp;
  1500.  
  1501.  
  1502.   blr_inner                      =          0;
  1503.   blr_left                       =          1;
  1504.   blr_right                      =          2;
  1505.   blr_full                       =          3;
  1506.  
  1507.   blr_gds_code                   =          0;
  1508.   blr_sql_code                   =          1;
  1509.   blr_exception                  =          2;
  1510.   blr_trigger_code               =          3;
  1511.   blr_default_code               =          4;
  1512.  
  1513.   blr_version4                   =          4;
  1514.   blr_version5                   =          5;
  1515.   blr_eoc                        =         76;
  1516.   blr_end                        =         -1;
  1517.  
  1518.   blr_assignment                 =          1;
  1519.   blr_begin                      =          2;
  1520.   blr_dcl_variable               =          3;
  1521.   blr_message                    =          4;
  1522.   blr_erase                      =          5;
  1523.   blr_fetch                      =          6;
  1524.   blr_for                        =          7;
  1525.   blr_if                         =          8;
  1526.   blr_loop                       =          9;
  1527.   blr_modify                     =         10;
  1528.   blr_handler                    =         11;
  1529.   blr_receive                    =         12;
  1530.   blr_select                     =         13;
  1531.   blr_send                       =         14;
  1532.   blr_store                      =         15;
  1533.   blr_label                      =         17;
  1534.   blr_leave                      =         18;
  1535.   blr_store2                     =         19;
  1536.   blr_post                       =         20;
  1537.  
  1538.   blr_literal                    =         21;
  1539.   blr_dbkey                      =         22;
  1540.   blr_field                      =         23;
  1541.   blr_fid                        =         24;
  1542.   blr_parameter                  =         25;
  1543.   blr_variable                   =         26;
  1544.   blr_average                    =         27;
  1545.   blr_count                      =         28;
  1546.   blr_maximum                    =         29;
  1547.   blr_minimum                    =         30;
  1548.   blr_total                      =         31;
  1549.   blr_add                        =         34;
  1550.   blr_subtract                   =         35;
  1551.   blr_multiply                   =         36;
  1552.   blr_divide                     =         37;
  1553.   blr_negate                     =         38;
  1554.   blr_concatenate                =         39;
  1555.   blr_substring                  =         40;
  1556.   blr_parameter2                 =         41;
  1557.   blr_from                       =         42;
  1558.   blr_via                        =         43;
  1559.   blr_user_name                  =         44;
  1560.   blr_null                       =         45;
  1561.  
  1562.   blr_eql                        =         47;
  1563.   blr_neq                        =         48;
  1564.   blr_gtr                        =         49;
  1565.   blr_geq                        =         50;
  1566.   blr_lss                        =         51;
  1567.   blr_leq                        =         52;
  1568.   blr_containing                 =         53;
  1569.   blr_matching                   =         54;
  1570.   blr_starting                   =         55;
  1571.   blr_between                    =         56;
  1572.   blr_or                         =         57;
  1573.   blr_and                        =         58;
  1574.   blr_not                        =         59;
  1575.   blr_any                        =         60;
  1576.   blr_missing                    =         61;
  1577.   blr_unique                     =         62;
  1578.   blr_like                       =         63;
  1579.  
  1580.   blr_stream                     =         65;
  1581.   blr_set_index                  =         66;
  1582.   blr_rse                        =         67;
  1583.   blr_first                      =         68;
  1584.   blr_project                    =         69;
  1585.   blr_sort                       =         70;
  1586.   blr_boolean                    =         71;
  1587.   blr_ascending                  =         72;
  1588.   blr_descending                 =         73;
  1589.   blr_relation                   =         74;
  1590.   blr_rid                        =         75;
  1591.   blr_union                      =         76;
  1592.   blr_map                        =         77;
  1593.   blr_group_by                   =         78;
  1594.   blr_aggregate                  =         79;
  1595.   blr_join_type                  =         80;
  1596.  
  1597.   blr_agg_count                  =         83;
  1598.   blr_agg_max                    =         84;
  1599.   blr_agg_min                    =         85;
  1600.   blr_agg_total                  =         86;
  1601.   blr_agg_average                =         87;
  1602.   blr_parameter3                 =         88;
  1603.   blr_run_count                  =        118;
  1604.   blr_run_max                    =         89;
  1605.   blr_run_min                    =         90;
  1606.   blr_run_total                  =         91;
  1607.   blr_run_average                =         92;
  1608.   blr_agg_count2                 =         93;
  1609.   blr_agg_count_distinct         =         94;
  1610.   blr_agg_total_distinct         =         95;
  1611.   blr_agg_average_distinct       =         96;
  1612.  
  1613.   blr_function                   =        100;
  1614.   blr_gen_id                     =        101;
  1615.   blr_prot_mask                  =        102;
  1616.   blr_upcase                     =        103;
  1617.   blr_lock_state                 =        104;
  1618.   blr_value_if                   =        105;
  1619.   blr_matching2                  =        106;
  1620.   blr_index                      =        107;
  1621.   blr_ansi_like                  =        108;
  1622.   blr_bookmark                   =        109;
  1623.   blr_crack                      =        110;
  1624.   blr_force_crack                =        111;
  1625.   blr_seek                       =        112;
  1626.   blr_find                       =        113;
  1627.  
  1628.   blr_continue                   =          0;
  1629.   blr_forward                    =          1;
  1630.   blr_backward                   =          2;
  1631.   blr_bof_forward                =          3;
  1632.   blr_eof_backward               =          4;
  1633.  
  1634.   blr_lock_relation              =        114;
  1635.   blr_lock_record                =        115;
  1636.   blr_set_bookmark               =        116;
  1637.   blr_get_bookmark               =        117;
  1638.   blr_rs_stream                  =        119;
  1639.   blr_exec_proc                  =        120;
  1640.   blr_begin_range                =        121;
  1641.   blr_end_range                  =        122;
  1642.   blr_delete_range               =        123;
  1643.   blr_procedure                  =        124;
  1644.   blr_pid                        =        125;
  1645.   blr_exec_pid                   =        126;
  1646.   blr_singular                   =        127;
  1647.   blr_abort                      =        128;
  1648.   blr_block                      =        129;
  1649.   blr_error_handler              =        130;
  1650.   blr_cast                       =        131;
  1651.   blr_release_lock               =        132;
  1652.   blr_release_locks              =        133;
  1653.   blr_start_savepoint            =        134;
  1654.   blr_end_savepoint              =        135;
  1655.   blr_find_dbkey                 =        136;
  1656.   blr_range_relation             =        137;
  1657.   blr_delete_ranges              =        138;
  1658.  
  1659.   blr_plan                       =        139;
  1660.   blr_merge                      =        140;
  1661.   blr_join                       =        141;
  1662.   blr_sequential                 =        142;
  1663.   blr_navigational               =        143;
  1664.   blr_indices                    =        144;
  1665.   blr_retrieve                   =        145;
  1666.  
  1667.   blr_relation2                  =        146;
  1668.   blr_rid2                       =        147;
  1669.   blr_reset_stream               =        148;
  1670.   blr_release_bookmark           =        149;
  1671.   blr_set_generator              =        150;
  1672.   blr_ansi_any                   =        151;
  1673.   blr_exists                     =        152;
  1674.   blr_cardinality                =        153;
  1675.  
  1676.   blr_record_version             =        154;        (** get tid of record **)
  1677.   blr_stall                      =        155;        (** fake server stall **)
  1678.   blr_seek_no_warn               =        156;
  1679.   blr_find_dbkey_version         =        157;
  1680.   blr_ansi_all                   =        158;
  1681.  
  1682.   blr_extract                    = 159;
  1683.  
  1684.   (* sub parameters for blr_extract *)
  1685.  
  1686.   blr_extract_year               = 0;
  1687.   blr_extract_month              = 1;
  1688.   blr_extract_day             = 2;
  1689.   blr_extract_hour               = 3;
  1690.   blr_extract_minute             = 4;
  1691.   blr_extract_second             = 5;
  1692.   blr_extract_weekday            = 6;
  1693.   blr_extract_yearday            = 7;
  1694.  
  1695.   blr_current_date               = 160;
  1696.   blr_current_timestamp          = 161;
  1697.   blr_current_time               = 162;
  1698.  
  1699.   (* These verbs were added in 6.0,
  1700.   primarily to support 64-bit integers *)
  1701.  
  1702.   blr_add2                = 163;
  1703.   blr_subtract2                = 164;
  1704.   blr_multiply2             = 165;
  1705.   blr_divide2                = 166;
  1706.   blr_agg_total2            = 167;
  1707.   blr_agg_total_distinct2   = 168;
  1708.   blr_agg_average2          = 169;
  1709.   blr_agg_average_distinct2 = 170;
  1710.   blr_average2            = 171;
  1711.   blr_gen_id2            = 172;
  1712.   blr_set_generator2        = 173;
  1713.  
  1714. (************************************)
  1715. (** Database parameter block stuff **)
  1716. (************************************)
  1717.  
  1718.   isc_dpb_version1               =          1;
  1719.   isc_dpb_cdd_pathname           =          1;
  1720.   isc_dpb_allocation             =          2;
  1721.   isc_dpb_journal                =          3;
  1722.   isc_dpb_page_size              =          4;
  1723.   isc_dpb_num_buffers            =          5;
  1724.   isc_dpb_buffer_length          =          6;
  1725.   isc_dpb_debug                  =          7;
  1726.   isc_dpb_garbage_collect        =          8;
  1727.   isc_dpb_verify                 =          9;
  1728.   isc_dpb_sweep                  =         10;
  1729.   isc_dpb_enable_journal         =         11;
  1730.   isc_dpb_disable_journal        =         12;
  1731.   isc_dpb_dbkey_scope            =         13;
  1732.   isc_dpb_number_of_users        =         14;
  1733.   isc_dpb_trace                  =         15;
  1734.   isc_dpb_no_garbage_collect     =         16;
  1735.   isc_dpb_damaged                =         17;
  1736.   isc_dpb_license                =         18;
  1737.   isc_dpb_sys_user_name          =         19;
  1738.   isc_dpb_encrypt_key            =         20;
  1739.   isc_dpb_activate_shadow        =         21;
  1740.   isc_dpb_sweep_interval         =         22;
  1741.   isc_dpb_delete_shadow          =         23;
  1742.   isc_dpb_force_write            =         24;
  1743.   isc_dpb_begin_log              =         25;
  1744.   isc_dpb_quit_log               =         26;
  1745.   isc_dpb_no_reserve             =         27;
  1746.   isc_dpb_user_name              =         28;
  1747.   isc_dpb_password               =         29;
  1748.   isc_dpb_password_enc           =         30;
  1749.   isc_dpb_sys_user_name_enc      =         31;
  1750.   isc_dpb_interp                 =         32;
  1751.   isc_dpb_online_dump            =         33;
  1752.   isc_dpb_old_file_size          =         34;
  1753.   isc_dpb_old_num_files          =         35;
  1754.   isc_dpb_old_file               =         36;
  1755.   isc_dpb_old_start_page         =         37;
  1756.   isc_dpb_old_start_seqno        =         38;
  1757.   isc_dpb_old_start_file         =         39;
  1758.   isc_dpb_drop_walfile           =         40;
  1759.   isc_dpb_old_dump_id            =         41;
  1760.   isc_dpb_wal_backup_dir         =         42;
  1761.   isc_dpb_wal_chkptlen           =         43;
  1762.   isc_dpb_wal_numbufs            =         44;
  1763.   isc_dpb_wal_bufsize            =         45;
  1764.   isc_dpb_wal_grp_cmt_wait       =         46;
  1765.   isc_dpb_lc_messages            =         47;
  1766.   isc_dpb_lc_ctype               =         48;
  1767.   isc_dpb_cache_manager          =         49;
  1768.   isc_dpb_shutdown               =         50;
  1769.   isc_dpb_online                 =         51;
  1770.   isc_dpb_shutdown_delay         =         52;
  1771.   isc_dpb_reserved               =         53;
  1772.   isc_dpb_overwrite              =         54;
  1773.   isc_dpb_sec_attach             =         55;
  1774.   isc_dpb_disable_wal            =         56;
  1775.   isc_dpb_connect_timeout        =         57;
  1776.   isc_dpb_dummy_packet_interval  =         58;
  1777.   isc_dpb_gbak_attach            =         59;
  1778.   isc_dpb_sql_role_name          =         60;
  1779.   isc_dpb_set_page_buffers       =         61;
  1780.   isc_dpb_working_directory      =         62;
  1781.   isc_dpb_SQL_dialect            =         63;
  1782.   isc_dpb_set_db_readonly        =         64;
  1783.   isc_dpb_set_db_SQL_dialect     =         65;
  1784.   isc_dpb_gfix_attach         =         66;
  1785.   isc_dpb_gstat_attach         =         67;
  1786.   isc_dpb_last_dpb_constant      =         isc_dpb_gstat_attach;
  1787.  
  1788.  
  1789. (***********************************)
  1790. (** isc_dpb_verify specific flags **)
  1791. (***********************************)
  1792.  
  1793.   isc_dpb_pages                  =          1;
  1794.   isc_dpb_records                =          2;
  1795.   isc_dpb_indices                =          4;
  1796.   isc_dpb_transactions           =          8;
  1797.   isc_dpb_no_update              =         16;
  1798.   isc_dpb_repair                 =         32;
  1799.   isc_dpb_ignore                 =         64;
  1800.  
  1801. (*************************************)
  1802. (** isc_dpb_shutdown specific flags **)
  1803. (*************************************)
  1804.  
  1805.   isc_dpb_shut_cache             =          1;
  1806.   isc_dpb_shut_attachment        =          2;
  1807.   isc_dpb_shut_transaction       =          4;
  1808.   isc_dpb_shut_force             =          8;
  1809.  
  1810. (****************************************)
  1811. (** Bit assignments in RDB$SYSTEM_FLAG **)
  1812. (****************************************)
  1813.  
  1814.   RDB_system                     =          1;
  1815.   RDB_id_assigned                =          2;
  1816.  
  1817.  
  1818. (***************************************)
  1819. (** Transaction parameter block stuff **)
  1820. (***************************************)
  1821.  
  1822.   isc_tpb_version1               =          1;
  1823.   isc_tpb_version3               =          3;
  1824.   isc_tpb_consistency            =          1;
  1825.   isc_tpb_concurrency            =          2;
  1826.   isc_tpb_shared                 =          3;
  1827.   isc_tpb_protected              =          4;
  1828.   isc_tpb_exclusive              =          5;
  1829.   isc_tpb_wait                   =          6;
  1830.   isc_tpb_nowait                 =          7;
  1831.   isc_tpb_read                   =          8;
  1832.   isc_tpb_write                  =          9;
  1833.   isc_tpb_lock_read              =         10;
  1834.   isc_tpb_lock_write             =         11;
  1835.   isc_tpb_verb_time              =         12;
  1836.   isc_tpb_commit_time            =         13;
  1837.   isc_tpb_ignore_limbo           =         14;
  1838.   isc_tpb_read_committed         =         15;
  1839.   isc_tpb_autocommit             =         16;
  1840.   isc_tpb_rec_version            =         17;
  1841.   isc_tpb_no_rec_version         =         18;
  1842.   isc_tpb_restart_requests       =         19;
  1843.   isc_tpb_no_auto_undo           =         20;
  1844.   isc_tpb_last_tpb_constant      =         isc_tpb_no_auto_undo;
  1845.  
  1846.  
  1847. (**************************)
  1848. (** Blob Parameter Block **)
  1849. (**************************)
  1850.  
  1851.   isc_bpb_version1               =          1;
  1852.   isc_bpb_source_type            =          1;
  1853.   isc_bpb_target_type            =          2;
  1854.   isc_bpb_type                   =          3;
  1855.   isc_bpb_source_interp          =          4;
  1856.   isc_bpb_target_interp          =          5;
  1857.   isc_bpb_filter_parameter       =          6;
  1858.  
  1859.   isc_bpb_type_segmented         =          0;
  1860.   isc_bpb_type_stream            =          1;
  1861.  
  1862.  
  1863. (***********************************)
  1864. (** Service parameter block stuff **)
  1865. (***********************************)
  1866.  
  1867.   isc_spb_user_name              =          1;
  1868.   isc_spb_sys_user_name          =          2;
  1869.   isc_spb_sys_user_name_enc      =          3;
  1870.   isc_spb_password               =          4;
  1871.   isc_spb_password_enc           =          5;
  1872.   isc_spb_command_line           =          6;
  1873.   isc_spb_dbname                 =          7;
  1874.   isc_spb_verbose                =          8;
  1875.   isc_spb_options                =          9;
  1876.   isc_spb_connect_timeout        =          10;
  1877.   isc_spb_dummy_packet_interval  =          11;
  1878.   isc_spb_sql_role_name          =          12;
  1879.   isc_spb_last_spb_constant      =          isc_spb_sql_role_name;
  1880.  
  1881.   isc_spb_version1                                = 1;
  1882.   isc_spb_current_version                         = 2;
  1883.   isc_spb_version                          = isc_spb_current_version;
  1884.   isc_spb_user_name_mapped_to_server              = isc_dpb_user_name;
  1885.   isc_spb_sys_user_name_mapped_to_server          = isc_dpb_sys_user_name;
  1886.   isc_spb_sys_user_name_enc_mapped_to_server      = isc_dpb_sys_user_name_enc;
  1887.   isc_spb_password_mapped_to_server               = isc_dpb_password;
  1888.   isc_spb_password_enc_mapped_to_server           = isc_dpb_password_enc;
  1889.   isc_spb_command_line_mapped_to_server           = 105;
  1890.   isc_spb_dbname_mapped_to_server                 = 106;
  1891.   isc_spb_verbose_mapped_to_server                = 107;
  1892.   isc_spb_options_mapped_to_server                = 108;
  1893.   isc_spb_connect_timeout_mapped_to_server        = isc_dpb_connect_timeout;
  1894.   isc_spb_dummy_packet_interval_mapped_to_server  = isc_dpb_dummy_packet_interval;
  1895.   isc_spb_sql_role_name_mapped_to_server          = isc_dpb_sql_role_name;
  1896.  
  1897. (***********************************)
  1898. (** Information call declarations **)
  1899. (***********************************)
  1900.  
  1901. (******************************)
  1902. (** Common, structural codes **)
  1903. (******************************)
  1904.  
  1905.   isc_info_end                   =          1;
  1906.   isc_info_truncated             =          2;
  1907.   isc_info_error                 =          3;
  1908.   isc_info_data_not_ready     =          4;
  1909.   isc_info_flag_end         =          127;
  1910.  
  1911. (********************************)
  1912. (** Database information items **)
  1913. (********************************)
  1914.  
  1915.   isc_info_db_id                 =          4;
  1916.   isc_info_reads                 =          5;
  1917.   isc_info_writes                =          6;
  1918.   isc_info_fetches               =          7;
  1919.   isc_info_marks                 =          8;
  1920.   isc_info_implementation        =         11;
  1921.   isc_info_version               =         12;
  1922.   isc_info_base_level            =         13;
  1923.   isc_info_page_size             =         14;
  1924.   isc_info_num_buffers           =         15;
  1925.   isc_info_limbo                 =         16;
  1926.   isc_info_current_memory        =         17;
  1927.   isc_info_max_memory            =         18;
  1928.   isc_info_window_turns          =         19;
  1929.   isc_info_license               =         20;
  1930.   isc_info_allocation            =         21;
  1931.   isc_info_attachment_id         =         22;
  1932.   isc_info_read_seq_count        =         23;
  1933.   isc_info_read_idx_count        =         24;
  1934.   isc_info_insert_count          =         25;
  1935.   isc_info_update_count          =         26;
  1936.   isc_info_delete_count          =         27;
  1937.   isc_info_backout_count         =         28;
  1938.   isc_info_purge_count           =         29;
  1939.   isc_info_expunge_count         =         30;
  1940.   isc_info_sweep_interval        =         31;
  1941.   isc_info_ods_version           =         32;
  1942.   isc_info_ods_minor_version     =         33;
  1943.   isc_info_no_reserve            =         34;
  1944.   isc_info_logfile               =         35;
  1945.   isc_info_cur_logfile_name      =         36;
  1946.   isc_info_cur_log_part_offset   =         37;
  1947.   isc_info_num_wal_buffers       =         38;
  1948.   isc_info_wal_buffer_size       =         39;
  1949.   isc_info_wal_ckpt_length       =         40;
  1950.   isc_info_wal_cur_ckpt_interval =         41;
  1951.   isc_info_wal_prv_ckpt_fname    =         42;
  1952.   isc_info_wal_prv_ckpt_poffset  =         43;
  1953.   isc_info_wal_recv_ckpt_fname   =         44;
  1954.   isc_info_wal_recv_ckpt_poffset =         45;
  1955.   isc_info_wal_grpc_wait_usecs   =         47;
  1956.   isc_info_wal_num_io            =         48;
  1957.   isc_info_wal_avg_io_size       =         49;
  1958.   isc_info_wal_num_commits       =         50;
  1959.   isc_info_wal_avg_grpc_size     =         51;
  1960.   isc_info_forced_writes         =         52;
  1961.   isc_info_user_names            =         53;
  1962.   isc_info_page_errors           =         54;
  1963.   isc_info_record_errors         =         55;
  1964.   isc_info_bpage_errors          =         56;
  1965.   isc_info_dpage_errors          =         57;
  1966.   isc_info_ipage_errors          =         58;
  1967.   isc_info_ppage_errors          =         59;
  1968.   isc_info_tpage_errors          =         60;
  1969.   isc_info_set_page_buffers      =         61;
  1970.   isc_info_db_SQL_dialect        =         62;
  1971.   isc_info_db_read_only          =         63;
  1972.   isc_info_db_size_in_pages      =         64;
  1973.  
  1974. (****************************************)
  1975. (** Database information return values **)
  1976. (****************************************)
  1977.  
  1978.   isc_info_db_impl_rdb_vms       =          1;
  1979.   isc_info_db_impl_rdb_eln       =          2;
  1980.   isc_info_db_impl_rdb_eln_dev   =          3;
  1981.   isc_info_db_impl_rdb_vms_y     =          4;
  1982.   isc_info_db_impl_rdb_eln_y     =          5;
  1983.   isc_info_db_impl_jri           =          6;
  1984.   isc_info_db_impl_jsv           =          7;
  1985.   isc_info_db_impl_isc_a         =         25;
  1986.   isc_info_db_impl_isc_u         =         26;
  1987.   isc_info_db_impl_isc_v         =         27;
  1988.   isc_info_db_impl_isc_s         =         28;
  1989.   isc_info_db_impl_isc_apl_68K   =         25;
  1990.   isc_info_db_impl_isc_vax_ultr  =         26;
  1991.   isc_info_db_impl_isc_vms       =         27;
  1992.   isc_info_db_impl_isc_sun_68k   =         28;
  1993.   isc_info_db_impl_isc_os2       =         29;
  1994.   isc_info_db_impl_isc_sun4      =         30;
  1995.   isc_info_db_impl_isc_hp_ux     =         31;
  1996.   isc_info_db_impl_isc_sun_386i  =         32;
  1997.   isc_info_db_impl_isc_vms_orcl  =         33;
  1998.   isc_info_db_impl_isc_mac_aux   =         34;
  1999.   isc_info_db_impl_isc_rt_aix    =         35;
  2000.   isc_info_db_impl_isc_mips_ult  =         36;
  2001.   isc_info_db_impl_isc_xenix     =         37;
  2002.   isc_info_db_impl_isc_dg        =         38;
  2003.   isc_info_db_impl_isc_hp_mpexl  =         39;
  2004.   isc_info_db_impl_isc_hp_ux68K  =         40;
  2005.   isc_info_db_impl_isc_sgi       =         41;
  2006.   isc_info_db_impl_isc_sco_unix  =         42;
  2007.   isc_info_db_impl_isc_cray      =         43;
  2008.   isc_info_db_impl_isc_imp       =         44;
  2009.   isc_info_db_impl_isc_delta     =         45;
  2010.   isc_info_db_impl_isc_next      =         46;
  2011.   isc_info_db_impl_isc_dos       =         47;
  2012.   isc_info_db_impl_isc_winnt     =         48;
  2013.   isc_info_db_impl_isc_epson     =         49;
  2014.  
  2015.   isc_info_db_class_access       =          1;
  2016.   isc_info_db_class_y_valve      =          2;
  2017.   isc_info_db_class_rem_int      =          3;
  2018.   isc_info_db_class_rem_srvr     =          4;
  2019.   isc_info_db_class_pipe_int     =          7;
  2020.   isc_info_db_class_pipe_srvr    =          8;
  2021.   isc_info_db_class_sam_int      =          9;
  2022.   isc_info_db_class_sam_srvr     =         10;
  2023.   isc_info_db_class_gateway      =         11;
  2024.   isc_info_db_class_cache        =         12;
  2025.  
  2026. (*******************************)
  2027. (** Request information items **)
  2028. (*******************************)
  2029.  
  2030.   isc_info_number_messages       =          4;
  2031.   isc_info_max_message           =          5;
  2032.   isc_info_max_send              =          6;
  2033.   isc_info_max_receive           =          7;
  2034.   isc_info_state                 =          8;
  2035.   isc_info_message_number        =          9;
  2036.   isc_info_message_size          =         10;
  2037.   isc_info_request_cost          =         11;
  2038.   isc_info_access_path           =         12;
  2039.   isc_info_req_select_count      =         13;
  2040.   isc_info_req_insert_count      =         14;
  2041.   isc_info_req_update_count      =         15;
  2042.   isc_info_req_delete_count      =         16;
  2043.  
  2044.  
  2045. (***********************)
  2046. (** Access path items **)
  2047. (***********************)
  2048.  
  2049.   isc_info_rsb_end               =          0;
  2050.   isc_info_rsb_begin             =          1;
  2051.   isc_info_rsb_type              =          2;
  2052.   isc_info_rsb_relation          =          3;
  2053.   isc_info_rsb_plan              =          4;
  2054.  
  2055. (***************)
  2056. (** Rsb types **)
  2057. (***************)
  2058.  
  2059.   isc_info_rsb_unknown           =          1;
  2060.   isc_info_rsb_indexed           =          2;
  2061.   isc_info_rsb_navigate          =          3;
  2062.   isc_info_rsb_sequential        =          4;
  2063.   isc_info_rsb_cross             =          5;
  2064.   isc_info_rsb_sort              =          6;
  2065.   isc_info_rsb_first             =          7;
  2066.   isc_info_rsb_boolean           =          8;
  2067.   isc_info_rsb_union             =          9;
  2068.   isc_info_rsb_aggregate         =         10;
  2069.   isc_info_rsb_merge             =         11;
  2070.   isc_info_rsb_ext_sequential    =         12;
  2071.   isc_info_rsb_ext_indexed       =         13;
  2072.   isc_info_rsb_ext_dbkey         =         14;
  2073.   isc_info_rsb_left_cross        =         15;
  2074.   isc_info_rsb_select            =         16;
  2075.   isc_info_rsb_sql_join          =         17;
  2076.   isc_info_rsb_simulate          =         18;
  2077.   isc_info_rsb_sim_cross         =         19;
  2078.   isc_info_rsb_once              =         20;
  2079.   isc_info_rsb_procedure         =         21;
  2080.  
  2081. (************************)
  2082. (** Bitmap expressions **)
  2083. (************************)
  2084.  
  2085.   isc_info_rsb_and               =          1;
  2086.   isc_info_rsb_or                =          2;
  2087.   isc_info_rsb_dbkey             =          3;
  2088.   isc_info_rsb_index             =          4;
  2089.  
  2090.   isc_info_req_active            =          2;
  2091.   isc_info_req_inactive          =          3;
  2092.   isc_info_req_send              =          4;
  2093.   isc_info_req_receive           =          5;
  2094.   isc_info_req_select            =          6;
  2095.   isc_info_req_sql_stall         =          7;
  2096.  
  2097. (****************************)
  2098. (** Blob information items **)
  2099. (****************************)
  2100.  
  2101.   isc_info_blob_num_segments     =          4;
  2102.   isc_info_blob_max_segment      =          5;
  2103.   isc_info_blob_total_length     =          6;
  2104.   isc_info_blob_type             =          7;
  2105.  
  2106. (***********************************)
  2107. (** Transaction information items **)
  2108. (***********************************)
  2109.  
  2110.   isc_info_tra_id                =          4;
  2111.  
  2112. (*******************************)
  2113. (** Service information items **)
  2114. (*******************************)
  2115.  
  2116.  
  2117.  
  2118.  
  2119.  
  2120.  
  2121.  
  2122.  
  2123.  
  2124.  
  2125.  
  2126.  
  2127.  
  2128.  
  2129.  
  2130.  
  2131.  
  2132.  
  2133.  
  2134.  
  2135.  
  2136.  
  2137.  
  2138.  
  2139.  
  2140.  
  2141. (*****************************************)
  2142. (* Service action items                 **)
  2143. (*****************************************)
  2144.  
  2145.   isc_action_svc_backup         = 1; (* Starts database backup process on the server *)
  2146.   isc_action_svc_restore        = 2; (* Starts database restore process on the server *)
  2147.   isc_action_svc_repair         = 3; (* Starts database repair process on the server *)
  2148.   isc_action_svc_add_user       = 4; (* Adds a new user to the security database *)
  2149.   isc_action_svc_delete_user    = 5; (* Deletes a user record from the security database *)
  2150.   isc_action_svc_modify_user    = 6; (* Modifies a user record in the security database *)
  2151.   isc_action_svc_display_user   = 7; (* Displays a user record from the security database *)
  2152.   isc_action_svc_properties     = 8; (* Sets database properties *)
  2153.   isc_action_svc_add_license    = 9; (* Adds a license to the license file *)
  2154.   isc_action_svc_remove_license = 10; (* Removes a license from the license file *)
  2155.   isc_action_svc_db_stats    = 11; (* Retrieves database statistics *)
  2156.   isc_action_svc_get_ib_log     = 12; (* Retrieves the InterBase log file from the server *)
  2157.  
  2158. (*****************************************)
  2159. (** Service information items           **)
  2160. (*****************************************)
  2161.  
  2162.   isc_info_svc_svr_db_info      = 50; (* Retrieves the number of attachments and databases *)
  2163.   isc_info_svc_get_license      = 51; (* Retrieves all license keys and IDs from the license file *)
  2164.   isc_info_svc_get_license_mask = 52; (* Retrieves a bitmask representing licensed options on the server *)
  2165.   isc_info_svc_get_config       = 53; (* Retrieves the parameters and values for IB_CONFIG *)
  2166.   isc_info_svc_version          = 54; (* Retrieves the version of the services manager *)
  2167.   isc_info_svc_server_version   = 55;(* Retrieves the version of the InterBase server *)
  2168.   isc_info_svc_implementation   = 56; (* Retrieves the implementation of the InterBase server *)
  2169.   isc_info_svc_capabilities     = 57; (* Retrieves a bitmask representing the server's capabilities *)
  2170.   isc_info_svc_user_dbpath      = 58; (* Retrieves the path to the security database in use by the server *)
  2171.   isc_info_svc_get_env            = 59; (* Retrieves the setting of $INTERBASE *)
  2172.   isc_info_svc_get_env_lock     = 60; (* Retrieves the setting of $INTERBASE_LCK *)
  2173.   isc_info_svc_get_env_msg      = 61; (* Retrieves the setting of $INTERBASE_MSG *)
  2174.   isc_info_svc_line             = 62; (* Retrieves 1 line of service output per call *)
  2175.   isc_info_svc_to_eof           = 63; (* Retrieves as much of the server output as will fit in the supplied buffer *)
  2176.   isc_info_svc_timeout          = 64; (* Sets / signifies a timeout value for reading service information *)
  2177.   isc_info_svc_get_licensed_users = 65; (* Retrieves the number of users licensed for accessing the server *)
  2178.   isc_info_svc_limbo_trans    = 66; (* Retrieve the limbo transactions *)
  2179.   isc_info_svc_running        = 67; (* Checks to see if a service is running on an attachment *)
  2180.   isc_info_svc_get_users    = 68; (* Returns the user information from isc_action_svc_display_users *)
  2181.  
  2182. (*****************************************)
  2183. (* Parameters for isc_action_{add|delete|modify)_user *)
  2184. (*****************************************)
  2185.  
  2186.   isc_spb_sec_userid            = 5;
  2187.   isc_spb_sec_groupid           = 6;
  2188.   isc_spb_sec_username          = 7;
  2189.   isc_spb_sec_password          = 8;
  2190.   isc_spb_sec_groupname         = 9;
  2191.   isc_spb_sec_firstname         = 10;
  2192.   isc_spb_sec_middlename        = 11;
  2193.   isc_spb_sec_lastname          = 12;
  2194.  
  2195. (*****************************************)
  2196. (* Parameters for isc_action_svc_(add|remove)_license, *)
  2197. (* isc_info_svc_get_license                            *)
  2198. (*****************************************)
  2199.  
  2200.   isc_spb_lic_key               = 5;
  2201.   isc_spb_lic_id                = 6;
  2202.  
  2203.  
  2204. (*****************************************)
  2205. (* Parameters for isc_action_svc_backup  *)
  2206. (*****************************************)
  2207.  
  2208.   isc_spb_bkp_file               = 5;
  2209.   isc_spb_bkp_factor             = 6;
  2210.   isc_spb_bkp_length             = 7;
  2211.   isc_spb_bkp_ignore_checksums   = $01;
  2212.   isc_spb_bkp_ignore_limbo       = $02;
  2213.   isc_spb_bkp_metadata_only      = $04;
  2214.   isc_spb_bkp_no_garbage_collect = $08;
  2215.   isc_spb_bkp_old_descriptions   = $10;
  2216.   isc_spb_bkp_non_transportable  = $20;
  2217.   isc_spb_bkp_convert            = $40;
  2218.  
  2219. (*****************************************)
  2220. (* Parameters for isc_action_svc_lock_stats *)
  2221. (*****************************************)
  2222.  
  2223.   isc_spb_lck_sample          = 5;
  2224.   isc_spb_lck_secs          = 6;
  2225.   isc_spb_lck_contents          = $01;
  2226.   isc_spb_lck_summary          = $02;
  2227.   isc_spb_lck_wait          = $04;
  2228.   isc_spb_lck_stats          = $08;
  2229.  
  2230. (*****************************************)
  2231. (* Parameters for isc_action_svc_properties *)
  2232. (*****************************************)
  2233.  
  2234.   isc_spb_prp_page_buffers          = 5;
  2235.   isc_spb_prp_sweep_interval          = 6;
  2236.   isc_spb_prp_shutdown_db          =    7;
  2237.   isc_spb_prp_deny_new_attachments    = 9;
  2238.   isc_spb_prp_deny_new_transactions   = 10;
  2239.   isc_spb_prp_reserve_space          = 11;
  2240.   isc_spb_prp_write_mode          =    12;
  2241.   isc_spb_prp_access_mode          =    13;
  2242.   isc_spb_prp_set_sql_dialect          = 14;
  2243.   isc_spb_prp_activate              = $0100;
  2244.   isc_spb_prp_db_online              = $0200;
  2245.  
  2246. (*****************************************)
  2247. (* Parameters for isc_spb_prp_reserve_space *)
  2248. (*****************************************)
  2249.  
  2250.   isc_spb_prp_res_use_full          = 35;
  2251.   isc_spb_prp_res              =    36;
  2252.  
  2253. (*****************************************)
  2254. (* Parameters for isc_spb_prp_write_mode  *)
  2255. (*****************************************)
  2256.  
  2257.   isc_spb_prp_wm_async        = 37;
  2258.   isc_spb_prp_wm_sync        = 38;
  2259.  
  2260. (*****************************************)
  2261. (* Parameters for isc_spb_prp_access_mode *)
  2262. (*****************************************)
  2263.  
  2264.   isc_spb_prp_am_readonly    = 39;
  2265.   isc_spb_prp_am_readwrite    = 40;
  2266.  
  2267. (*****************************************)
  2268. (* Parameters for isc_action_svc_repair  *)
  2269. (*****************************************)
  2270.  
  2271.   isc_spb_rpr_commit_trans           = 15;
  2272.   isc_spb_rpr_rollback_trans           = 34;
  2273.   isc_spb_rpr_recover_two_phase           = 17;
  2274.   isc_spb_tra_id                       = 18;
  2275.   isc_spb_single_tra_id               = 19;
  2276.   isc_spb_multi_tra_id               = 20;
  2277.   isc_spb_tra_state               = 21;
  2278.   isc_spb_tra_state_limbo           = 22;
  2279.   isc_spb_tra_state_commit           = 23;
  2280.   isc_spb_tra_state_rollback           = 24;
  2281.   isc_spb_tra_state_unknown           = 25;
  2282.   isc_spb_tra_host_site               = 26;
  2283.   isc_spb_tra_remote_site           = 27;
  2284.   isc_spb_tra_db_path               = 28;
  2285.   isc_spb_tra_advise               = 29;
  2286.   isc_spb_tra_advise_commit           = 30;
  2287.   isc_spb_tra_advise_rollback           = 31;
  2288.   isc_spb_tra_advise_unknown           = 33;
  2289.   isc_spb_rpr_list_limbo_trans           = $01;
  2290.   isc_spb_rpr_check_db               = $02;
  2291.   isc_spb_rpr_ignore_checksum           = $04;
  2292.   isc_spb_rpr_kill_shadows           = $08;
  2293.   isc_spb_rpr_mend_db               = $10;
  2294.   isc_spb_rpr_sweep_db               = $20;
  2295.   isc_spb_rpr_validate_db           = $40;
  2296.   isc_spb_rpr_full               = $80;
  2297.  
  2298. (*****************************************)
  2299. (* Parameters for isc_action_svc_restore  *)
  2300. (*****************************************)
  2301.  
  2302.   isc_spb_res_buffers               = 9;
  2303.   isc_spb_res_page_size               = 10;
  2304.   isc_spb_res_length               = 11;
  2305.   isc_spb_res_access_mode           = 12;
  2306.   isc_spb_res_deactivate_idx           = $0100;
  2307.   isc_spb_res_no_shadow               = $0200;
  2308.   isc_spb_res_no_validity           = $0400;
  2309.   isc_spb_res_one_ata_time           = $0800;
  2310.   isc_spb_res_replace               = $1000;
  2311.   isc_spb_res_create               = $2000;
  2312.   isc_spb_res_use_all_space           = $4000;
  2313.  
  2314. (*****************************************)
  2315. (* Parameters for isc_spb_res_access_mode  *)
  2316. (*****************************************)
  2317.  
  2318.   isc_spb_res_am_readonly        = isc_spb_prp_am_readonly;
  2319.   isc_spb_res_am_readwrite        = isc_spb_prp_am_readwrite;
  2320.  
  2321. (*****************************************)
  2322. (* Parameters for isc_info_svc_svr_db_info *)
  2323. (*****************************************)
  2324.  
  2325.   isc_spb_num_att               = 5;
  2326.   isc_spb_num_db                = 6;
  2327.  
  2328. (*****************************************)
  2329. (* Parameters for isc_info_svc_db_stats  *)
  2330. (*****************************************)
  2331.  
  2332.   isc_spb_sts_data_pages    = $01;
  2333.   isc_spb_sts_db_log        = $02;
  2334.   isc_spb_sts_hdr_pages        = $04;
  2335.   isc_spb_sts_idx_pages        = $08;
  2336.   isc_spb_sts_sys_relations    = $10;
  2337.  
  2338.  
  2339. (***************************)
  2340. (** SQL information items **)
  2341. (***************************)
  2342.  
  2343.   isc_info_sql_select            =          4;
  2344.   isc_info_sql_bind              =          5;
  2345.   isc_info_sql_num_variables     =          6;
  2346.   isc_info_sql_describe_vars     =          7;
  2347.   isc_info_sql_describe_end      =          8;
  2348.   isc_info_sql_sqlda_seq         =          9;
  2349.   isc_info_sql_message_seq       =         10;
  2350.   isc_info_sql_type              =         11;
  2351.   isc_info_sql_sub_type          =         12;
  2352.   isc_info_sql_scale             =         13;
  2353.   isc_info_sql_length            =         14;
  2354.   isc_info_sql_null_ind          =         15;
  2355.   isc_info_sql_field             =         16;
  2356.   isc_info_sql_relation          =         17;
  2357.   isc_info_sql_owner             =         18;
  2358.   isc_info_sql_alias             =         19;
  2359.   isc_info_sql_sqlda_start       =         20;
  2360.   isc_info_sql_stmt_type         =         21;
  2361.   isc_info_sql_get_plan          =         22;
  2362.   isc_info_sql_records           =         23;
  2363.   isc_info_sql_batch_fetch       =         24;
  2364.  
  2365. (***********************************)
  2366. (** SQL information return values **)
  2367. (***********************************)
  2368.  
  2369.   isc_info_sql_stmt_select           =          1;
  2370.   isc_info_sql_stmt_insert           =          2;
  2371.   isc_info_sql_stmt_update           =          3;
  2372.   isc_info_sql_stmt_delete           =          4;
  2373.   isc_info_sql_stmt_ddl              =          5;
  2374.   isc_info_sql_stmt_get_segment      =          6;
  2375.   isc_info_sql_stmt_put_segment      =          7;
  2376.   isc_info_sql_stmt_exec_procedure   =          8;
  2377.   isc_info_sql_stmt_start_trans      =          9;
  2378.   isc_info_sql_stmt_commit           =         10;
  2379.   isc_info_sql_stmt_rollback         =         11;
  2380.   isc_info_sql_stmt_select_for_upd   =         12;
  2381.   isc_info_sql_stmt_set_generator    =         13;
  2382.  
  2383.  
  2384. (*************************************)
  2385. (** Server configuration key values **)
  2386. (*************************************)
  2387.  
  2388.   ISCCFG_LOCKMEM_KEY             =          0;
  2389.   ISCCFG_LOCKSEM_KEY             =          1;
  2390.   ISCCFG_LOCKSIG_KEY             =          2;
  2391.   ISCCFG_EVNTMEM_KEY             =          3;
  2392.   ISCCFG_DBCACHE_KEY             =          4;
  2393.   ISCCFG_PRIORITY_KEY            =          5;
  2394.   ISCCFG_IPCMAP_KEY              =          6;
  2395.   ISCCFG_MEMMIN_KEY              =          7;
  2396.   ISCCFG_MEMMAX_KEY              =          8;
  2397.   ISCCFG_LOCKORDER_KEY           =          9;
  2398.   ISCCFG_ANYLOCKMEM_KEY          =         10;
  2399.   ISCCFG_ANYLOCKSEM_KEY          =         11;
  2400.   ISCCFG_ANYLOCKSIG_KEY          =         12;
  2401.   ISCCFG_ANYEVNTMEM_KEY          =         13;
  2402.   ISCCFG_LOCKHASH_KEY            =         14;
  2403.   ISCCFG_DEADLOCK_KEY            =         15;
  2404.   ISCCFG_LOCKSPIN_KEY            =         16;
  2405.   ISCCFG_CONN_TIMEOUT_KEY        =         17;
  2406.   ISCCFG_DUMMY_INTRVL_KEY        =         18;
  2407.  
  2408.  
  2409. (*****************)
  2410. (** Error codes **)
  2411. (*****************)
  2412.  
  2413.   isc_facility                   =         20;
  2414.   isc_err_base                   =  335544320;
  2415.   isc_err_factor                 =          1;
  2416.   isc_arg_end                    =          0;
  2417.   isc_arg_gds                    =          1;
  2418.   isc_arg_string                 =          2;
  2419.   isc_arg_cstring                =          3;
  2420.   isc_arg_number                 =          4;
  2421.   isc_arg_interpreted            =          5;
  2422.   isc_arg_vms                    =          6;
  2423.   isc_arg_unix                   =          7;
  2424.   isc_arg_domain                 =          8;
  2425.   isc_arg_dos                    =          9;
  2426.   isc_arg_mpexl                  =         10;
  2427.   isc_arg_mpexl_ipc              =         11;
  2428.   isc_arg_next_mach              =         15;
  2429.   isc_arg_netware                =         16;
  2430.   isc_arg_win32                  =         17;
  2431.   isc_arg_warning                =         18;
  2432.  
  2433. (************************************************)
  2434. (** Dynamic Data Definition Language operators **)
  2435. (************************************************)
  2436.  
  2437. (********************)
  2438. (** Version number **)
  2439. (********************)
  2440.  
  2441.   isc_dyn_version_1              =          1;
  2442.   isc_dyn_eoc                    =         -1;
  2443.  
  2444. (********************************)
  2445. (** Operations (may be nested) **)
  2446. (********************************)
  2447.  
  2448.   isc_dyn_begin                  =          2;
  2449.   isc_dyn_end                    =          3;
  2450.   isc_dyn_if                     =          4;
  2451.   isc_dyn_def_database           =          5;
  2452.   isc_dyn_def_global_fld         =          6;
  2453.   isc_dyn_def_local_fld          =          7;
  2454.   isc_dyn_def_idx                =          8;
  2455.   isc_dyn_def_rel                =          9;
  2456.   isc_dyn_def_sql_fld            =         10;
  2457.   isc_dyn_def_view               =         12;
  2458.   isc_dyn_def_trigger            =         15;
  2459.   isc_dyn_def_security_class     =        120;
  2460.   isc_dyn_def_dimension          =        140;
  2461.   isc_dyn_def_generator          =         24;
  2462.   isc_dyn_def_function           =         25;
  2463.   isc_dyn_def_filter             =         26;
  2464.   isc_dyn_def_function_arg       =         27;
  2465.   isc_dyn_def_shadow             =         34;
  2466.   isc_dyn_def_trigger_msg        =         17;
  2467.   isc_dyn_def_file               =         36;
  2468.   isc_dyn_mod_database           =         39;
  2469.   isc_dyn_mod_rel                =         11;
  2470.   isc_dyn_mod_global_fld         =         13;
  2471.   isc_dyn_mod_idx                =        102;
  2472.   isc_dyn_mod_local_fld          =         14;
  2473.   isc_dyn_mod_sql_fld          =          216;
  2474.   isc_dyn_mod_view               =         16;
  2475.   isc_dyn_mod_security_class     =        122;
  2476.   isc_dyn_mod_trigger            =        113;
  2477.   isc_dyn_mod_trigger_msg        =         28;
  2478.   isc_dyn_delete_database        =         18;
  2479.   isc_dyn_delete_rel             =         19;
  2480.   isc_dyn_delete_global_fld      =         20;
  2481.   isc_dyn_delete_local_fld       =         21;
  2482.   isc_dyn_delete_idx             =         22;
  2483.   isc_dyn_delete_security_class  =        123;
  2484.   isc_dyn_delete_dimensions      =        143;
  2485.   isc_dyn_delete_trigger         =         23;
  2486.   isc_dyn_delete_trigger_msg     =         29;
  2487.   isc_dyn_delete_filter          =         32;
  2488.   isc_dyn_delete_function        =         33;
  2489.   isc_dyn_delete_shadow          =         35;
  2490.   isc_dyn_grant                  =         30;
  2491.   isc_dyn_revoke                 =         31;
  2492.   isc_dyn_def_primary_key        =         37;
  2493.   isc_dyn_def_foreign_key        =         38;
  2494.   isc_dyn_def_unique             =         40;
  2495.   isc_dyn_def_procedure          =        164;
  2496.   isc_dyn_delete_procedure       =        165;
  2497.   isc_dyn_def_parameter          =        135;
  2498.   isc_dyn_delete_parameter       =        136;
  2499.   isc_dyn_mod_procedure          =        175;
  2500.   isc_dyn_def_log_file           =        176;
  2501.   isc_dyn_def_cache_file         =        180;
  2502.   isc_dyn_def_exception          =        181;
  2503.   isc_dyn_mod_exception          =        182;
  2504.   isc_dyn_del_exception          =        183;
  2505.   isc_dyn_drop_log               =        194;
  2506.   isc_dyn_drop_cache             =        195;
  2507.   isc_dyn_def_default_log        =        202;
  2508.  
  2509. (*************************)
  2510. (** View specific stuff **)
  2511. (*************************)
  2512.  
  2513.   isc_dyn_view_blr               =         43;
  2514.   isc_dyn_view_source            =         44;
  2515.   isc_dyn_view_relation          =         45;
  2516.   isc_dyn_view_context           =         46;
  2517.   isc_dyn_view_context_name      =         47;
  2518.  
  2519. (************************)
  2520. (** Generic attributes **)
  2521. (************************)
  2522.  
  2523.   isc_dyn_rel_name               =         50;
  2524.   isc_dyn_fld_name               =         51;
  2525.   isc_dyn_new_fld_name           =        215;
  2526.   isc_dyn_idx_name               =         52;
  2527.   isc_dyn_description            =         53;
  2528.   isc_dyn_security_class         =         54;
  2529.   isc_dyn_system_flag            =         55;
  2530.   isc_dyn_update_flag            =         56;
  2531.   isc_dyn_prc_name               =        166;
  2532.   isc_dyn_prm_name               =        137;
  2533.   isc_dyn_sql_object             =        196;
  2534.   isc_dyn_fld_character_set_name =        174;
  2535.  
  2536. (**********************************)
  2537. (** Relation specific attributes **)
  2538. (**********************************)
  2539.  
  2540.   isc_dyn_rel_dbkey_length       =         61;
  2541.   isc_dyn_rel_store_trig         =         62;
  2542.   isc_dyn_rel_modify_trig        =         63;
  2543.   isc_dyn_rel_erase_trig         =         64;
  2544.   isc_dyn_rel_store_trig_source  =         65;
  2545.   isc_dyn_rel_modify_trig_source =         66;
  2546.   isc_dyn_rel_erase_trig_source  =         67;
  2547.   isc_dyn_rel_ext_file           =         68;
  2548.   isc_dyn_rel_sql_protection     =         69;
  2549.   isc_dyn_rel_constraint         =        162;
  2550.   isc_dyn_delete_rel_constraint  =        163;
  2551.  
  2552. (**************************************)
  2553. (** Global field specific attributes **)
  2554. (**************************************)
  2555.  
  2556.   isc_dyn_fld_type               =         70;
  2557.   isc_dyn_fld_length             =         71;
  2558.   isc_dyn_fld_scale              =         72;
  2559.   isc_dyn_fld_sub_type           =         73;
  2560.   isc_dyn_fld_segment_length     =         74;
  2561.   isc_dyn_fld_query_header       =         75;
  2562.   isc_dyn_fld_edit_string        =         76;
  2563.   isc_dyn_fld_validation_blr     =         77;
  2564.   isc_dyn_fld_validation_source  =         78;
  2565.   isc_dyn_fld_computed_blr       =         79;
  2566.   isc_dyn_fld_computed_source    =         80;
  2567.   isc_dyn_fld_missing_value      =         81;
  2568.   isc_dyn_fld_default_value      =         82;
  2569.   isc_dyn_fld_query_name         =         83;
  2570.   isc_dyn_fld_dimensions         =         84;
  2571.   isc_dyn_fld_not_null           =         85;
  2572.   isc_dyn_fld_precision          =         86;
  2573.   isc_dyn_fld_char_length        =        172;
  2574.   isc_dyn_fld_collation          =        173;
  2575.   isc_dyn_fld_default_source     =        193;
  2576.   isc_dyn_del_default            =        197;
  2577.   isc_dyn_del_validation         =        198;
  2578.   isc_dyn_single_validation      =        199;
  2579.   isc_dyn_fld_character_set      =        203;
  2580.  
  2581. (*************************************)
  2582. (** Local field specific attributes **)
  2583. (*************************************)
  2584.  
  2585.   isc_dyn_fld_source             =         90;
  2586.   isc_dyn_fld_base_fld           =         91;
  2587.   isc_dyn_fld_position           =         92;
  2588.   isc_dyn_fld_update_flag        =         93;
  2589.  
  2590. (*******************************)
  2591. (** Index specific attributes **)
  2592. (*******************************)
  2593.  
  2594.   isc_dyn_idx_unique             =        100;
  2595.   isc_dyn_idx_inactive           =        101;
  2596.   isc_dyn_idx_type               =        103;
  2597.   isc_dyn_idx_foreign_key        =        104;
  2598.   isc_dyn_idx_ref_column         =        105;
  2599.   isc_dyn_idx_statistic          =        204;
  2600.  
  2601. (*********************************)
  2602. (** Trigger specific attributes **)
  2603. (*********************************)
  2604.  
  2605.   isc_dyn_trg_type               =        110;
  2606.   isc_dyn_trg_blr                =        111;
  2607.   isc_dyn_trg_source             =        112;
  2608.   isc_dyn_trg_name               =        114;
  2609.   isc_dyn_trg_sequence           =        115;
  2610.   isc_dyn_trg_inactive           =        116;
  2611.   isc_dyn_trg_msg_number         =        117;
  2612.   isc_dyn_trg_msg                =        118;
  2613.  
  2614. (****************************************)
  2615. (** Security Class specific attributes **)
  2616. (****************************************)
  2617.  
  2618.   isc_dyn_scl_acl                =        121;
  2619.   isc_dyn_grant_user             =        130;
  2620.   isc_dyn_grant_proc             =        186;
  2621.   isc_dyn_grant_trig             =        187;
  2622.   isc_dyn_grant_view             =        188;
  2623.   isc_dyn_grant_options          =        132;
  2624.   isc_dyn_grant_user_group       =        205;
  2625.  
  2626. (************************************)
  2627. (** Dimension specific information **)
  2628. (************************************)
  2629.  
  2630.   isc_dyn_dim_lower              =        141;
  2631.   isc_dyn_dim_upper              =        142;
  2632.  
  2633. (******************************)
  2634. (** File specific attributes **)
  2635. (******************************)
  2636.  
  2637.   isc_dyn_file_name              =        125;
  2638.   isc_dyn_file_start             =        126;
  2639.   isc_dyn_file_length            =        127;
  2640.   isc_dyn_shadow_number          =        128;
  2641.   isc_dyn_shadow_man_auto        =        129;
  2642.   isc_dyn_shadow_conditional     =        130;
  2643.  
  2644. (**********************************)
  2645. (** Log file specific attributes **)
  2646. (**********************************)
  2647.  
  2648.   isc_dyn_log_file_sequence      =        177;
  2649.   isc_dyn_log_file_partitions    =        178;
  2650.   isc_dyn_log_file_serial        =        179;
  2651.   isc_dyn_log_file_overflow      =        200;
  2652.   isc_dyn_log_file_raw           =        201;
  2653.  
  2654. (*****************************)
  2655. (** Log specific attributes **)
  2656. (*****************************)
  2657.  
  2658.   isc_dyn_log_group_commit_wait  =        189;
  2659.   isc_dyn_log_buffer_size        =        190;
  2660.   isc_dyn_log_check_point_length =        191;
  2661.   isc_dyn_log_num_of_buffers     =        192;
  2662.  
  2663. (**********************************)
  2664. (** Function specific attributes **)
  2665. (**********************************)
  2666.  
  2667.   isc_dyn_function_name          =        145;
  2668.   isc_dyn_function_type          =        146;
  2669.   isc_dyn_func_module_name       =        147;
  2670.   isc_dyn_func_entry_point       =        148;
  2671.   isc_dyn_func_return_argument   =        149;
  2672.   isc_dyn_func_arg_position      =        150;
  2673.   isc_dyn_func_mechanism         =        151;
  2674.   isc_dyn_filter_in_subtype      =        152;
  2675.   isc_dyn_filter_out_subtype     =        153;
  2676.  
  2677.  
  2678.   isc_dyn_description2           =        154;
  2679.   isc_dyn_fld_computed_source2   =        155;
  2680.   isc_dyn_fld_edit_string2       =        156;
  2681.   isc_dyn_fld_query_header2      =        157;
  2682.   isc_dyn_fld_validation_source2 =        158;
  2683.   isc_dyn_trg_msg2               =        159;
  2684.   isc_dyn_trg_source2            =        160;
  2685.   isc_dyn_view_source2           =        161;
  2686.   isc_dyn_xcp_msg2               =        184;
  2687.  
  2688. (***********************************)
  2689. (** Generator specific attributes **)
  2690. (***********************************)
  2691.  
  2692.   isc_dyn_generator_name         =         95;
  2693.   isc_dyn_generator_id           =         96;
  2694.  
  2695. (***********************************)
  2696. (** Procedure specific attributes **)
  2697. (***********************************)
  2698.  
  2699.   isc_dyn_prc_inputs             =        167;
  2700.   isc_dyn_prc_outputs            =        168;
  2701.   isc_dyn_prc_source             =        169;
  2702.   isc_dyn_prc_blr                =        170;
  2703.   isc_dyn_prc_source2            =        171;
  2704.  
  2705. (***********************************)
  2706. (** Parameter specific attributes **)
  2707. (***********************************)
  2708.  
  2709.   isc_dyn_prm_number             =        138;
  2710.   isc_dyn_prm_type               =        139;
  2711.  
  2712. (**********************************)
  2713. (** Relation specific attributes **)
  2714. (**********************************)
  2715.  
  2716.   isc_dyn_xcp_msg                =        185;
  2717.  
  2718. (************************************************)
  2719. (** Cascading referential integrity values     **)
  2720. (************************************************)
  2721.   isc_dyn_foreign_key_update     =        205;
  2722.   isc_dyn_foreign_key_delete     =        206;
  2723.   isc_dyn_foreign_key_cascade    =        207;
  2724.   isc_dyn_foreign_key_default    =        208;
  2725.   isc_dyn_foreign_key_null       =        209;
  2726.   isc_dyn_foreign_key_none       =        210;
  2727.  
  2728. (*************************)
  2729. (** SQL role values     **)
  2730. (*************************)
  2731.   isc_dyn_def_sql_role           =        211;
  2732.   isc_dyn_sql_role_name          =        212;
  2733.   isc_dyn_grant_admin_options    =        213;
  2734.   isc_dyn_del_sql_role           =        214;
  2735.  
  2736. (******************************)
  2737. (** Last $dyn value assigned **)
  2738. (******************************)
  2739.  
  2740.   isc_dyn_last_dyn_value         =        216;
  2741.  
  2742. (********************************************)
  2743. (** Array slice description language (SDL) **)
  2744. (********************************************)
  2745.  
  2746.   isc_sdl_version1               =          1;
  2747.   isc_sdl_eoc                    =         -1;
  2748.   isc_sdl_relation               =          2;
  2749.   isc_sdl_rid                    =          3;
  2750.   isc_sdl_field                  =          4;
  2751.   isc_sdl_fid                    =          5;
  2752.   isc_sdl_struct                 =          6;
  2753.   isc_sdl_variable               =          7;
  2754.   isc_sdl_scalar                 =          8;
  2755.   isc_sdl_tiny_integer           =          9;
  2756.   isc_sdl_short_integer          =         10;
  2757.   isc_sdl_long_integer           =         11;
  2758.   isc_sdl_literal                =         12;
  2759.   isc_sdl_add                    =         13;
  2760.   isc_sdl_subtract               =         14;
  2761.   isc_sdl_multiply               =         15;
  2762.   isc_sdl_divide                 =         16;
  2763.   isc_sdl_negate                 =         17;
  2764.   isc_sdl_eql                    =         18;
  2765.   isc_sdl_neq                    =         19;
  2766.   isc_sdl_gtr                    =         20;
  2767.   isc_sdl_geq                    =         21;
  2768.   isc_sdl_lss                    =         22;
  2769.   isc_sdl_leq                    =         23;
  2770.   isc_sdl_and                    =         24;
  2771.   isc_sdl_or                     =         25;
  2772.   isc_sdl_not                    =         26;
  2773.   isc_sdl_while                  =         27;
  2774.   isc_sdl_assignment             =         28;
  2775.   isc_sdl_label                  =         29;
  2776.   isc_sdl_leave                  =         30;
  2777.   isc_sdl_begin                  =         31;
  2778.   isc_sdl_end                    =         32;
  2779.   isc_sdl_do3                    =         33;
  2780.   isc_sdl_do2                    =         34;
  2781.   isc_sdl_do1                    =         35;
  2782.   isc_sdl_element                =         36;
  2783.  
  2784. (**********************************************)
  2785. (** International text interpretation values **)
  2786. (**********************************************)
  2787.  
  2788.   isc_interp_eng_ascii           =          0;
  2789.   isc_interp_jpn_sjis            =          5;
  2790.   isc_interp_jpn_euc             =          6;
  2791.  
  2792. (******************************************)
  2793. (** Scroll direction for isc_dsql_fetch2 **)
  2794. (******************************************)
  2795.  
  2796.   isc_fetch_next                 =          0;
  2797.   isc_fetch_prior                =          1;
  2798.   isc_fetch_first                =          2;
  2799.   isc_fetch_last                 =          3;
  2800.   isc_fetch_absolute             =          4;
  2801.   isc_fetch_relative             =          5;
  2802.  
  2803. (*********************)
  2804. (** SQL definitions **)
  2805. (*********************)
  2806.   SQL_VARYING                    =        448;
  2807.   SQL_TEXT                       =        452;
  2808.   SQL_DOUBLE                     =        480;
  2809.   SQL_FLOAT                      =        482;
  2810.   SQL_LONG                       =        496;
  2811.   SQL_SHORT                      =        500;
  2812.   SQL_TIMESTAMP                  =        510;
  2813.   SQL_BLOB                       =        520;
  2814.   SQL_D_FLOAT                    =        530;
  2815.   SQL_ARRAY                      =        540;
  2816.   SQL_QUAD                       =        550;
  2817.   SQL_TYPE_TIME                  =        560;
  2818.   SQL_TYPE_DATE                  =        570;
  2819.   SQL_INT64                      =        580;
  2820.   SQL_DATE                       =        SQL_TIMESTAMP;
  2821.  
  2822. (*******************)
  2823. (** Blob Subtypes **)
  2824. (*******************)
  2825.  
  2826. (** types less than zero are reserved for customer use **)
  2827.  
  2828.   isc_blob_untyped               =          0;
  2829.  
  2830. (** internal subtypes **)
  2831.  
  2832.   isc_blob_text                  =          1;
  2833.   isc_blob_blr                   =          2;
  2834.   isc_blob_acl                   =          3;
  2835.   isc_blob_ranges                =          4;
  2836.   isc_blob_summary               =          5;
  2837.   isc_blob_format                =          6;
  2838.   isc_blob_tra                   =          7;
  2839.   isc_blob_extfile               =          8;
  2840.  
  2841. (** the range 20-30 is reserved for dBASE and Paradox types **)
  2842.  
  2843.   isc_blob_formatted_memo        =         20;
  2844.   isc_blob_paradox_ole           =         21;
  2845.   isc_blob_graphic               =         22;
  2846.   isc_blob_dbase_ole             =         23;
  2847.   isc_blob_typed_binary          =         24;
  2848.  
  2849.  
  2850.  
  2851.  
  2852.  
  2853.  
  2854.  
  2855. (** XSQLDA_LENGTH is defined in C as a macro, but in Pascal we must defined it
  2856.    as a function... **)
  2857. function XSQLDA_LENGTH(n: Long): Long;
  2858.  
  2859. (** getb, putb, putbx are all defined in C as macros.
  2860.    Use functions and procedures for the functionality **)
  2861. function getb                   (p: PBSTREAM): Char;
  2862. function putb                   (x: Char; p: PBSTREAM): Int;
  2863. function putbx                  (x: Char; p: PBSTREAM): Int;
  2864.  
  2865. (*
  2866. #define ADD_SPB_LENGTH(p, length)    {*(p)++ = (length); \
  2867.                          *(p)++ = (length) >> 8;}
  2868.  
  2869. #define ADD_SPB_NUMERIC(p, data)    {*(p)++ = (data); \
  2870.                          *(p)++ = (data) >> 8; \
  2871.                      *(p)++ = (data) >> 16; \
  2872.                      *(p)++ = (data) >> 24;}
  2873. *)
  2874. procedure add_spb_length(var p: PChar; length: integer);
  2875. procedure add_spb_numeric(var p: PChar; data: integer);
  2876.  
  2877.  
  2878. implementation
  2879.  
  2880. uses IBIntf, IB;
  2881.  
  2882.  
  2883.  
  2884.  
  2885.  
  2886.  
  2887.  
  2888.  
  2889.  
  2890.  
  2891.  
  2892. function XSQLDA_LENGTH(n: Long): Long;
  2893. (*  The C-macro reads like this:
  2894.    XSQLDA_LENGTH(n)    (sizeof (XSQLDA) + (n-1) * sizeof (XSQLVAR)) *)
  2895. begin
  2896.   result := SizeOf(TXSQLDA) + ((n - 1) * SizeOf(TXSQLVAR));
  2897. end;
  2898.  
  2899. function getb(p: PBSTREAM): Char;
  2900. (*  The C-macro reads like this:
  2901.    getb(p)    (--(p)->bstr_cnt >= 0 ? *(p)->bstr_ptr++ & 0377: BLOB_get (p)) *)
  2902. begin
  2903.   Dec(p^.bstr_cnt);
  2904.   if (p^.bstr_cnt >= 0) then begin
  2905.     result := Char(Int(p^.bstr_ptr^) and Int(0377));
  2906.     Inc(p^.bstr_ptr);
  2907.   end else
  2908.     result := Char(BLOB_get(p));
  2909. end;
  2910.  
  2911. function putb(x: Char; p: PBSTREAM): Int;
  2912. (*  The C-macro reads like this:
  2913.    putb(x,p) ((x == '\n' || (!(--(p)->bstr_cnt))) ?      // then
  2914.      BLOB_put (x,p) :                                    // else
  2915.      ((int) (*(p)->bstr_ptr++ = (unsigned) (x)))) *)
  2916. begin
  2917.   Dec(p^.bstr_cnt);
  2918.   if (x = Chr(Int('n') - Int('a'))) or (p^.bstr_cnt = 0) then
  2919.     result := BLOB_put(x, p)
  2920.   else begin
  2921.     p^.bstr_ptr^ := Char(x);
  2922.     result := UInt(x);
  2923.     Inc(p^.bstr_ptr^);
  2924.   end;
  2925. end;
  2926.  
  2927. function putbx(x: Char; p: PBSTREAM): Int;
  2928. (*  The C-macro reads like this:
  2929.    putbx(x,p) ((!(--(p)->bstr_cnt)) ?    // then
  2930.      BLOB_put (x,p) :                    // else
  2931.      ((int) (*(p)->bstr_ptr++ = (unsigned) (x)))) *)
  2932. begin
  2933.   Dec(p^.bstr_cnt);
  2934.   if (p^.bstr_cnt = 0) then
  2935.     result := BLOB_put(x, p)
  2936.   else begin
  2937.     p^.bstr_ptr^ := Char(x);
  2938.     Inc(p^.bstr_ptr^);
  2939.     result := UInt(x);
  2940.   end;
  2941. end;
  2942.  
  2943. (*******************************************)
  2944. (** Service manager functions             **)
  2945. (*******************************************)
  2946.  
  2947.  
  2948. procedure add_spb_length(var p: PChar; length: integer);
  2949. (*
  2950. #define ADD_SPB_LENGTH(p, length)    {*(p)++ = (length); \
  2951.                          *(p)++ = (length) >> 8;}
  2952. *)
  2953. begin
  2954.   p^ := char(length);
  2955.   Inc (p);
  2956.   p^ := char(length shr 8);
  2957.   Inc (p);
  2958. end;
  2959.  
  2960. procedure add_spb_numeric(var p: PChar; data: integer);
  2961. (*
  2962. #define ADD_SPB_NUMERIC(p, data)    {*(p)++ = (data); \
  2963.                          *(p)++ = (data) >> 8; \
  2964.                      *(p)++ = (data) >> 16; \
  2965.                      *(p)++ = (data) >> 24;}
  2966. *)
  2967. begin
  2968.   p^ := char(data);
  2969.   Inc (p);
  2970.   p^ := char(data shr 8);
  2971.   Inc (p);
  2972.   p^ := char(data shr 16);
  2973.   Inc (p);
  2974.   p^ := char(data shr 24);
  2975.   Inc (p);
  2976. end;
  2977.  
  2978. end.
  2979.  
  2980.