/*-------------------------------------------------------------------+
|                  COPYRIGHT (C) 1995, SAS INSTITUTE INC.            |
|                    UNPUBLISHED - ALL RIGHTS RESERVED               |
|                       S A S / C   S A M P L E                      |
|                                                                    |
|         NAME: GDDM.H                                               |
|     LANGUAGE: C                                                    |
|      PURPOSE: This header file is included by the BARCHART sample  |
|               program.  It contains definitions of macros used     |
|               to call GDDM functions.  Only those functions used   |
|               by the sample program are included.                  |
|                                                                    |
|               This header file can be used to cause the sample     |
|               program to call either the non-reentrant or the      |
|               reentrant version of the GDDM functions.  The        |
|               desired interface is controlled by the definition    |
|               of the preprocessor symbol GDDMRENT.  If GDDMRENT    |
|               is defined, the reentrant functions are used;        |
|               otherwise, the non-reentrant functions are used.     |
|                                                                    |
+-------------------------------------------------------------------*/


/*-------------------------------------------------------------------*/
/*                                                                   */
/*  Define the GDDM Application Anchor Block (AAB) only if the       */
/*  GDDMRENT symbol is defined.  If GDDMRENT is not defined, AAB is  */
/*  defined to a null string.  AABNC is defined without the trailing */
/*  comma, so we don't cause syntax errors if AAB is the only        */
/*  argument.                                                        */
/*                                                                   */
/*-------------------------------------------------------------------*/

#ifdef GDDMRENT

struct aab
{
     short sc;                 /* GDDM severity code                 */
     short ec;                 /* GDDM error code                    */
     void * ap;                /* GDDM anchor pointer                */
} aab = { 0, 0, NULL };

#define AAB @aab,
#define AABNC @aab

#else

#define AAB
#define AABNC

#endif

/*-------------------------------------------------------------------*/
/*                                                                   */
/*  Functions beginning with A                                       */
/*                                                                   */
/*-------------------------------------------------------------------*/

#define ascget(field_id,length,string) \
     __asm_ascget (AAB @(field_id), @(length), string)

#define ascput(field_id,length,string) \
     __asm_ascput (AAB @(field_id), @(length), string)

#define asdfld(field_id,row,column,depth,width,type) \
     __asm_asdfld (AAB @(field_id), @(row), @(column), @(depth), \
                   @(width), @(type))

#define asdflt(count,array) \
     __asm_asdflt (AAB @(count), array)

#define asdfmt(n_fields,count,array) \
     __asm_asdfmt (AAB @(n_fields), @(count), array)

#define asfcol(field_id,color) \
     __asm_asfcol (AAB @(field_id), @(color))

#define asfcur(field_id,row,column) \
     __asm_asfcur (AAB @(field_id), @(row), @(column))

#define asftyp(field_id,type) \
     __asm_asftyp (AAB @(field_id), @(type))

#define asread(attype,attval,count) \
     __asm_asread (AAB @(attype), @(attval), @(count))


/*-------------------------------------------------------------------*/
/*                                                                   */
/*  Functions beginning with F                                       */
/*                                                                   */
/*  Note that there are two different definitions of the fsinit      */
/*  macro depending on the setting of the GDDMRENT symbol.           */
/*                                                                   */
/*-------------------------------------------------------------------*/

#define fsalrm() \
     __asm_fsalrm (AABNC)

#ifdef GDDMRENT
#define fsinit() \
     __asm_fsinr (AABNC)
#else
#define fsinit() \
     __asm_fsinn ()
#endif

#define fsterm() \
     __asm_fsterm (AABNC)

/*-------------------------------------------------------------------*/
/*                                                                   */
/*  Functions beginning with G                                       */
/*                                                                   */
/*-------------------------------------------------------------------*/

#define gsarea(control) \
     __asm_gsarea (AAB @(control))

#define gscb(width,height) \
     __asm_gscb (AAB @(width), @(height))

#define gschar(x,y,length,string) \
     __asm_gschar (AAB @(x), @(y), @(length), string)

#define gscm(n) \
     __asm_gscm (AAB @(n))

#define gscol(n) \
     __asm_gscol (AAB @(n))
#define WHITE -2
#define BLACK -1
#define DEFAULT 0
#define BLUE 1
#define RED 2
#define MAGENTA 3
#define GREEN 4
#define CYAN 5
#define YELLOW 6
#define NEUTRAL 7
#define BACKGROUND 8

#define gscs(symbol_set_id) \
     __asm_gscs (AAB @(symbol_set_id))

#define gsenda() \
     __asm_gsenda (AABNC)

#define gsline(x,y) \
     __asm_gsline (AAB @(x), @(y))

#define gslss(type,symbol_set_name,symbol_set_id) \
     __asm_gslss (AAB @(type), symbol_set_name, @(symbol_set_id))

#define gslw(linewidth) \
     __asm_gslw (AAB @(linewidth))

#define gsmove(x,y) \
     __asm_gsmove (AAB @(x), @(y))

#define gsplne(count,xarray,yarray) \
     __asm_gsplne (AAB @(count), xarray, yarray)

#define gsqcb(x,y) \
     __asm_gsqcb (AAB @(x), @(y))

#define gsqtb(length,string,count,x_array,y_array) \
     __asm_gsqtb (AAB @(length), string, @(count), x_array, y_array)

#define gsscls() \
     __asm_gsscls (AABNC)

#define gssdel(segment_id) \
     __asm_gssdel (AAB @(segment_id))

#define gsseg(segment_id) \
     __asm_gsseg (AAB @(segment_id))

#define gsuwin(x1,x2,y1,y2) \
     __asm_gsuwin (AAB @(x1), @(x2), @(y1), @(y2))