2. Embedded QUEL for C : C Variables and Data Types : Variable and Type Declarations : Concluding Example
 
Share this page                  
Concluding Example
The following example demonstrates some simple EQUEL/C declarations:
## define MAX_PERSONS 1000
## typedef struct datatypes_ /* Structureof all types */
## {
##    char        d_byte;
##    short       d_word;
##    long        d_long;
##    float       d_single;
##     double         d_double;
##     char         *d_string;
##  } datatypes;

##  datatypes d_rec;

##  char    *dbname = "personnel";
##  char    *formname, *tablename, *columnname;
##  varchar struct {
##        short        len;
##        char        binary_data[512];
##  } binary_chars;
##  enum color {RED, WHITE, BLUE};

##  unsigned int                empid;
##  short int                vac_balance;
##  struct person_ /* Structure with a union */
##  {
##        char     age;
##        long   flags;
##        union
##        {
##         char full_name[30];
##         struct {
##           char       firstname[12],
##                          lastname[18];
##           } name_parts;
##        } person_name;
##  } person, *newperson, person_store[MAX_PERSONS];
UNIX:
##  extern int *empform,*deptform; /* Compiled forms */ 
VMS:
## globalref int *empform, *deptform; /*Compiled forms*/