/*-------------------------------------------------------------------+
|                                                                    |
|                      S A S / C   S A M P L E                       |
|                                                                    |
|         NAME: OSISPF                                               |
|     LANGUAGE: C                                                    |
|      PURPOSE: Establishes ISPF macros to simplify calls            |
| INSTALLATION: #include "osispf.h"                                  |
|               Where this PDS has the DDname H                      |
|      COMPILE: None                                                 |
|         LINK: None                                                 |
|        INPUT: None                                                 |
|       OUTPUT: None                                                 |
|        USAGE: At compile time for the routine using the header     |
|               define the PDS containing this member as H and       |
|               include as seen above.                               |
| SYSTEM NOTES: Written for MVS only.                                |
|   MISC NOTES: BE SURE TO USE THE COMPILER OPTION - AT              |
|               When using a dummy parm (ie: DUMMY/DUMNUM/other)     |
|                be sure to use the correct type.  If not an         |
|                ABEND 0C4 can occur from ISPF.                      |
|                                                                    |
|               When calling VDEFINE for a "FIXED"-type variable     |
|               the C variable name(the second argument to the       |
|               VDEFINE macro) must be prefixed with the @-operator. |
|                                                                    |
|                                                                    |
+-------------------------------------------------------------------*/
#eject


/* misc names */
#define DUMMY " "
#define DUMNUM 0


/* display services */
#define DISPLAY(panel, msgid, field) \
 __asm_ISPLINK("DISPLAY ", panel, msgid, field)
#define TBDISPL(table, panel, msgid, field) \
 __asm_ISPLINK("TBDISPL ", table, panel, msgid, field)
#define SETMSG(msgid) \
 __asm_ISPLINK("SETMSG  ", msgid)

/* table services - general */
#define TBCREATE(table, keyname, name, access, type) \
 __asm_ISPLINK("TBCREATE", table, keyname, name, access, type)
#define TBOPEN(table, access) \
 __asm_ISPLINK("TBOPEN  ", table, access)
#define TBQUERY(table, qkey, qvar, qrow, qkeyn, qname, qcrp) \
 __asm_ISPLINK("TBQUERY ", table, qkey, qvar, qrow, qkeyn, qname, qcrp)
#define TBSAVE(table, copy, alt, perc, libname) \
 __asm_ISPLINK("TBSAVE  ", table, copy, alt, @(perc), libname)
#define TBCLOSE(table, copy, alt, perc, libname) \
 __asm_ISPLINK("TBCLOSE ", table, copy, alt, @(perc), libname)
#define TBEND(table) \
 __asm_ISPLINK("TBEND   ", table)
#define TBERASE(table, libname) \
 __asm_ISPLINK("TBERASE ", table, libname)

 /* table services - row operations */
#define TBADD(table, name) \
 __asm_ISPLINK("TBADD   ", table, name)
#define TBDELETE(table) \
 __asm_ISPLINK("TBDELETE", table)
#define TBGET(table, var) \
 __asm_ISPLINK("TBGET   ", table, var)
#define TBPUT(table, name) \
 __asm_ISPLINK("TBPUT   ", table, name)
#define TBMOD(table, name) \
 __asm_ISPLINK("TBMOD   ", table, name)
#define TBEXIST(table) \
 __asm_ISPLINK("TBEXIST ", table)
#define TBSCAN(table, name, var) \
 __asm_ISPLINK("TBSCAN  ", table, name, var)
#define TBSARG(table, name) \
 __asm_ISPLINK("TBSARG  ", table, name)
#define TBTOP(table) \
 __asm_ISPLINK("TBTOP   ", table)
#define TBBOTTOM(table, var) \
 __asm_ISPLINK("TBBOTTOM", table, var)
#define TBSKIP(table, val, var) \
 __asm_ISPLINK("TBSKIP  ", table, @(val), var)
#define TBVCLEAR(table) \
 __asm_ISPLINK("TBVCLEAR", table)

/* file tailoring services */
#define FTOPEN(name) \
 __asm_ISPLINK("FTOPEN  ", name)
#define FTINCL(skel, opt) \
 __asm_ISPLINK("FTINCL  ", skel, opt)
#define FTCLOSE(member, libname, opt) \
 __asm_ISPLINK("FTCLOSE ", member, libname, opt)
#define FTERASE(member, libname) \
 __asm_ISPLINK("FTERASE ", member, libname)

/* variable services */
#define VGET(name, opt) \
 __asm_ISPLINK("VGET    ", name, opt)
#define VPUT(name, opt) \
 __asm_ISPLINK("VPUT    ", name, opt)
#define VDEFINE(name, var, form, len, opt, udata) \
 __asm_ISPLINK("VDEFINE ", name, var, form, @(len), opt, @(udata))
#define VDELETE(name) \
 __asm_ISPLINK("VDELETE ", name)
#define VCOPY(name, vlen, vval, opt) \
 __asm_ISPLINK("VCOPY   ", name, @(vlen), vval, opt)
#define VREPLACE(name, vlen, vval) \
 __asm_ISPLINK("VREPLACE", name, @(vlen), @(vval))
#define VRESET() \
 __asm_ISPLINK("VRESET  ")

/* other services */
#define SELECT(len, buff) \
 __asm_ISPLINK("SELECT  ", @(len), buff)
#define CONTROL(type, mode, line) \
 __asm_ISPLINK("CONTROL ", type, mode, @(line))
#define BROWSE(dsname, serial, psw) \
 __asm_ISPLINK("BROWSE  ", dsname, serial, psw)
#define EDIT(dsname, serial, psw) \
 __asm_ISPLINK("EDIT    ", dsname, serial, psw)
#define LOG(msgid) \
 __asm_ISPLINK("LOG     ", msgid)