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

  1. #ifndef _ASE_H
  2. #define _ASE_H
  3. /*****************************************************************************
  4.     Name: ase.h                                       
  5.  
  6.     Description:  
  7.                   This file describes the ASE Program Interface
  8.                   functions for AutoCAD C applications.
  9.  
  10.     Author: Volodya Sirotinin
  11.             Autodesk, Inc.
  12.             Moscow, Russia.
  13.  
  14.    Copyright (C) 1992, 1993, 1994 by Autodesk, Inc.
  15.  
  16.    Permission to use, copy, modify, and distribute this software in 
  17.    object code form for any purpose and without fee is hereby granted, 
  18.    provided that the above copyright notice appears in all copies and 
  19.    that both that copyright notice and the limited warranty and 
  20.    restricted rights notice below appear in all supporting 
  21.    documentation.
  22.  
  23.    AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.  
  24.    AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF 
  25.    MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.  AUTODESK, INC.
  26.    DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE 
  27.    UNINTERRUPTED OR ERROR FREE.
  28.  
  29.    Use, duplication, or disclosure by the U.S. Government is subject to 
  30.    restrictions set forth in FAR 52.227-19 (Commercial Computer 
  31.    Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) 
  32.    (Rights in Technical Data and Computer Software), as applicable.
  33.  
  34.     Entry Points:
  35.  
  36.     Modification History:
  37.     11 Oct 1993 - volodyas - original written
  38.  
  39.     Bugs and restriction on use:
  40.  
  41.     Notes:
  42.  
  43. *****************************************************************************/
  44.  
  45. /***************************************************************************/
  46. /* INCLUDES */
  47. /***************************************************************************/
  48. #include <aseconst.h>
  49. #include <asi.h>
  50.  
  51. #if defined(__cplusplus)
  52. #include <aseclass.h>
  53. #endif  /* __cplusplus */
  54.  
  55. /***************************************************************************/
  56. /* DEFINES */
  57. /***************************************************************************/
  58. #define ASE_DSC_NULL     0L        /* Null descriptor */
  59.  
  60. /***************************************************************************/
  61. /* TYPEDEFS */
  62. /***************************************************************************/
  63. typedef ulong ASE_DSC ;          /* The base API */
  64. typedef ASE_DSC ASE_APPLDSC ;    /* The  application descriptor */
  65. typedef ASE_DSC ASE_LPDSC ;      /* The Link Path descriptor */
  66. typedef ASE_DSC ASE_LINKDSC ;    /* The link descriptor */
  67. typedef ASE_DSC ASE_LSDSC ;    /* The link selection descriptor */
  68.  
  69. /***************************************************************************/
  70. /* FUNCTION PROTOTYPES */
  71. /***************************************************************************/
  72. #if defined(__cplusplus)
  73. extern "C" {
  74. #endif  /* __cplusplus */
  75.  
  76. ASE_DSC            ase_dsc_alloc(ASE_DSC dsc, EAseApiClassId Code) ;
  77. void               ase_dsc_free(ASE_DSC *pDsc) ;
  78. EAsiBoolean        ase_dsc_init(ASE_DSC dsc) ;
  79. EAsiBoolean        ase_dsc_isInit(ASE_DSC dsc) ;
  80. const char        *ase_dsc_version(ASE_DSC dsc) ;
  81. EAseApiClassId     ase_dsc_isA(ASE_DSC dsc) ;
  82. ASE_DSC            ase_dsc_clone(ASE_DSC dsc) ;
  83. EAsiBoolean        ase_dsc_copyFrom(ASE_DSC dsc, 
  84.                                     ASE_DSC source) ;
  85. int                ase_dsc_cmp(ASE_DSC dsc, 
  86.                                ASE_DSC dsc2) ;
  87. int                ase_dsc_errQty(ASE_DSC dsc) ;
  88. EAseErrDsc         ase_dsc_errDsc(ASE_DSC dsc, 
  89.                                   int ErrNum) ;
  90. int                ase_dsc_errCode(ASE_DSC dsc, 
  91.                                    int ErrNum) ;
  92. EAsiBoolean        ase_dsc_errMsg(ASE_DSC dsc, 
  93.                                   int ErrNum,
  94.                                   char *pBuf, 
  95.                                   int BufLen) ;
  96. EAsiBoolean        ase_dsc_errClear(ASE_DSC dsc) ;
  97. const char*        ase_dsc_errDiagParNameCode(ASE_DSC dsc,
  98.                                               int ParNum,
  99.                                               int *pParCode,
  100.                                               int *pIsStr) ;
  101. EAsiBoolean        ase_dsc_errDiagParInt(ASE_DSC dsc,
  102.                                          int ErrNum, 
  103.                                          int ParCode,
  104.                                          int *pIntValue) ;
  105. EAsiBoolean        ase_dsc_errDiagParStr(ASE_DSC dsc,
  106.                                          int ErrNum, 
  107.                                          int ParCode,
  108.                                          char *pStrValue,
  109.                                          int BufLen) ;
  110. EAsiBoolean        ase_dsc_errInitAsi(ASE_DSC dsc,
  111.                                       ASIHANDLE diag) ;
  112.  
  113. ASE_APPLDSC        ase_appl_init(void) ;
  114. void               ase_appl_term(ASE_APPLDSC *pApplDsc) ;
  115. EAsiBoolean        ase_appl_getAseErr(ASE_APPLDSC applDsc) ;
  116.  
  117. EAsiBoolean        ase_lp_initPath(ASE_LPDSC lpDsc, 
  118.                                    const char *pPath) ;
  119. EAsiBoolean        ase_lp_initName(ASE_LPDSC lpDsc,
  120.                                    const char *pName) ;
  121. EAsiBoolean        ase_lp_initCurrent(ASE_LPDSC lpDsc) ;
  122. EAsiBoolean        ase_lp_setName(ASE_LPDSC lpDsc,
  123.                                   const char *pName,
  124.                                   EAseDoNameCode NameCode) ;
  125. EAsiBoolean        ase_lp_getName(ASE_LPDSC lpDsc,
  126.                                   char *pBuf, 
  127.                                   int BufLen,
  128.                                   EAseDoNameCode NameCode) ;
  129. int                ase_lp_getNameSize(ASE_LPDSC lpDsc,
  130.                                       EAseDoNameCode NameCode) ;
  131. int                ase_lp_cmpName(ASE_LPDSC lpDsc,
  132.                                     const char *pName, 
  133.                                     EAseDoNameCode NameCode) ;
  134. int                ase_lp_cmpDscName(ASE_LPDSC lpDsc,
  135.                                      ASE_LPDSC lpDsc2,
  136.                                      EAseDoNameCode NameCode) ;
  137. EAseDoNameCode     ase_lp_getPathCode(ASE_LPDSC lpDsc) ;
  138. int                ase_lp_getStatus(ASE_LPDSC lpDsc) ;
  139. EAsiBoolean        ase_lp_isUpdatable(ASE_LPDSC lpDsc) ;
  140. EAsiBoolean        ase_lp_getKeyDsc(ASE_LPDSC lpDsc, 
  141.                                     ASICOLDSC *pKeyDsc[], int *pColQty) ;
  142. EAsiBoolean        ase_lp_create(ASE_LPDSC lpDsc,
  143.                                  const ASICOLDSC pKeyDsc[], 
  144.                                  int ColQty) ;
  145. EAsiBoolean        ase_lp_erase(ASE_LPDSC lpDsc) ;
  146. EAsiBoolean        ase_lp_rename(ASE_LPDSC lpDsc,
  147.                                 const char *pName) ;
  148. EAsiBoolean        ase_lp_setCurrent(ASE_LPDSC lpDsc) ;
  149. struct resbuf     *ase_lp_getLinkNames(ASE_LPDSC lpDsc) ;
  150. struct resbuf     *ase_lp_getPaths(ASE_LPDSC lpDsc, int Status) ;
  151.  
  152.  
  153. EAsiBoolean        ase_link_initType(ASE_LINKDSC linkDsc, 
  154.                                      EAseLinkType LinkType) ;
  155. EAsiBoolean        ase_link_initId(ASE_LINKDSC linkDsc, 
  156.                                    LinkID LinkId) ;
  157. EAsiBoolean        ase_link_initEntityLink(ASE_LINKDSC linkDsc, 
  158.                                            const char *pName, 
  159.                                            const ASICOLDSC pKeyValue[], 
  160.                                            int ColQty,
  161.                                            ads_name EntName) ;
  162. EAsiBoolean        ase_link_initDALink(ASE_LINKDSC linkDsc, 
  163.                                        const char *pName, 
  164.                                        const ASICOLDSC pKeyValue[], 
  165.                                        int ColQty,
  166.                                        const ASICOLDSC pDACols[], 
  167.                                        int DAColQty,
  168.                                        const struct resbuf *pDAParms) ;
  169. LinkID             ase_link_getId(ASE_LINKDSC linkDsc) ;
  170. EAseLinkType       ase_link_getType(ASE_LINKDSC linkDsc) ;
  171. EAsiBoolean        ase_link_getName(ASE_LINKDSC linkDsc, 
  172.                                     char *pBuf, 
  173.                                     int len) ;
  174. EAsiBoolean        ase_link_setName(ASE_LINKDSC linkDsc, 
  175.                                     const char *pName) ;
  176. int                ase_link_getNameSize(ASE_LINKDSC linkDsc) ;
  177. EAsiBoolean        ase_link_getEntity(ASE_LINKDSC linkDsc, 
  178.                                       ads_name EntName) ;
  179. EAsiBoolean        ase_link_setEntity(ASE_LINKDSC linkDsc, 
  180.                                       ads_name EntName) ;
  181. EAsiBoolean        ase_link_getKey (ASE_LINKDSC linkDsc,
  182.                                     ASICOLDSC pKeyValue[], 
  183.                                     int ColQty) ;
  184. EAsiBoolean        ase_link_setKey (ASE_LINKDSC linkDsc, 
  185.                                     const ASICOLDSC pKeyValue[], 
  186.                                     int ColQty);
  187. EAsiBoolean        ase_link_getDACols (ASE_LINKDSC linkDsc,
  188.                                        ASICOLDSC *pCols[], 
  189.                                        int *pColQty) ;
  190. EAsiBoolean        ase_link_setDACols (ASE_LINKDSC linkDsc, 
  191.                                        ASICOLDSC pCols[], 
  192.                                        int ColQty) ;
  193. EAsiBoolean        ase_link_setDAParms (ASE_LINKDSC linkDsc, 
  194.                                         const struct resbuf *pParms) ;
  195. EAsiBoolean        ase_link_setDAValues (ASE_LINKDSC linkDsc, 
  196.                                          ASICOLDSC pCols[], 
  197.                                          int ColQty) ;
  198. EAsiBoolean        ase_link_create(ASE_LINKDSC linkDsc) ;
  199. EAsiBoolean        ase_link_remove (ASE_LINKDSC linkDsc) ;
  200. EAsiBoolean        ase_link_update (ASE_LINKDSC linkDsc) ;
  201. EAsiBoolean        ase_link_getXName(ASE_LINKDSC linkDsc, 
  202.                                      char *pBuf, 
  203.                                      int len) ;
  204. EAsiBoolean        ase_link_isUpdatable(ASE_LINKDSC linkDsc) ;
  205.  
  206. EAsiBoolean        ase_ls_initType(ASE_LSDSC lsDsc,
  207.                                    EAseLinkType LinkType) ;
  208. EAsiBoolean        ase_ls_initSel(ASE_LSDSC lsDsc,
  209.                                   ads_name EntSelName) ;
  210. EAsiBoolean        ase_ls_initEnt(ASE_LSDSC lsDsc,
  211.                                   ads_name EntName) ;
  212. EAsiBoolean        ase_ls_initXName(ASE_LSDSC lsDsc,
  213.                                     const char *pXName) ;
  214. EAsiBoolean        ase_ls_initLp(ASE_LSDSC lsDsc, 
  215.                                  const char *pName) ;
  216. EAsiBoolean        ase_ls_initLpDsc(ASE_LSDSC lsDsc,
  217.                                     ASE_LPDSC lpDsc) ;
  218. EAsiBoolean        ase_ls_initLpEnt(ASE_LSDSC lsDsc, 
  219.                                     const char *pName, 
  220.                                     ads_name EntName) ;
  221. EAsiBoolean        ase_ls_initLpDscEnt(ASE_LSDSC lsDsc,
  222.                                        ASE_LPDSC lpDsc, 
  223.                                        ads_name EntName) ;
  224. EAsiBoolean        ase_ls_initLpSel(ASE_LSDSC lsDsc,
  225.                                     const char *pName, 
  226.                                     ads_name EntSelName) ;
  227. EAsiBoolean        ase_ls_initLpDscSel(ASE_LSDSC lsDsc, 
  228.                                        ASE_LPDSC lpDsc, 
  229.                                        ads_name EntSelName) ;
  230. EAsiBoolean        ase_ls_initLpCond(ASE_LSDSC lsDsc, 
  231.                                      const char *pName, 
  232.                                      const char *pTextCondition) ;
  233. EAsiBoolean        ase_ls_initLpDscCond(ASE_LSDSC lsDsc, 
  234.                                         ASE_LPDSC lpDsc, 
  235.                                         const char *pTextCondition) ;
  236. EAsiBoolean        ase_ls_initLpKey(ASE_LSDSC lsDsc, 
  237.                                     const char *pName, 
  238.                                     const ASICOLDSC pKeyValue[], 
  239.                                     int ColQty) ;
  240. EAsiBoolean        ase_ls_initLpDscKey(ASE_LSDSC lsDsc, 
  241.                                        ASE_LPDSC lpDsc, 
  242.                                        const ASICOLDSC pKeyValue[], 
  243.                                        int ColQty) ;
  244. EAsiBoolean        ase_ls_isUpdatable(ASE_LSDSC lsDsc) ;
  245. long               ase_ls_getQty(ASE_LSDSC lsDsc) ;
  246. LinkID             ase_ls_getId(ASE_LSDSC lsDsc, 
  247.                                 long ItemNum) ;
  248. EAsiBoolean        ase_ls_addId(ASE_LSDSC lsDsc,
  249.                                 LinkID linkId) ;
  250. EAsiBoolean        ase_ls_delId(ASE_LSDSC lsDsc,
  251.                                 long ItemNum) ;
  252. long               ase_ls_membId(ASE_LSDSC lsDsc, 
  253.                                  LinkID linkId) ;
  254. EAsiBoolean        ase_ls_unite(ASE_LSDSC lsDsc,
  255.                                 ASE_LSDSC lsDsc2) ;
  256. EAsiBoolean        ase_ls_subtract(ASE_LSDSC lsDsc,
  257.                                    ASE_LSDSC lsDsc2) ;
  258. EAsiBoolean        ase_ls_intersect(ASE_LSDSC lsDsc,
  259.                                     ASE_LSDSC lsDsc2) ;
  260. EAsiBoolean        ase_ls_intersectType(ASE_LSDSC lsDsc, 
  261.                                         EAseLinkType LinkType) ;
  262. EAsiBoolean        ase_ls_intersectEnt(ASE_LSDSC lsDsc, 
  263.                                        ads_name EntName) ;
  264. EAsiBoolean        ase_ls_intersectSel(ASE_LSDSC lsDsc, 
  265.                                        ads_name EntSelName) ;
  266. EAsiBoolean        ase_ls_intersectXName(ASE_LSDSC lsDsc, 
  267.                                          const char *pXName) ;
  268. EAsiBoolean        ase_ls_intersectLp(ASE_LSDSC lsDsc, 
  269.                                          const char *pName) ;
  270. EAsiBoolean        ase_ls_intersectLpDsc(ASE_LSDSC lsDsc, 
  271.                                       ASE_LPDSC lpDsc) ;
  272. EAsiBoolean        ase_ls_intersectLpKey(ASE_LSDSC lsDsc, 
  273.                                          const char *pName, 
  274.                                          const ASICOLDSC pKeyValue[], 
  275.                                          int ColQty) ;
  276. EAsiBoolean        ase_ls_intersectLpDscKey(ASE_LSDSC lsDsc,
  277.                                             ASE_LPDSC lpDsc, 
  278.                                             const ASICOLDSC pKeyValue[], 
  279.                                             int ColQty) ;
  280. EAsiBoolean        ase_ls_intersectLpCond(ASE_LSDSC lsDsc, 
  281.                                           const char *pName, 
  282.                                           const char *pTextCondition) ;
  283. EAsiBoolean        ase_ls_intersectLpDscCond(ASE_LSDSC lsDsc, 
  284.                                             ASE_LPDSC lpDsc, 
  285.                                             const char *pTextCondition) ;
  286. struct resbuf     *ase_ls_getXNames(ASE_LSDSC lsDsc) ;
  287. struct resbuf     *ase_ls_getLinkNames(ASE_LSDSC lsDsc) ;
  288. EAsiBoolean        ase_ls_getEntSel(ASE_LSDSC lsDsc,
  289.                                     ads_name EntSelName) ;
  290. EAsiBoolean        ase_ls_erase(ASE_LSDSC lsDsc) ;
  291.  
  292. /**********************************************************************/
  293. /* Non-documented functions serving to supplement ASI C functionality */
  294. /**********************************************************************/
  295.  
  296.                      /* Creates the copy of the ASICOLDSC descriptor */
  297. ASICOLDSC          asei_dupl_cdsc(ASICOLDSC coldsc) ;
  298.  
  299.                      /* Destroys the created ASICOLDSC descriptor */
  300. void               asei_destroy_cdsc(ASICOLDSC *pcoldsc) ;
  301.  
  302.                      /* Constructs the array of the ASICOLDSC descriptors */
  303.                      /* all of the descriptors are 0L */
  304. ASICOLDSC*         asei_constr_cdscpack(int ColQty) ;
  305.  
  306.                      /* Clones the array of the ASICOLDSC descriptors */
  307. ASICOLDSC*         asei_dupl_cdscpack(ASICOLDSC coldscs[], int ColQty) ;
  308.  
  309.                      /* Destroys the array of the ASICOLDSC descriptors */
  310. void               asei_destroy_cdscpack(ASICOLDSC *coldscs[], int ColQty) ;
  311.  
  312.                      /* Makes the column descriptor nullable */
  313. EAsiBoolean        asei_cdsc_setnull(ASICOLDSC coldsc) ;
  314.  
  315.                      /* Copies the data descriptor */
  316.                      /* from the source ASICOLDSC into coldsc */
  317. EAsiBoolean        asei_cdsc_setdata(ASICOLDSC coldsc, ASICOLDSC source) ;
  318.  
  319.                      /* Compares the names of the two ASICOLDSC descritpors */
  320.                      /* returns 1 if they are similar */
  321. int                asei_cdsc_cmpname(ASICOLDSC coldsc1, ASICOLDSC coldsc2) ;
  322.  
  323.                      /* Initializes the identifier by its name */
  324.                      /* If the first character and last one */
  325.                      /* are the double quotes, */
  326.                      /* the delimited identifier is initialized */
  327. EAsiBoolean        asei_ident_init(ASIIDENT ident, char *pName) ;
  328.  
  329.                      /* Compares two ASIIDENT identifiers */
  330.                      /* returns 1 if they are similar */
  331. int                asei_ident_cmp(ASIIDENT ident1, ASIIDENT ident2) ;
  332.  
  333.                      /* Gets the Result Type of the data in the column desc*/
  334.                      /* Returns the types: RTREAL, RTLONG, RTSTR, RTVOID */
  335.                      /*  RTSTR:                                           */
  336.                      /* kAsiChar, kAsiCharVar, kAsiDateTime, kAsiInterval*/
  337.                      /*  RTLONG:                                         */
  338.                      /* kAsiSmallInt, kAsiInteger                        */
  339.                      /*  RTREAL:                                         */
  340.                      /* kAsiNumeric,kAsiDecimal,kAsiFloat,kAsiReal,      */
  341.                      /* kAsiDouble                                       */
  342.                      /*  RTVOID:                                         */
  343.                      /* kAsiVector,kAsiImplDefined,kAsiTUnknown,kAsiBit, */
  344.                      /* kAsiBitVar                                       */
  345.                      /* or if error was occured                          */
  346.                      /* The arguemnt pIsNull retreives kAsiTrue if       */
  347.                      /* no data exist, kAsiFalse otherwise               */
  348. int                asei_cdsc_rtype(ASICOLDSC coldsc, EAsiBoolean *pIsNull) ;
  349.  
  350.                      /* Gets the long data from the column desc */
  351. EAsiBoolean        asei_cdsc_getlong(ASICOLDSC coldsc, long *pLong) ;
  352.  
  353.                      /* Sets the long data into the column desc */
  354. EAsiBoolean        asei_cdsc_setlong(ASICOLDSC coldsc, long RLong) ;
  355.  
  356.                      /* Gets the real data from the column desc */
  357. EAsiBoolean        asei_cdsc_getreal(ASICOLDSC coldsc, ads_real *pReal) ;
  358.  
  359.                      /* Sets the real data into the column desc */
  360. EAsiBoolean        asei_cdsc_setreal(ASICOLDSC coldsc, ads_real RReal) ;
  361.  
  362.                      /* Gets the string data from the column desc */
  363.                      /* The result is retreived in the */
  364.                      /* default character set */
  365.                      /* Gets the Binary data as the hex string */
  366. EAsiBoolean        asei_cdsc_getstr(ASICOLDSC coldsc, char *pBuf, int bufLen);
  367.  
  368.                      /* Sets the string data into the column desc */
  369.                      /* The specified strings has to be */
  370.                      /* in the current character set */
  371.                      /* Binary data should be represented as the hex string */
  372. EAsiBoolean        asei_cdsc_setstr(ASICOLDSC coldsc, char *pStr);
  373.  
  374.                      /* Gets the data & column description */
  375.                      /* from the specified cursor's column */
  376.                      /* If the function returns kAsiGood, then */
  377.                      /* the retreived column descriptor should */
  378.                      /* be released later */
  379. EAsiBoolean        asei_cds(ASICURSOR csr, int ColNum, ASICOLDSC *pcoldsc);
  380.  
  381.                      /* Binds the data from the column descriptor */
  382.                      /* with the input parameter of the SQL statement */
  383. EAsiBoolean        asei_bnd(ASIHANDLE stm, int parnum, ASICOLDSC col) ;
  384.  
  385. #if defined(__cplusplus)
  386. }
  387. #endif  /* __cplusplus */
  388.  
  389. #endif /*_ASEH*/
  390. /*EOF*/
  391.