home *** CD-ROM | disk | FTP | other *** search
/ Windows 95 v2.4 Fix / W95-v2.4fix.iso / ACADWIN / ASE / ASI.H < prev    next >
Encoding:
C/C++ Source or Header  |  1995-02-08  |  13.6 KB  |  324 lines

  1. /*****************************************************************************
  2.     Name: asi.h                                       ast_asi_inc_appl_asi_h
  3.  
  4.     Description:  Header file for AutoCAD SQL Interface.
  5.                   "C" call interface
  6.  
  7.     Author: Grisha Starchenko
  8.             Autodesk, Inc.
  9.             Moscow, Russia.
  10.  
  11.       (C) Copyright 1991-93 by Autodesk, Inc.
  12.    ***************************************************************************
  13.       This program is copyrighted by Autodesk, Inc. and is  licensed
  14.       to you under the following conditions.  You may not distribute
  15.       or  publish the source code of this program in any form.   You
  16.       may  incorporate this code in object form in derivative  works
  17.       provided  such  derivative  works  are  (i.) are  designed and
  18.       intended  to  work  solely  with  Autodesk, Inc. products, and
  19.       (ii.)  contain  Autodesk's  copyright  notice  "(C)  Copyright
  20.       1988-1993 by Autodesk, Inc."
  21.    ***************************************************************************
  22.  
  23.       THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED
  24.       WARRANTY.  ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR
  25.       PURPOSE AND OF MERCHANTABILITY ARE HEREBY DISCLAIMED.
  26.  
  27.    ***************************************************************************
  28.                            RESTRICTED RIGHTS LEGEND
  29.  
  30.       Use, duplication, or disclosure by the U.S. Government is subject
  31.       to restrictions set forth in FAR 52.227-19 (Commerical Computer
  32.       Software - Restricted Rights) and DFAR 252.227-7013 (c) (1) (ii)
  33.       (Rights in Technical Data and Computer Software), as applicable.
  34.    ***************************************************************************
  35.  
  36.  
  37.     Entry Points:
  38.  
  39.     Modification History:
  40.        27 Sep 1993  - grisha -  original written
  41.  
  42.     Bugs and restriction on use:
  43.  
  44.     Notes:
  45.  
  46. *****************************************************************************/
  47. #ifndef ASI_ASI_H
  48. #define ASI_ASI_H asih
  49.  
  50. #if defined(__cplusplus)
  51. extern "C" {
  52. #endif  /* __cplusplus */
  53.  
  54. /***************************************************************************/
  55. /* INCLUDES */
  56. /***************************************************************************/
  57.  
  58. /***************************************************************************/
  59. /* TYPEDEFS */
  60. /***************************************************************************/
  61. typedef unsigned char  uchar;         // Unsigned char
  62. typedef unsigned short ushort;        // Unsigned short
  63. typedef unsigned int   uint;          // Unsigned int
  64. typedef unsigned long  ulong;         // Unsigned long
  65. typedef double         real;          // Real 
  66. typedef long           integer;       // Integer 
  67. typedef short          smallint;      // Small integer
  68.  
  69.  
  70. // Interval data
  71.  
  72. typedef struct asi_year {
  73.    long        sign;       // kAsiTrue if negative
  74.    ulong       years;      // Years
  75. } ASI_IYEAR;
  76.  
  77. typedef struct asi_yeartomonth {
  78.    long        sign;       // kAsiTrue if negative
  79.    ulong       years;      // Years
  80.    ulong       months;     // Months (0-11)
  81. } ASI_IYEARTOMONTH;
  82.  
  83. typedef struct asi_month {
  84.    long        sign;       // kAsiTrue if negative
  85.    ulong       months;     // Months
  86. } ASI_IMONTH;
  87.  
  88. typedef struct asi_day  {
  89.    long        sign;       // kAsiTrue if negative
  90.    ulong       days;       // Days
  91. } ASI_IDAY;
  92.  
  93. typedef struct asi_daytohour  {
  94.    long        sign;       // kAsiTrue if negative
  95.    ulong       days;       // Days 
  96.    ulong       hours;      // Hours (0-23)     
  97. } ASI_IDAYTOHOUR;
  98.  
  99. typedef struct asi_daytominute {
  100.    long        sign;       // kAsiTrue if negative
  101.    ulong       days;       // Days 
  102.    ulong       hours;      // Hours (0-23)    
  103.    ulong       minutes;    // Minutes (0-59)  
  104. } ASI_IDAYTOMINUTE;
  105.  
  106. typedef struct asi_daytosecond {
  107.    double      seconds;    // Seconds (0-59.99..9)  
  108.    long        sign;       // kAsiTrue if negative
  109.    ulong       days;       // Days 
  110.    ulong       hours;      // Hours (0-23)    
  111.    ulong       minutes;    // Minutes (0-59)  
  112. } ASI_IDAYTOSECOND;
  113.  
  114. typedef struct asi_hour {
  115.    long        sign;       // kAsiTrue if negative
  116.    ulong       hours;      // Hours
  117. } ASI_IHOUR;
  118.  
  119. typedef struct asi_hourtominute {
  120.    long        sign;       // kAsiTrue if negative
  121.    ulong       hours;      // Hours
  122.    ulong       minutes;    // Minutes (0-59)  
  123. } ASI_IHOURTOMINUTE;
  124.  
  125. typedef struct asi_hourtosecond {
  126.    double      seconds;    // Seconds (0-59.99..9)  
  127.    long        sign;       // kAsiTrue if negative
  128.    ulong       hours;      // Hours
  129.    ulong       minutes;    // Minutes (0-59)  
  130. } ASI_IHOURTOSECOND;
  131.  
  132. typedef struct asi_minute {
  133.    long        sign;       // kAsiTrue if negative
  134.    ulong       minutes;    // Minutes 
  135. } ASI_IMINUTE;
  136.  
  137. typedef struct asi_minuteitosecond {
  138.    double      seconds;    // Seconds (0-59.99..9)  
  139.    long        sign;       // kAsiTrue if negative
  140.    ulong       minutes;    // Minutes 
  141. } ASI_IMINUTETOSECOND;
  142.  
  143. typedef struct asi_second {
  144.    double      seconds;    // Seconds 
  145.    long        sign;       // kAsiTrue if negative
  146. } ASI_ISECOND;
  147.  
  148. // Datetime data
  149. //
  150. typedef struct asi_date {  // Date
  151.   ushort year;             // Year
  152.   ushort month;            // Month (0-11)
  153.   ushort day;              // Day (0-31)
  154.   short  pad;              // pad short
  155. } ASI_DTDATE;
  156.  
  157. typedef struct asi_time {     // Time with time zone
  158.   double            second;   // Second (0-59.99..9)  
  159.   ASI_IHOURTOMINUTE timezone; // time zone
  160.   ushort            hour;     // Hour (0-23)
  161.   ushort            minute;   // Minute (0-59)
  162. } ASI_DTTIME;
  163.  
  164. typedef struct asi_timestamp {  // Timestamp with time zone
  165.   ASI_DTTIME   time;        // Time
  166.   ASI_DTDATE   date;        // Date
  167. } ASI_DTTIMESTAMP; 
  168.  
  169.                              
  170. typedef ulong ASIHANDLE;               /* Generic ASI handle */
  171. typedef ulong ASIENV;                  /* Asi Environment handle */
  172. typedef ulong ASISESSION;              /* Session handle */
  173. typedef ulong ASISTATEMENT;            /* Statement handle */
  174. typedef ulong ASICURSOR;               /* Cursor */
  175. typedef ulong ASIPARDSC;               /* Input parameter handle */
  176. typedef ulong ASICOLDSC;               /* Column descriptor handle */
  177. typedef ulong ASIIDENT;                /* Identifier */
  178. typedef ulong ASIDATADSC;              /* Data descriptor */
  179. typedef ulong ASICONFIG;               /* Configuration file descriptor */
  180.  
  181. // Cast sesison, statement, or cursor to generic handle
  182. #define ASI_CASTTODIAG(x)     ((ASIHANDLE)(x))
  183.  
  184. /* Cursor status */
  185. #define ASI_CUPDATABLE     0x00000001      /* updatable cursor */
  186. #define ASI_CINSENSITIVE   0x00000002      /* insensitive cursor */
  187. #define ASI_CSCROLL        0x00000004      /* scrollable cursor */
  188. #define ASI_COPEN          0x00000008      /* open cursor */
  189.  
  190.  
  191.  
  192. /***************************************************************************/
  193. /* FUNCTION PROTOTYPES */
  194. /***************************************************************************/
  195.  
  196. /* identifier management functions */
  197. EAsiBoolean    asi_constr_ident       (ASIIDENT *);              /* Construct Identifier */
  198. EAsiBoolean    asi_destroy_ident      (ASIIDENT *);              /* Destroy Identifier object */
  199. EAsiBoolean    asi_dupl_ident         (ASIIDENT, ASIIDENT *);    /* Duplicate identifier */
  200. EAsiBoolean    asi_init_regular_ident (ASIIDENT, char *);        /* Initialize regular identifier */
  201. EAsiBoolean    asi_init_delimit_ident (ASIIDENT, char *);        /* Initialize delimited identifier */
  202. char *         asi_get_ident          (ASIIDENT, char *, int); /* Get identifier body */
  203.  
  204. /* Data descriptor */
  205. EAsiBoolean      asi_destroy_ddsc       (ASIDATADSC *);
  206. EAsiDataType     asi_ddsc_type          (ASIDATADSC);             /* type */
  207. EAsiDTType       asi_ddsc_datetimetype  (ASIDATADSC);             /* datetime type */
  208. EAsiIType        asi_ddsc_intervaltype  (ASIDATADSC);             /* interval type */
  209. uint             asi_ddsc_precision     (ASIDATADSC);             /* Precison */
  210. uint             asi_ddsc_scale         (ASIDATADSC);             /* Scale */
  211. uint             asi_ddsc_length        (ASIDATADSC);             /* Length */
  212. uint             asi_ddsc_timeprec      (ASIDATADSC);             /* Time precision */
  213. uint             asi_ddsc_lfp           (ASIDATADSC);             /* Interval leading field precision */
  214. uint             asi_ddsc_fsp           (ASIDATADSC);             /* Interval fractional second precison */
  215. uint             asi_ddsc_ret_length    (ASIDATADSC);             /* Return length */
  216. char *           asi_ddsc_sqltype       (ASIDATADSC, char *, int); /* Return SQL type as a string */
  217.  
  218. /* Input parmaeter manipulation */
  219. EAsiBoolean      asi_pdsc_name          (ASIPARDSC, ASIIDENT *);   /* Parameter name */
  220. EAsiBoolean      asi_pdsc_ddsc          (ASIPARDSC, ASIDATADSC *); /* Parameter data descriptor */
  221. EAsiBoolean      asi_pdsc_nullable      (ASIPARDSC);               /* Is nullable */
  222.  
  223. /* Column descriptor */
  224. EAsiBoolean      asi_cdsc_name          (ASICOLDSC, ASIIDENT *);   /* Parameter name */
  225. EAsiBoolean      asi_cdsc_ddsc          (ASICOLDSC, ASIDATADSC *); /* Parameter data descriptor */
  226. EAsiBoolean      asi_cdsc_nullable      (ASICOLDSC);               /* Is nullable */
  227.  
  228.  
  229. /* ASI initialization and termination functions */
  230. EAsiBoolean    asi_initasi         (ASIENV *);
  231. EAsiBoolean    asi_termasi         (ASIENV *);
  232. EAsiBoolean    asi_abortasi        (ASIENV *);
  233.  
  234. /* ASI connection management functions */
  235. EAsiBoolean    asi_constr_session  (ASISESSION *, ASIENV);
  236. EAsiBoolean    asi_destroy_session (ASISESSION *, ASIENV);
  237. EAsiBoolean    asi_connect         (ASISESSION, char *, char *, char *);
  238. EAsiBoolean    asi_disconnect      (ASISESSION);
  239. EAsiBoolean    asi_disconnectall   (ASIENV);
  240.  
  241. /* Driver information */
  242. EAsiBoolean    asi_version       (ASIENV, char *, int);
  243. EAsiBoolean    asi_dbms          (ASIHANDLE, char *, int);
  244. EAsiBoolean    asi_sqlobject     (ASIHANDLE, char *, int);
  245. EAsiBoolean    asi_message       (ASIHANDLE, char *, int);
  246. EAsiBoolean    asi_checkop       (ASIHANDLE, ulong);
  247.  
  248. /* ASI session management functions */
  249. EAsiBoolean    asi_setcatalog      (ASISESSION, char *);
  250. EAsiBoolean    asi_setschema       (ASISESSION, char *);
  251. EAsiBoolean    asi_setnames        (ASISESSION, char *);
  252. EAsiBoolean    asi_settimezone     (ASISESSION, ASI_IHOURTOMINUTE *);
  253. EAsiBoolean    asi_setauthor       (ASISESSION, char *);
  254. EAsiBoolean    asi_settrans        (ASISESSION, EAsiTILevel, EAsiTMode, uint);
  255. EAsiBoolean    asi_setdefconstr    (ASISESSION, ASIIDENT);
  256. EAsiBoolean    asi_setimmconstr    (ASISESSION, ASIIDENT);
  257. EAsiBoolean    asi_commit          (ASISESSION);
  258. EAsiBoolean    asi_rollback        (ASISESSION);
  259. EAsiBoolean    asi_cancel          (ASISESSION);
  260.  
  261. /* ASI diagnostics functions */
  262. EAsiStatement  asi_opr           (ASIHANDLE);
  263. EAsiStatement  asi_stm           (ASIHANDLE);
  264. long           asi_rowqty        (ASIHANDLE);
  265. EAsiBoolean    asi_getcuropt     (ASICURSOR, ulong *);
  266. int            asi_synerrpos     (ASIHANDLE);
  267. int            asi_condqty       (ASIHANDLE);
  268. EAsiError      asi_err           (ASIHANDLE, int);
  269. char *         asi_errmsg        (ASIHANDLE, char *, int, int);
  270. char*          asi_sqlstate      (ASIHANDLE, int);
  271. EAsiBoolean    asi_getdiagpar    (ASIHANDLE, EAsiDiag, void *, int, int); 
  272.  
  273. /* Statement descriptors */ 
  274. int            asi_parcount      (ASIHANDLE);
  275. EAsiBoolean    asi_pds           (ASIHANDLE, int, ASIPARDSC *);
  276. EAsiBoolean    asi_bndname       (ASIHANDLE, ASIIDENT, void*, short*, int, EAsiHostType);
  277. EAsiBoolean    asi_bndnum        (ASIHANDLE, int, void*, short*, int, EAsiHostType);
  278. int            asi_colcount      (ASIHANDLE);
  279. EAsiBoolean    asi_cds           (ASIHANDLE, int, ASICOLDSC *);
  280. EAsiBoolean    asi_sob           (ASIHANDLE, int, void*, short*, int, EAsiHostType);
  281. EAsiBoolean    asi_cvl           (ASIHANDLE, int, void*, short*, int, EAsiHostType);
  282.  
  283.  
  284. /* Statement processing functions */
  285. EAsiBoolean    asi_constr_stm      (ASISTATEMENT *);
  286. EAsiBoolean    asi_constr_native_stm (ASISTATEMENT *);
  287. EAsiBoolean    asi_destroy_stm     (ASISTATEMENT *);
  288. EAsiBoolean    asi_prepare         (ASISTATEMENT, ASISESSION, char *);
  289. EAsiBoolean    asi_execute         (ASISTATEMENT);
  290. EAsiBoolean    asi_iexecute        (ASISTATEMENT, ASISESSION, char *);
  291. EAsiBoolean    asi_dealloc_stm     (ASISTATEMENT);
  292.  
  293.  
  294. /* Cursor Manipulation Functions */
  295. EAsiBoolean    asi_constr_csr      (ASICURSOR *);
  296. EAsiBoolean    asi_destroy_csr     (ASICURSOR *);
  297. EAsiBoolean    asi_alloc_csr       (ASICURSOR, ASISTATEMENT, char *, 
  298.                                     EAsiCurScr, EAsiCurSns);
  299. EAsiBoolean    asi_open            (ASICURSOR);
  300. EAsiBoolean    asi_close           (ASICURSOR);
  301. EAsiBoolean    asi_fetch           (ASICURSOR);
  302. EAsiBoolean    asi_fetchPrior      (ASICURSOR);
  303. EAsiBoolean    asi_fetchFirst      (ASICURSOR);
  304. EAsiBoolean    asi_fetchLast       (ASICURSOR);
  305. EAsiBoolean    asi_fetchAbsolute   (ASICURSOR, long);
  306. EAsiBoolean    asi_fetchRelative   (ASICURSOR, long);
  307. EAsiBoolean    asi_delete          (ASICURSOR);
  308. EAsiBoolean    asi_update          (ASICURSOR, ...);
  309.  
  310.  
  311. /* Asi configuration access */
  312. EAsiBoolean asi_constr_cfg   (ASICONFIG *);
  313. EAsiBoolean asi_destroy_cfg  (ASICONFIG *);
  314. int         asi_getcfgstring (ASICONFIG, char *, char *, char *, char *, int);
  315. EAsiBoolean asi_setcfgstring (ASICONFIG, char *, char *, char *);
  316. EAsiBoolean asi_createenv    (ASICONFIG, char *, char *);
  317. EAsiBoolean asi_dropenv      (ASICONFIG, char *);
  318. #if defined(__cplusplus)
  319. }
  320. #endif  /* __cplusplus */
  321.  
  322. #endif /* ASI_ASI_H */
  323. /*EOF*/
  324.