#ifndef IGESMAIN_H #define IGESMAIN_H /* III GGGG EEEEE SSSS M M AAA III N N H H ** I G E S MM MM A A I NN N H H ** I G GGG EEEE SSS M M M AAAAA I N N N HHHHH ** I G G E S M M M A A I N NN .. H H ** III GGG EEEEE SSSS M M A A III N N .. H H ** ** Copyright 1993-1997 by dennette@wiz-worx.com All rights reserved. */ // Copyright (c) 2010 by Dennette@WiZ-WORX.com (Washington, DC) // you should uncomment the appropriate #define for your // environment ... note that 'MSDOS' is already defined // by the Microsoft compiler, but others (like Borland) // will require this #define // 2004-04-01 DAH - MSC compiler predefines "WIN32" // so use that to infer platform // 2004-04-09 DAH - kludge time ... the code looks for MSDOS because // of the legacy compiler ... this variable must be // expicitly set with MS Visual Studio VC++ ////// hardware/OS specific definitions ////// #ifdef WIN32 #define MSDOS 1 #endif #ifndef MSDOS //#define SUN 1 //#define VAXVMS 1 //#define LINUX 1 #endif #include #include #include #include #include #include #ifndef SUN #include #endif #ifndef LINUX char *strdup(); #endif #ifdef MSDOS #include #include #include #include #include #include #include #define OPEN_MODE O_RDONLY|O_BINARY #endif #ifdef VAXVMS #include #include #define OPEN_MODE O_RDONLY,0,"ctx=stm" #define unlink(f) delete(f) #endif #ifdef SUN #define SEEK_SET 0 #define SEEK_CUR 1 #define SEEK_END 2 #define OPEN_MODE O_RDONLY double atof(); #endif #ifdef LINUX #define SEEK_SET 0 #define SEEK_CUR 1 #define SEEK_END 2 #define OPEN_MODE O_RDONLY double atof(); #endif ////// **END** hardware specific definitions ////// #define CHKMALLOC(VAL,NAM) if((VAL)==NULL){fprintf(stderr,"\n\007*** No More Memory - WISL:%s\n",(NAM));exit(1);} #define ENV_DFND(v) (strcmp(chkenv(v),(v))!=0) #define EOR (-1) #define FALSE (0) #define FREE(x) if((x)!=NULL)free((x)) #define MAXSTR 128 #define MSG(x) fprintf(stderr,"%s\n",(x)) #define NLINE MSG(" ") #define NEWLINE printf("\n") #define OF_NAME "WiZ_WORX.igs" #define PRI_SPACE printf("") #define PRI_FBRK(x) printf(":%s",(x));break #define PRI_BRK(x) printf(" - %s",(x));break #define PRI_DFLT printf("") #define PRI_IMPL printf(" - < Implementor Defined >") #define PRI_NOTS printf("\n*** This entity:form is not supported ***\n\n") #define PRI_PNTR printf(" - < DE Pointer >") #define PRI_UNDF printf(" - ?? UNDEFINED ??") #define PRI_UNSP printf(" - Not Specified") #define REGISTERED (strcmp(strupr(chkenv("WIZWORX")),"PAID")==0) #define UNDEFENV(x) (strcmp(strupr(chkenv((x))),(x))==0) #define TRUE (1) #define U_INTEGER 1 #define U_REAL 2 #define U_STRING 3 #define U_POINTER 4 #define U_LOGICAL 6 #define VER_DATE __DATE__ /* these data types are defined for portability and to support ** the concept of "defaulted" fields */ typedef long PNTR; typedef struct _real { double rval; char rdef; } REAL; typedef struct _intg { long ival; char idef; } INTG; typedef struct _text { char *tval; char tdef; } TEXT; typedef struct _pt2d { REAL xy[2]; } PT2D; typedef struct _pt3d { REAL xyz[3]; } PT3D; typedef union _vari { INTG vari_i; REAL vari_r; TEXT vari_t; } VARI; typedef struct _unkn { int utyp; VARI uval; } UNKN; /* this structure is used by various dispatchers */ typedef struct _numfnc { int entnum; void (*entfnc)(); } NUMFNC; /*** this is the heart of WISL ... the ENTITY structure ***/ typedef struct _entity { /* DE fields */ int e_type; PNTR e_de; /* added 08-sep-94 */ PNTR e_pdp, e_plc; INTG e_strct, e_lfont, e_level, e_view, e_matrx, e_ldisp; INTG e_blank, e_subor, e_use, e_hier; INTG e_lwgt, e_color, e_form, e_subs; TEXT e_label; /* PD bit-bucket */ char *e_pdata; /* additional pointers (See 2.2.4.4.2) */ INTG e_acnt, *e_assoc; INTG e_pcnt, *e_prop; } ENTITY; /* this structure is used for finding references to any entity */ typedef struct _node { PNTR de_ptr; int section; int field; struct _node *next; } ENTREF; #define SEC_DE 0 #define SEC_PD 1 #define SEC_ASSOC 2 #define SEC_PROP 3 #define DE_STRCT 3 #define DE_LFONT 4 #define DE_LEVEL 5 #define DE_VIEW 6 #define DE_MATRX 7 #define DE_LDISP 8 #define DE_LWGT 12 #define DE_COLOR 13 /* the major routines a "user" would call */ /* there are others, but defaulting to "int" is o.k. */ PNTR openiges(char *filename); /* open input IGES file */ void outfopen(char *filename); /* open output IGES file */ PNTR addent(PNTR de); void freent(ENTITY *ent); void getent(PNTR de, ENTITY *ent); void lstent(PNTR de, ENTITY *ent); PNTR putent(ENTITY *ent); void refent(PNTR de); void init_ref(PNTR de_max); void rst_de(void); char *igesdate(void); char *chkenv(char *varname); #endif