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