/********************************************************************** * * DB.h * ==== * * This file is part of the VARKON Database Library. * URL: http://www.varkon.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * (C)Microform AB 1984-2000, Johan Kjellander, johan@microform.se * ***********************************************************************/ /* ***First of all define the current version of the DB library. ***These constants are used to ensure that the DB is not called ***by code that is not compatible with the current DB and that ***DB files are not loaded that are created by later versions ***of the DB. */ #define DB_LIBVERSION 1 /* DBlib version */ #define DB_LIBREVISION 16 /* DBlib revision */ #define DB_LIBLEVEL 'F' /* DBlib level F = 32 bit pagenumbers */ /* ***Now we need to define the size of some ***basic datatypes. These definitions may have to be ***changed when the system is ported to a new platform. */ typedef char DBchar; /* Always 8-bit signed char */ typedef short DBshort; /* Always 16-bit signed integer */ typedef unsigned short DBushort; /* Always 16-bit unsigned int */ #ifdef _CRAYT3E typedef short DBint; /* Always 32-bit signed integer */ #else typedef int DBint; /* Always 32-bit signed integer */ #endif typedef unsigned int DBuint; /* Always 32-bit unsigned int */ typedef double DBfloat; /* Always 64-bit float */ /* ***Now some basic DB datatypes. ***Added #ifdef for bool in C++ 13/8 2000 JK. */ typedef DBint DBptr; /* A DB virtual address (pointer) may be < 0 */ #define DBNULL (DBptr)0 /* A DB NULL pointer */ typedef DBshort DBstatus; /* A DB function return value */ typedef DBshort DBseqnum; /* A DB ID sequence value */ typedef DBshort DBordnum; /* A DB ID order value */ #ifndef __cplusplus typedef DBint bool; /* A boolean value */ #endif typedef DBchar tbool; /* A tiny boolean */ typedef DBint DBpagnum; /* A page number, changed to 32 bit 020222, JK */ /* ***Some of the DB types depend on Varkon types defined in ***common.h. */ #include "common.h" /* ***Surface graphical NURBS representations are based on datatypes ***defined in OpenGL. */ #ifdef WIN32 #include #endif #ifdef V3_OPENGL #include #else #define GLfloat float #endif /* ***A DB entity ID (Same as V2REFVA in common.h). */ typedef V2REFVA DBId; /* ***A 2D/3D-vector (Compatible with V2VECVA in common.h). */ typedef struct { DBfloat x_gm; /* X or U coordinate */ DBfloat y_gm; /* Y or V coordiante */ DBfloat z_gm; /* Optional Z coordinate */ } DBVector; /* ***A 4D-vector. */ typedef struct { DBfloat x_gm; /* X-coordinate */ DBfloat y_gm; /* Y-coordinate */ DBfloat z_gm; /* Z-coordinate */ DBfloat w_gm; /* W-coordinate */ } DBHvector; /* ***A 4X4 Transformation matrix. */ typedef struct { DBfloat g11,g12,g13,g14; /* First row */ DBfloat g21,g22,g23,g24; /* Second row */ DBfloat g31,g32,g33,g34; /* Third row */ DBfloat g41,g42,g43,g44; /* Last row */ } DBTmat; /* ***VARKON entity typecodes. */ typedef DBushort DBetype; /* A GM entity type, POITYP, LINTYP etc.. */ #define TRFTYP (DBetype)0 /* Transformation */ #define POITYP (DBetype)1 /* Point */ #define LINTYP (DBetype)2 /* Line */ #define ARCTYP (DBetype)4 /* Arc */ #define CURTYP (DBetype)8 /* Curve */ #define SURTYP (DBetype)16 /* Surface */ #define TXTTYP (DBetype)32 /* Text */ #define XHTTYP (DBetype)64 /* Hatch */ #define LDMTYP (DBetype)128 /* Linear dimension */ #define CDMTYP (DBetype)256 /* Diameter dimension */ #define RDMTYP (DBetype)512 /* Radius dimension */ #define ADMTYP (DBetype)1024 /* Angular dimension */ /* 2048 reserved for use in the future */ #define GRPTYP (DBetype)4096 /* Group */ #define CSYTYP (DBetype)8192 /* Coordinatesystem */ #define PRTTYP (DBetype)16384 /* Part */ #define BPLTYP (DBetype)32768 /* Bplane */ #define ALLTYP (DBetype)65535 /* Mask for all types */ /* ***An entity record header. */ typedef struct { DBetype type; /* Entity type */ DBptr p_ptr; /* Pointer to parent part */ DBptr n_ptr; /* Pointer to previous instance */ DBseqnum seknr; /* Sequence number */ DBordnum ordnr; /* Order number */ DBshort vers; /* Version number */ DBptr g_ptr[3]; /* Group pointers */ tbool blank; /* Visible TRUE/FALSE */ tbool hit; /* Hitable TRUE/FALSE */ DBshort pen; /* Pen/Color number */ DBshort level; /* Level/Layor number */ } GMRECH; /* ***A curve segment. */ #define CUB_SEG 1 /* Rational cubic (offset-)segment */ #define UV_SEG 2 /* Segment on a surface */ #define NURB_SEG 3 /* NURBS-span */ typedef struct { DBfloat c0x,c0y,c0z,c0; /* Segment-coefficients. */ DBfloat c1x,c1y,c1z,c1; /* UV_SEG only use 12. */ DBfloat c2x,c2y,c2z,c2; /* NURB_SEG use none */ DBfloat c3x,c3y,c3z,c3; DBptr nxt_seg; /* GM-Pointer to next segment */ DBfloat ofs; /* Optional offset */ DBfloat sl; /* Arclength in R3 */ DBshort typ; /* Segment type CUB_SEGU or UV_SEG */ DBshort subtyp; /* Sub type */ DBptr spek_gm; /* Optional GM-pointer to surface */ DBptr spek2_gm; /* Optional GM-pointer to surface */ DBptr cpts_db; /* DB-pointer to 4D controlpoints */ DBHvector *cpts_c; /* C-pointer to 4D controlpoints */ DBint ncpts; /* Number of cpts */ DBint offset_cpts; /* Offset for this span */ DBptr knots_db; /* DB-pointer to knotvector */ DBfloat *knots_c; /* C-pointer to knotvector */ DBint nknots; /* Number of knots */ DBint offset_knots; /* Offset for this span */ DBshort nurbs_degree; /* Degree (order-1) for NURB span */ } GMSEG; /* ***A Transformation. */ typedef struct { GMRECH hed_tf; /* Header */ DBTmat mat_tf; /* Matrix */ DBptr pcsy_tf; /* GM-pointer to coordinate system */ } GMTRF; /* ***A 2D or 3D point. */ typedef struct { GMRECH hed_p; /* Header */ DBVector crd_p; /* Coordinates */ DBptr pcsy_p; /* GM-pointer to coordinate system */ DBfloat wdt_p; /* Linewidth */ } GMPOI; /* ***A 2D or 3D line. */ typedef struct { GMRECH hed_l; /* Header */ DBshort fnt_l; /* Font */ DBfloat lgt_l; /* Dash length */ DBVector crd1_l; /* Start position */ DBVector crd2_l; /* End position */ DBptr pcsy_l; /* GM-pointer to coordinatesystem */ DBfloat wdt_l; /* Linewidth */ } GMLIN; /* ***A 2D or 3D Circle/Arc. */ typedef struct { GMRECH hed_a; /* Header */ DBshort fnt_a; /* Font */ DBfloat lgt_a; /* Dash length */ DBfloat x_a; /* Centre X-coordinate */ DBfloat y_a; /* Centre Y-coordinate */ DBfloat r_a; /* Radius */ DBfloat v1_a; /* Start angle */ DBfloat v2_a; /* End angle */ DBfloat al_a; /* Arclength in R3 */ DBshort ns_a; /* Number of segments, maximum 4 */ DBptr sptr_a; /* GM-pointer to 1:st segment */ DBptr pcsy_a; /* GM-pointer to coordinatesystem */ DBfloat wdt_a; /* Linewidth */ } GMARC; /* ***A 2D or 3D curve. */ typedef struct { GMRECH hed_cu; /* Header */ DBshort fnt_cu; /* Font */ DBfloat lgt_cu; /* Dash length */ DBfloat al_cu; /* Arclength in R3 */ DBshort ns_cu; /* Number of geometric segments */ DBTmat csy_cu; /* Optional curve plane */ tbool plank_cu; /* TRUE if curve is planar */ DBptr pcsy_cu; /* GM-pointer to coordinate system */ DBshort nsgr_cu; /* Number of graphical segments */ DBfloat wdt_cu; /* Linewidth */ } GMCUR; /* ***A 2D or 3D coordinate system. */ #define GMCNLN 10 /* Max length of name */ typedef struct { GMRECH hed_pl; /* Header */ char name_pl[GMCNLN+1]; /* Name + '\0' */ DBTmat mat_pl; /* Matrix */ DBptr pcsy_pl; /* GM-pointer to coordinate system */ } GMCSY; /* ***A 2D or 3D Bounded plane. */ typedef struct { GMRECH hed_bp; /* Header */ DBVector crd1_bp; /* Vertex 1 */ DBVector crd2_bp; /* Vertex 2 */ DBVector crd3_bp; /* Vertex 3 */ DBVector crd4_bp; /* Vertex 4 */ DBptr pcsy_bp; /* Pointer to coordinate system */ } GMBPL; /* ***A 2D or 3D Text. */ typedef struct { GMRECH hed_tx; /* Header */ DBVector crd_tx; /* Start position */ DBshort fnt_tx; /* Font */ DBfloat h_tx; /* Text height */ DBfloat b_tx; /* Text width */ DBfloat l_tx; /* Text slant */ DBfloat v_tx; /* Text direction */ DBshort nt_tx; /* Number of characters */ DBptr tptr_tx; /* GM-pointer to text string */ DBptr pcsy_tx; /* GM-pointer to coordinate system */ DBfloat wdt_tx; /* Linewidth */ DBshort pmod_tx; /* 0=2D, 1=3D screen mode, 2=3D true */ DBVector lpos_tx; /* Position in local system */ DBfloat lang_tx; /* Angle in local system */ } GMTXT; /* ***A 2D crosshatch. */ #define GMXMXL 1000 /* Max hatchlines in one GMXHT */ typedef struct { GMRECH hed_xh; /* Header */ DBshort fnt_xh; /* Font */ DBfloat lgt_xh; /* Dash length */ DBfloat dist_xh; /* Distance between lines */ DBfloat ang_xh; /* Line angle */ DBshort nlin_xh; /* Number of lines, max GMXMXL */ DBptr lptr_xh; /* GM-pointer to lines */ DBptr pcsy_xh; /* GM-pointer to coordinate system */ } GMXHT; /* ***A 2D Linear dimension. */ typedef struct { GMRECH hed_ld; /* Header */ DBVector p1_ld; /* Position 1 */ DBVector p2_ld; /* Position 2 */ DBVector p3_ld; /* Position 3 */ DBshort dtyp_ld; /* Type, horizontal/vertical/parallell */ DBfloat asiz_ld; /* Arrow size */ DBfloat tsiz_ld; /* Text size */ DBshort ndig_ld; /* Number of decimals */ tbool auto_ld; /* Auto text TRUE/FALSE */ DBptr pcsy_ld; /* GM-pointer to coordinate system */ } GMLDM; /* ***A 2D Circular dimension. */ typedef struct { GMRECH hed_cd; /* Header */ DBVector p1_cd; /* Position 1 */ DBVector p2_cd; /* Position 2 */ DBVector p3_cd; /* Position 3 */ DBshort dtyp_cd; /* Type, horizontal/vertical/parallell */ DBfloat asiz_cd; /* Arrow size */ DBfloat tsiz_cd; /* Text size */ DBshort ndig_cd; /* Number of decimals */ tbool auto_cd; /* Auto text TRUE/FALSE */ DBptr pcsy_cd; /* GM-pointer to coordinate system */ } GMCDM; /* ***A 2D Radius dimension. */ typedef struct { GMRECH hed_rd; /* Header */ DBVector p1_rd; /* Position 1 */ DBVector p2_rd; /* Position 2 */ DBVector p3_rd; /* Position 3 */ DBfloat r_rd; /* Radius */ DBfloat asiz_rd; /* Arrow size */ DBfloat tsiz_rd; /* Text size */ DBshort ndig_rd; /* Number of decimals */ tbool auto_rd; /* Auto text TRUE/FALSE */ DBptr pcsy_rd; /* GM-pointer to coordinate system */ } GMRDM; /* ***An 2D Angular dimension. */ typedef struct { GMRECH hed_ad; /* Header */ DBVector pos_ad; /* Position */ DBfloat r_ad; /* Radius */ DBfloat v1_ad; /* Start angle */ DBfloat r1_ad; /* Start radius */ DBfloat v2_ad; /* End angle */ DBfloat r2_ad; /* End radius */ DBfloat tv_ad; /* Text direction */ DBfloat asiz_ad; /* Arrow size */ DBfloat tsiz_ad; /* Text size */ DBshort ndig_ad; /* Number of decimals */ tbool auto_ad; /* Auto text TRUE/FALSE */ DBptr pcsy_ad; /* GM-pointer to coordinate system */ } GMADM; /* ***A Group. */ #define GMGNLN 20 /* Max length of name */ #define GMMXGP 100 /* Max number of members */ typedef struct { GMRECH hed_gp; /* Header */ char name_gp[GMGNLN+1]; /* Name + '\0' */ DBshort nmbr_gp; /* Number of members, max GMMXGP */ DBptr mptr_gp; /* GM-pointer to member table */ } GMGRP; /* ***A Part. */ #define GMPNLN 20 /* Max length of part name */ typedef struct { GMRECH hed_pt; /* Header */ char name_pt[GMPNLN+1]; /* Name + '\0' */ DBshort dummy_pt; /* Not used after V1.2 */ DBshort dts_pt; /* sizeof(GMPDAT) */ DBptr dtp_pt; /* GM-pointer to part-data */ DBptr itp_pt; /* GM-pointer to index table */ DBseqnum its_pt; /* Size of indextable */ } GMPRT; typedef struct { DBshort mtyp_pd; /* Module type, 2D/3D */ DBshort matt_pd; /* Module attribute */ DBptr csp_pd; /* GM-pointer to coordinate system */ DBshort npar_pd; /* Number of parameters */ DBptr typp_pd; /* GM-pointer to type array */ DBptr valp_pd; /* GM-pointer to value array */ DBshort vsiz_pd; /* Size of value array */ DBptr attp_pd; /* GM-pointer to graphical attributes */ DBshort asiz_pd; /* Size of graphical attributes */ } GMPDAT; /* ***Surfaces. */ #include "surdef.h" /* ***Any entity. */ typedef union { GMRECH hed_un; GMPOI poi_un; GMLIN lin_un; GMARC arc_un; GMCUR cur_un; GMSUR sur_un; GMTXT txt_un; GMXHT xht_un; GMLDM ldm_un; GMCDM cdm_un; GMRDM rdm_un; GMADM adm_un; GMGRP grp_un; GMCSY csy_un; GMPRT prt_un; GMBPL bpl_un; } GMUNON; /* ***GM database meta data. */ typedef struct { DBshort pagsiz; /* Pagesize (PAGSIZ) */ DBpagnum logmax; /* Currently allocated logical pages */ DBpagnum logusd; /* Currently used logical pages */ DBpagnum fysmax; /* Currently allocated RAM pages */ DBpagnum fysusd; /* Currently used RAM pages */ DBint pfsiz; /* Size of pagefile */ DBint pfcnt; /* Current number of pagefaults */ DBint wrcnt; /* Number of pages written */ DBint rdcnt; /* Number of pages read */ DBpagnum ipgnum; /* Current ID page */ DBpagnum dpgnum; /* Current data page */ DBshort datofs; /* Current offset within data page */ } GMMDAT; /* ***Function prototypes for the public DB API. */ #ifdef __cplusplus extern "C" { #endif /* Database init, load, save and clear */ DBstatus DBinit(char *filename, DBint cache_size, DBint version, DBint revision, char level); DBstatus DBload(char *filename, DBint cache_size, DBint version, DBint revision, char level); DBstatus DBexit(); DBstatus DBreset(); /* DB entity header read and update */ DBstatus DBread_header(GMRECH *hedptr, DBptr la); DBstatus DBupdate_header(GMRECH *hedptr, DBptr la); /* Transformation insert, read, update and delete */ DBstatus DBinsert_tform(GMTRF *trfptr, DBId *idptr, DBptr *laptr); DBstatus DBread_tform(GMTRF *trfptr, DBptr la); DBstatus DBupdate_tform(GMTRF *trfptr, DBptr la); DBstatus DBdelete_tform(DBptr la); /* Point insert, read, update and delete */ DBstatus DBinsert_point(GMPOI *poiptr, DBId *idptr, DBptr *laptr); DBstatus DBread_point(GMPOI *poiptr, DBptr la); DBstatus DBupdate_point(GMPOI *poiptr, DBptr la); DBstatus DBdelete_point(DBptr la); /* Line insert, read, update and delete */ DBstatus DBinsert_line(GMLIN *linptr, DBId *idptr, DBptr *laptr); DBstatus DBread_line(GMLIN *linptr, DBptr la); DBstatus DBupdate_line(GMLIN *linptr, DBptr la); DBstatus DBdelete_line(DBptr la); /* Circle/arc insert, read, update and delete */ DBstatus DBinsert_arc(GMARC *arcptr,GMSEG *geoseg,DBId *idptr,DBptr *laptr); DBstatus DBread_arc(GMARC *arcptr, GMSEG *geoseg, DBptr la); DBstatus DBupdate_arc(GMARC *arcptr, GMSEG *geoseg, DBptr la); DBstatus DBdelete_arc(DBptr la); /* Curve insert, read, update and delete etc. */ DBstatus DBinsert_curve(GMCUR *curptr, GMSEG *graseg, GMSEG *geoseg, DBId *idptr, DBptr *laptr); DBstatus DBread_curve(GMCUR *curptr, GMSEG **graseg, GMSEG **geoseg, DBptr la); DBstatus DBupdate_curve(GMCUR *curptr, GMSEG *geoseg, DBptr la); DBstatus DBdelete_curve(DBptr la); GMSEG *DBcreate_segments(DBint nseg); GMSEG *DBadd_segments(GMSEG *segptr, DBint nseg); DBstatus DBfree_segments(GMSEG *segptr); DBstatus DBwrite_nurbs(DBHvector *cpts, DBint ncpts, DBfloat *knots, DBint nknots, DBptr *cpts_la, DBptr *knots_la); /* Surface insert, read, update, deltete etc. */ DBstatus DBinsert_surface(GMSUR *surptr, GMPAT *tpptr, DBId *idptr, DBptr *laptr); DBstatus DBread_surface(GMSUR *surptr, DBptr la); DBstatus DBupdate_surface(GMSUR *surptr, DBptr la); DBstatus DBdelete_surface(DBptr la); DBstatus DBread_patches(GMSUR *surptr, GMPAT **ppatpt); DBstatus DBread_one_patch(GMSUR *surptr, GMPAT *patptr, DBshort iu, DBshort iv); char *DBcreate_patches(DBint pattyp, DBint numpat); DBstatus DBcreate_NURBS(GMPATNU *patptr); DBstatus DBfree_patches(GMSUR *surptr, GMPAT *patptr); DBstatus DBadd_srep_curves(GMSUR *surptr, GMSEG *sptarr[]); DBstatus DBread_srep_curves(GMSUR *surptr, GMSEG *sptarr[]); DBstatus DBdelete_srep_curves(GMSUR *surptr); DBstatus DBfree_srep_curves(GMSEG *sptarr[]); DBstatus DBadd_srep_NURBS(GMSUR *surptr, GLfloat *ku, GLfloat *kv, GLfloat *cpts); DBstatus DBread_srep_NURBS(GMSUR *surptr, GLfloat **ku, GLfloat **kv, GLfloat **cpts); DBstatus DBdelete_srep_NURBS(GMSUR *surptr); DBstatus DBfree_srep_NURBS(GLfloat *ku, GLfloat *kv, GLfloat *cpts); /* Coordinate system insert, read, update and delete */ DBstatus DBinsert_csys(GMCSY *csyptr, DBTmat *csymat, DBId *idptr, DBptr *laptr); DBstatus DBread_csys(GMCSY *csyptr, DBTmat *csymat, DBptr la); DBstatus DBupdate_csys(GMCSY *csyptr, DBTmat *csymat, DBptr la); DBstatus DBdelete_csys(DBptr la); /* B_plane insert, read, update and delete */ DBstatus DBinsert_bplane(GMBPL *bplptr, DBId *idptr, DBptr *laptr); DBstatus DBread_bplane(GMBPL *bplptr, DBptr la); DBstatus DBupdate_bplane(GMBPL *bplptr, DBptr la); DBstatus DBdelete_bplane(DBptr la); /* Text insert, read, update and delete */ DBstatus DBinsert_text(GMTXT *txtptr, char *strptr, DBId *idptr, DBptr *laptr); DBstatus DBread_text(GMTXT *txtptr, char *strptr, DBptr la); DBstatus DBupdate_text(GMTXT *txtptr, char *strptr, DBptr la); DBstatus DBdelete_text(DBptr la); /* Crosshatch insert, read, update and delete */ DBstatus DBinsert_xhatch(GMXHT *xhtptr, gmflt *crdptr, DBId *idptr, DBptr *laptr); DBstatus DBread_xhatch(GMXHT *xhtptr, gmflt *crdptr, DBptr la); DBstatus DBupdate_xhatch(GMXHT *xhtptr, gmflt *crdptr, DBptr la); DBstatus DBdelete_xhatch(DBptr la); /* Linear dimension insert, read, update and delete */ DBstatus DBinsert_ldim(GMLDM *ldmptr, DBId *idptr, DBptr *laptr); DBstatus DBread_ldim(GMLDM *ldmptr, DBptr la); DBstatus DBupdate_ldim(GMLDM *ldmptr, DBptr la); DBstatus DBdelete_ldim(DBptr la); /* Circular dimension insert, read, update and delete */ DBstatus DBinsert_cdim(GMCDM *cdmptr, DBId *idptr, DBptr *laptr); DBstatus DBread_cdim(GMCDM *cdmptr, DBptr la); DBstatus DBupdate_cdim(GMCDM *cdmptr, DBptr la); DBstatus DBdelete_cdim(DBptr la); /* Radius dimension insert, read, update and delete */ DBstatus DBinsert_rdim(GMRDM *rdmptr, DBId *idptr, DBptr *laptr); DBstatus DBread_rdim(GMRDM *rdmptr, DBptr la); DBstatus DBupdate_rdim(GMRDM *rdmptr, DBptr la); DBstatus DBdelete_rdim(DBptr la); /* Angular dimension insert, read, update and delete */ DBstatus DBinsert_adim(GMADM *admptr, DBId *idptr, DBptr *laptr); DBstatus DBread_adim(GMADM *admptr, DBptr la); DBstatus DBupdate_adim(GMADM *admptr, DBptr la); DBstatus DBdelete_adim(DBptr la); /* Group insert, read, update, delete, member add and delete */ DBstatus DBinsert_group(GMGRP *grpptr, DBptr *laarr, DBId *idptr, DBptr *laptr); DBstatus DBread_group(GMGRP *grpptr, DBptr *laarr, DBptr la); DBstatus DBupdate_group(GMGRP *grpptr, DBptr *laarr, DBptr la); DBstatus DBdelete_group(DBptr la); DBstatus DBadd_group_member(DBptr la, DBptr memla); DBstatus DBdelete_group_member(DBptr la, DBptr memla); DBstatus gmagpp(DBptr la, DBptr memla); /* Part open, close, read, update and delete */ DBstatus DBinsert_part(GMPRT *prtptr, GMPDAT *datptr, V2PATLOG typarr[], char valarr[], DBId *idptr, V2NAPA *npptr, DBptr *laptr); DBstatus DBclose_part(); DBstatus DBread_part(GMPRT *prtptr, DBptr la); DBstatus DBread_part_parameters(GMPDAT *datptr, V2PATLOG typarr[], char vlarr[], DBptr la, DBshort size); DBstatus DBupdate_part_parameter(GMPRT *prtptr, DBshort parnum, V2LITVA *newval); DBstatus DBread_part_attributes(char *attptr, DBint attsiz, DBptr la); DBstatus DBdelete_part(DBptr la); /* Named data insert, read and delete */ DBstatus DBinsert_named_data(char *key, DBint type, DBint size, DBint count, char *datptr); DBstatus DBread_named_data(char *key, DBint *type, DBint *size, DBint *count, char **datptr); DBstatus DBdelete_named_data(char *key); /* DBId to DBptr etc. */ DBstatus DBget_pointer(char fcode, DBId *id, DBptr *laptr, DBetype *typptr); DBstatus DBget_id(DBptr la, DBId *idptr); DBstatus DBget_highest_id(DBseqnum *numptr); DBstatus DBget_free_id(DBseqnum *numptr); /* GM search and traversal */ DBstatus DBset_root_id(DBId *id); DBstatus DBget_next_ptr(DBint trmode, DBetype typmsk, char *name, char *group, DBptr *laptr); /* Generic entity delete */ DBstatus DBdelete_entity(DBptr la, DBetype type); /* Get DB metadata */ DBstatus gmgtmd(GMMDAT *datptr); #ifdef __cplusplus } #endif /* Typedefs for the DBxxx namescheme of public datatypes */ typedef V3MDAT DBMetadata; typedef V3MSIZ DBSystemsize; typedef GMRECH DBHeader; typedef GMPOI DBPoint; typedef GMLIN DBLine; typedef GMARC DBArc; typedef GMCUR DBCurve; typedef GMSEG DBSeg; typedef GMSUR DBSurf; typedef GMPAT DBPatch; typedef GMBPL DBBplane; typedef GMTXT DBText; typedef GMCSY DBCsys; typedef GMLDM DBLdim; typedef GMCDM DBCdim; typedef GMRDM DBRdim; typedef GMADM DBAdim; typedef GMXHT DBHatch; typedef GMPRT DBPart; typedef GMPDAT DBPdat; typedef GMUNON DBAny;