home *** CD-ROM | disk | FTP | other *** search
- /* sybfrs.h 49.1 4/14/89 */
-
- /*
- ** SYBFRS.H
- **
- ** Forms runtime system (frs) object definitions.
- */
-
- /* If screenio.h hasn't been included yet, go and get it. */
-
- #ifndef SCREENIO
- #include <screenio.h>
- #endif
-
- /*
- ** Basic types
- */
- typedef short SYMTYPE;
- typedef DBINT ID;
- typedef short OBJTYPE;
- typedef short PICTYPE;
- typedef short LINTYPE;
- typedef short SELSTATE;
- typedef short MENURETURN;
- typedef short DATATYPE;
-
- /*
- ** Flag definitions for the flags in the field, group and form structures.
- ** These flags are used by clients when calling flags set/clear functions.
- */
-
- #define FRS_NOSTOP 0x1
- #define FRS_READONLY 0x2
- #define FRS_MUSTENTER 0x4
- #define FRS_INVISIBLE 0x8
- #define FRS_NOINIT 0x10
- #define FRS_ORDERED 0x20
- #define FRS_RETMENUS 0x40
- #define FRS_CHARMOVE 0x80
- #define FRS_SAVEMODS 0x100
- #define FRS_NOECHO 0x200
- #define FRS_HILITE 0x400
- #define FRS_MODIFIED 0x800
- #define FRS_NOREDRAW 0x1000
- #define FRS_TYPECHECK 0x2000
- #define FRS_AUTOTAB 0x4000
- #define FRS_SAVEORIG 0x8000
- #define FRS_INHERITFKEY 0x10000
-
- /*
- ** Flag definitions for the flags offered as fsprint options.
- */
- #define FRS_HEADER 0x1
-
- /*
- ** Maximum Nesting level for groups.
- */
-
- #define MAXNEST 10
-
- /*
- ** Display and data list traversal types.
- */
-
- typedef short TRAVTYPE;
-
- #define TRAVVIS (TRAVTYPE)0
- #define TRAVALL (TRAVTYPE)1
- #define TRAVTPLT (TRAVTYPE)2
- #define TRAVCLR (TRAVTYPE)3
-
- /*
- ** Defines used by frsrefresh.
- */
-
- #define WRTFLPROMPT 1
- #define WRTGPPROMPT 2
- #define WRTDATA 4
- #define WRTFEDDATA 8
-
- /*
- ** Defines used for scrolling groups and picklists.
- */
-
- #define FRS_SCROLLUP 1
- #define FRS_SCROLLDOWN 2
- #define FRS_ASCROLLUP 3
- #define FRS_ASCROLLDOWN 4
-
- /*
- ** Defines used by frslocpic.
- */
-
- typedef int LOCTYPE;
-
- #define OFFFLD (LOCTYPE)0
- #define ONFLD (LOCTYPE)1
-
- /*
- ** Define used by frsvalues.
- */
-
- #define FRSVALUES_SEP '\001'
-
- /*
- ** Defines used when adding objects to linked lists.
- */
-
- #define TO_BEGINNING 1
- #define TO_END 2
- #define TO_RELATIVE 3
-
- /*
- ** Define used to control quitting a processing list in frsprocess().
- */
- #define PROCESS_QUIT 2
-
- /*
- ** Index Descriptor.
- */
-
- typedef struct objindex
- {
- int oinumindex; /* Number of indexes in index array */
- int oiindexes[MAXNEST]; /* Actual indexes (zero based) */
- } OBJINDEX;
-
- /*
- ** Form Descriptor.
- */
-
- typedef struct formdsc
- {
- ID fmdid; /* Form id */
- char *fmdname; /* Form name */
- char *fmdversion; /* Form version */
- } FORMDSC;
-
- /*
- ** Form symbol table record.
- */
-
- typedef struct formst
- {
- char *fst_name; /* Pointer to name of symbol in the form. */
- ID fst_id; /* ID of the field, group, or menu item. */
- SYMTYPE fst_type; /* Type of symbol (see symbol types above) */
- POINTER fst_dsc; /* Descriptor for symbol */
- } FORMST;
-
- /*
- ** Useform structure.
- */
-
- typedef struct useformrec
- {
- ID objid; /* object id in form */
- char *name; /* pointer to name string */
- SYMTYPE stype; /* symbol type */
- DBINT sdatatype; /* datatype */
- int index; /* poition in list, 1 = first */
- struct useformrec *parent; /* NULL if not grouped */
- struct useformrec *next; /* next in list; NULL ends */
- } USEFORMREC;
-
- /*
- ** Line Descriptor.
- */
-
- #define FRMVERTLINE (LINTYPE)0
- #define FRMHORIZLINE (LINTYPE)1
-
- typedef struct frmline
- {
- LINTYPE liorient; /* Line orientation (horiz or vertical) */
- REGION liregion; /* Region of line */
- REGION lioldreg; /* New region (used by move, copy) */
- struct frmline *linext; /* Next line in the list */
- struct frmline *liprev; /* Previous line in the list */
- } FRMLINE;
-
- /*
- ** Box Descriptor.
- */
-
- typedef struct frmbox
- {
- REGION bxregion; /* Region of the box */
- REGION bxoldreg; /* New region (used by move, copy) */
- struct frmbox *bxnext; /* Next box in list */
- struct frmbox *bxprev; /* Previous box in list */
- } FRMBOX;
-
- /*
- ** Database table descriptor.
- */
-
- typedef struct tbldsc
- {
- char *tdsitename; /* Site name.*/
- char *tddbname; /* Database name.*/
- char *tdowner; /* Table owner name. */
- char *tdtablename; /* Table name.*/
- char *tdcolname; /* Column name.*/
- } TBLDSC;
-
- /*
- ** SQL Descriptor.
- */
-
- typedef struct sqldsc
- {
- char *sqltext; /* Actual SQL statement (NULL if stored proc) */
- char *sqlname; /* Name of the stored procedure */
- struct objlist *sqlargs; /* Arguments to the stored procedure */
- } SQLDSC;
-
- /*
- ** Message Descriptor.
- */
-
- typedef struct msgdsc
- {
- char *msgname; /* Message name */
- char *msgtext; /* Text of message */
- FONT msgfont; /* Font of message */
- SYBCOLOR msgcolor; /* Color of message */
- VIDEO msgvideo; /* Video attributes of the message */
- short msgx; /* x-coord (upper left corner of msg window) */
- short msgy; /* y-coord (upper left corner of msg window) */
- } MSGDSC;
-
- /*
- ** Prompt Descriptor.
- */
-
- typedef struct prompt
- {
- char *prtext; /* Text of prompt */
- FONT prfont; /* Prompt's font */
- SYBCOLOR prcolor; /* Color of prompt text */
- VIDEO prvideo; /* Video attributes of prompt */
- REGION prregion; /* Prompt's region on the form */
- REGION proldreg; /* New region (used in move, copy) */
- } PROMPT;
-
- /*
- ** Rule Descriptor
- */
-
- typedef struct ruledsc
- {
- char *rlmsg; /* Rule error message. */
- char *rlname; /* Name of DataServer rule */
- char *rlquery; /* SQL query for rule at run time. */
- DBDATETIME rldate; /* DS rule mod date */
- } RULEDSC;
-
- /*
- ** Rule/Default structure for holding query results.
- */
- typedef struct rl_def
- {
- char *owner;
- char *table;
- char *column;
- char *name;
- char *text;
- DBTINYINT coltype;
- DBTINYINT collen;
- DBDATETIME ruledate;
- DBDATETIME getdate;
- struct rl_def *next;
- }RL_DEF;
-
- /*
- ** Data Descriptor.
- */
-
- #define SSON (SELSTATE)1
- #define SSOFF (SELSTATE)0
-
- typedef struct datadsc
- {
- char *ddval; /* Pointer to data (char string) */
- char *ddoval; /* Pointer to original data */
- char *ddpval; /* Pointer to previous data */
- DBINT ddmaxlen; /* Maximum buffer len (not incl NULL) */
- DBINT ddcurlen; /* Current length of data */
- ID ddid; /* Id of this item (auto generated) */
- SELSTATE ddcurstate; /* Current select state */
- SELSTATE ddinitstate; /* Initial select state */
- SELSTATE ddorigstate; /* Original select state */
- struct datadsc *ddnext; /* Next item in list */
- struct datadsc *ddprev; /* Previous item in list */
- } DATADSC;
-
- /*
- ** Data Cell Descriptor.
- */
-
- typedef struct datacell
- {
- int dcoffset; /* Offset into the datacell list */
- REGION dcregion; /* Datacell's region on the form */
- REGION dcoldreg; /* New region (used by move, copy) */
- FONT dcfont; /* Data item's font */
- SYBCOLOR dccolor; /* Data item's color */
- struct datacell *dcnext; /* Next datacell in list */
- struct datacell *dcprev; /* Previous datacell in list */
- } DATACELL;
-
- /*
- ** Exit field To indicate an exit of the current form, call frsexitform
- ** which sets the current field and datacell pointers to NULL.
- */
-
- typedef SYMTYPE FLDTYPE;
-
- #define FDTEXIT (FLDTYPE)0
-
- /*
- ** Rotating Select 1 display cell, N value rotation of data,
- ** Rotating Choice exactly one must be visible (and hence picked)
- ** at any given time.
- */
-
- #define FDTROTSEL (FLDTYPE)1
-
- /*
- ** Exclusive Select N display cells, N data items, pick to choose,
- ** Single Choice exactly one must be picked at any given time.
- */
-
- #define FDTEXSEL (FLDTYPE)2
-
- /*
- ** Any Select N displayed cells, N data items, toggle on/off,
- ** Multi Choice any number of cells (>= 0) may be on at one time.
- */
-
- #define FDTANYSEL (FLDTYPE)3
-
- /*
- ** Entry Basic data entry field.
- */
-
- /*
- ** The actual data buffers pointed to by the entry struct, by fecurval,
- ** by feival and by fepval must be allocated and pointed to when
- ** initializing the form. They all have length of feenlen.
- ** Furthermore, the datacells data pointer (dcdata) will be initialized to
- ** point to the data buffer pointed to by the entry struct.
- */
-
- #define FDTENTRY (FLDTYPE)4
-
- typedef struct fdentry
- {
- int femaxlen; /* Maximum data buffer size */
- /* Datacell width should be */
- /* femaxlen + 2 (microscroll) */
- char *feidata; /* Initial value (as a str) */
- char *fevalues; /* Value key string. */
- POINTER feplist; /* Saved popup list */
- struct
- {
- unsigned fefnoecho:1; /* No echo */
- unsigned fefdelimit:1; /* Show entry region bounds */
- unsigned fefallownewline:1; /* Allow nl in text */
- unsigned fefvalissql:1; /* Value is an sql stmt.*/
- unsigned fefalwaysload:1; /* For values generated by */
- /* SQL, retrieve them every */
- /* time the values key is hit.*/
- unsigned fefrunrule:1; /* Run the DataServer rule.*/
- unsigned fefdsrule:1; /* Run rule via DataServer.*/
- unsigned fefdsdefault:1; /* Use DataServer col default.*/
- } feflags; /* Entry flags */
- char *feinformat; /* Input format */
- char *feoutformat; /* Output format */
- RULEDSC *ferule; /* Rule information. */
- } FDENTRY;
-
- /*
- ** Trim Read-only, non-tabable descriptive text on the form.
- ** Annotation. The trim is the field's prompt - it has no other attributes.
- */
-
- #define FDTTRIM (FLDTYPE)5
-
- /*
- ** Hidden A field, occupying no display space on the form which may
- ** be read or written during processing only. These fields
- ** are the basis of temporary variables of an application.
- */
-
- #define FDTHIDDEN (FLDTYPE)6
-
- typedef struct fdhidden
- {
- char *fhidata; /* Initial data value */
- int fhmaxlen;
- } FDHIDDEN;
-
- /*
- ** Derived A readonly, single valued field whose value is derived from
- ** Spreadsheet other fields and is updated ONLY when any of those fields
- ** change.
- */
-
- #define FDTDERIVED (FLDTYPE)7
-
- /*
- ** PickList A readonly list of options (in table format) which is scrollable
- ** Menufield (ie., more items that display lines) which, when picked, act
- ** like an exclusive or any select.
- */
-
- #define FDTPICKLIST (FLDTYPE)8
-
- #define SINGLEVAL (PICTYPE)1
- #define MULTIVAL (PICTYPE)2
-
- typedef struct fdpicklist
- {
- int fppictype; /* Any or exclusive choice */
- SQLDSC *fpsql; /* SQL statement or stored */
- /* procedure name to get data */
- } FDPICKLIST;
-
- /*
- ** Processing Events.
- */
-
- #define PRC_PRE 1
- #define PRC_PICK 2
- #define PRC_POST 3
- #define PRC_RULE 4
-
- /*
- ** Processing Types (positive!).
- */
-
- #define PRC_CALLFPL 1
- #define PRC_CALLEXTERNAL 2
- #define PRC_CALLFORM 3
- #define PRC_CALLSUPPLIED 4
- #define PRC_CALLBUILD 5
-
- /*
- ** FPL Descriptor.
- */
-
- typedef struct fpldsc
- {
- int fpltype; /* Processing type */
- char *fplname; /* Name of 3GL/FPL procedure */
- char *fplversion; /* Version of FPL procedure */
- struct objlist *fplparams; /* Parameter list */
- struct fpldsc *fplnext; /* Next link for fpldsc list */
- struct fpldsc *fplprev; /* Prev link for fpldsc list */
- } FPLDSC;
-
- /*
- ** Procedure reference array.
- */
-
- #define MAXARGS 10
-
- typedef struct frsprocedure
- {
- char *fpname; /* Procedure name (as known to frs) */
- INTFUNCPTR fpproc; /* Pointer to the procedure */
- POINTER *fpargs; /* Ptr to array of pointers to args */
- int fplang; /* Language of the procedure */
- } FSPROCEDURE;
-
- typedef FSPROCEDURE FRSPROCEDURE; /* Accomodate obsolescent name. */
-
- /*
- ** Field Structure.
- */
-
- typedef struct field
- {
- ID flid; /* Field id (internal use only) */
- TBLDSC *fltable; /* Associated table info */
- char *flname; /* Field name */
- char *fldesc; /* Description of the field */
- int flnumcells; /* Number of data cells */
- DATACELL *flcells; /* Display cells for this field */
- DBINT fldatatype; /* Type of data in these cells */
- short fldatlen; /* Maximum length of the data */
- struct
- {
- unsigned flfmustenter:1;/* Must enter or specify a value */
- unsigned flfinputpnd:1; /* Input pending on this field */
- unsigned flfinvisible:1;/* Field not visible on the form */
- unsigned flfnostop:1; /* May not stop on this field */
- unsigned flfinparam:1; /* Input parameter for form */
- unsigned flfretparam:1; /* Return parameter for form */
- unsigned flfstatic:1; /* Do not initialize value from init */
- /* each time the form is called */
- unsigned flfreadonly:1; /* Readonly */
- unsigned flfautotab:1; /* Automatically go to next
- field when all characters
- entered */
- unsigned flfkeyfield:1; /* Field is a key for a table */
- } flflags; /* Field flags */
- PROMPT *flprompt; /* Prompt for the field */
- PROMPT *floldprompt; /* Used by the forms editor (undo) */
- FLDTYPE fltype; /* Field type (see types above) */
- POINTER flfield; /* Pointer to a specific field type */
- FPLDSC *flpreprc; /* Field pre processing */
- FPLDSC *flpickprc; /* Field pick processing */
- FPLDSC *flruleprc; /* Field rule processing */
- FPLDSC *flpostprc; /* Field post processing */
- char *flhelp; /* Field help text. */
- } FIELD;
-
- /*
- ** Group structure.
- */
-
- typedef struct group
- {
- ID gpid; /* Group id (internal use only ) */
- char *gpname; /* Group name */
- char *gpdesc; /* Description of the group */
- int gplinperrow; /* Number of display lines per row */
- int gpdisprows; /* Number of rows to display */
- int gpolddisprows; /* If has to move, old no. of rows */
- int gpmaxsize; /* Maximum size (rows) of the group */
- int gpminsize; /* Minimum/init size of the group */
- int gpextsize; /* # rows for increasing group size*/
- REGION gpextent; /* Region enclosing the group */
- /* (includes all prompts) */
- struct
- {
- unsigned gpfnostop:1; /* May not stop on this object */
- unsigned gpfreadonly:1; /* Entire group readonly */
- unsigned gpfinparam:1; /* Input parameter for form */
- unsigned gpfretparam:1; /* Return parameter for form */
- unsigned gpfinvisible:1;/* Group not visible on the form */
- } gpflags; /* Group flags */
- PROMPT *gpprompt; /* Group's prompt */
- PROMPT *gpoldprompt; /* Used by the forms editor (undo) */
- char *gphelp; /* Unused */
- struct frmobj *gpobjects; /* List of component objects */
- FPLDSC *gppreprc; /* Group pre processing */
- FPLDSC *gppostprc; /* Group post processing */
- } GROUP;
-
- #define FOGROUP (OBJTYPE)0
- #define FOFIELD (OBJTYPE)1
-
- typedef struct frmobj
- {
- struct frmobj *foparent; /* Parent object (null for ungrouped */
- /* fields and groups) */
- OBJTYPE fotype; /* Object type (group or field) */
- short foseq; /* Used by frsloadform */
- POINTER foobject; /* FIELD or GROUP */
- struct frmobj *fonext; /* Next link for object list */
- struct frmobj *foprev; /* Previous link for object list */
- } FRMOBJ;
-
- typedef struct datobj
- {
- OBJTYPE dotype; /* Object type (FOGROUP or FOFIELD) */
- POINTER doobject; /* DATFIELD or DATGROUP pointer */
- struct datobj *donext; /* Next link for data list */
- struct datobj *doprev; /* Previous link for data list */
- } DATOBJ;
-
- /*
- ** Data object list node (describes the data (one for every occurrance of
- ** every field). This is a leaf node in the data list.
- */
-
- typedef struct datfield
- {
- ID dffldid; /* Id of field */
- DATADSC *dfdata; /* Data descriptor list */
- DATADSC *dfcurdsc; /* Pointer to current descriptor */
- DATADSC *dffirstdsc; /* Pointer to first visible desc */
- DATADSC *dflastdsc; /* Pointer to last visible desc */
- struct
- {
- unsigned dffismodified:1; /* Data for field was modified */
- unsigned dffhilite:1; /* Hilite entry region */
- } dfflags; /* Data descriptor flags */
- } DATFIELD;
-
- /*
- ** Data object list node. This node points to other data lists.
- */
-
- typedef struct datgroup
- {
- ID dggrpid; /* Id of group (used to init stack) */
- DATOBJ **dggrp; /* Array of pointers to data lists */
- /* (one pointer per row in group) */
- int dgused; /* Number of used rows of data */
- int dgsize; /* Maximum size of the dgdata array */
- int dgfirstrow; /* First, last, and current row in */
- /* the display (indexes into the */
- int dglastrow; /* dgdata array) */
- int dgcurrow;
- struct
- {
- unsigned dgoverflow:1; /* Group overflow. */
- unsigned dgfismodified:1; /* Data for field in group modified.*/
- } dgflags; /* Data group flags */
- int dgminsize; /* Copy of minimum size from GROUP
- structure. Needed to accurately
- copy rows. */
- } DATGROUP;
-
- /*
- ** Form object descriptor. This node describes the display characteristics
- ** and data associated with a given form object.
- */
-
- typedef struct objdsc
- {
- FRMOBJ *oddisplay; /* Pointer to the display object */
- DATOBJ *oddata; /* Pointer to the data object */
- int odindexes[MAXNEST]; /* Row indexes (all ancestors) */
- int odnumindex; /* Number of indexes in odindexes */
- int odstktop; /* Top of group stack */
- DATOBJ *odgrpstk[MAXNEST]; /* Stack of groups for this obj */
- } OBJDSC;
-
- /*
- ** Object List.
- **
- ** List of form objects (used by various forms subsystems).
- */
-
- #define OL_FIELD -1 /* Grouped/Ungrouped field (indexes */
- /* specify which) */
- #define OL_ROW -2 /* A single row of a group (indexes */
- /* for all parent groups plus row) */
- #define OL_GROUP -3 /* Entire group (indexes for all */
- /* parent groups) */
- #define OL_CONSTANT -4 /* A constant */
-
- typedef struct objlist
- {
- int oltype; /* Type of the object */
- OBJDSC *olobj; /* Pointer to the object descriptor */
- struct fplconst *olconst; /* or constant descriptor */
- struct objlist *olnext; /* Next node link */
- struct objlist *olprev; /* Previous node link */
- } OBJLIST;
-
- /*
- ** Debug run-time modes
- */
- #define FMRUNUSER 0
- #define FMRUNEXECUTE 1
- #define FMRUNINFO 2
- #define FMRUNQUIET 3
-
- typedef struct finfo
- {
- char *fieldname;
- TBLDSC *tbl;
- struct finfo *next;
- } FINFO;
-
- typedef struct dbtables
- {
- char *tablename;
- FINFO *fieldlist;
- struct dbtables *next;
- } DBTABLES;
-
- typedef struct joindsc
- {
- OBJDSC *field1;
- OBJDSC *field2;
- struct joindsc *next;
- } JOINDSC;
-
- typedef struct fkeybind FKEYBIND; /* Forward reference to later
- definition */
-
- /*
- ** Form Structure.
- */
-
- typedef struct form
- {
- ID fmid; /* Numeric id of the object */
- char *fmname; /* Symbolic name of the object */
- char *fmversion; /* Version info for form */
- char *fmcreator; /* Object's creator */
- char *fmdesc; /* Description of the object */
- WINDOW *fmwindow; /* Window containing the form */
- short fmvpx; /* (x,y) coord of upper left corner */
- short fmvpy; /* of window for form (norm coords) */
- short fmvpwidth; /* Width of the window (norm coords) */
- short fmvpheight; /* Height of the window (norm coords) */
- short fmtpwidth; /* Width of the window's textport */
- short fmtpheight; /* Height of the window's textport */
- SELPARMS *fmmenudef; /* Menu tree */
- SELPORT *fmselport; /* Associated select port structure */
- FRMOBJ *fmifld; /* Initial field */
- FONT fmfont; /* Default font for form objects */
- SYBCOLOR fmcolor; /* Default color for the objects */
- struct
- {
- unsigned fmffirstform:1;/* Unimplemented. */
- unsigned fmfdebug:2; /* Run form in debug or regular modes */
- unsigned fmfismodified:1;/* Form was modified */
- unsigned fmfsaveorig:1; /* Save original value */
- unsigned fmfeditexcp:1; /* Did last proc event call frsresume?*/
- unsigned fmfunused2:1; /* Unused */
- unsigned fmfreadonly:1; /* Form is readonly */
- unsigned fmfcharmove:1; /* Do not trap up/down/left/right */
- /* arrows and allow char movement */
- unsigned fmfclrmod:1; /* Clear modify flags each callform.*/
- /* Used by old DWB only. annk 6/88 */
- unsigned fmfnoinheritfkey:1; /* Supresses inheritance of
- function keys when set */
- unsigned fmfexitform:1; /* Set to terminate execution */
- unsigned fmfinhibproc:1;/* Set to terminate execution */
- unsigned fmffldchange:1;/* Set by frsresume(). */
- unsigned fmfinhibmenu:1;/* Display/suppress the menubar. */
- unsigned fmftypecheck:1;/* Check entry fields for datatype.*/
- } fmflags; /* Form flags */
- FRMOBJ *fmobjects; /* List of all form objects (listed */
- /* in their tab order) */
- DATOBJ *fmdata; /* Data corresponding to all objects */
- /* (and all occurrences) in fmobjects */
- FRMLINE *fmlines; /* List of lines in the form */
- FRMBOX *fmboxes; /* List of boxes in the form */
- OBJLIST *fmparams; /* List of the form's parameters */
- FPLDSC *fmpreprc; /* Form pre-processing */
- FPLDSC *fmpostprc; /* Form post-processing */
- char *fmhelp; /* Unused. */
- struct frscontext *fmcontext; /* Context structure (used only if */
- /* the client is processing the menus)*/
- struct formst *fmsymtbl; /* Form symbol table. */
- struct dbinfo *fmfplmsg; /* Linked list of fpl messages. */
- JOINDSC *joinlist; /* List of joins. */
- FKEYBIND *fmbinding; /* List of function key bindings */
- } FORM;
-
- /*
- ** Traversal Context Structure.
- */
-
- typedef struct travcxt
- {
- FORM *tvform;
- TRAVTYPE tvtrvtype;
- DBBOOL tvfirst;
- OBJDSC tvcurobj;
- } TRAVCXT;
-
- /*
- ** Context header used by runtime data extraction routines.
- */
-
- typedef struct frscxt
- {
- FORM *frform; /* Pointer to the form */
- OBJDSC frobjdsc; /* Field or form object descriptor */
- DATADSC *frvaldsc; /* Value descriptor */
- DBBOOL frfirst;
- DBBOOL frfirstddc;
- } FRSIO;
-
- typedef FRSIO FRSCXT; /* Accomodate obsolescent name. */
-
- /*
- ** Execute runtime stack frame.
- */
-
- typedef struct excontext
- {
- int *ec_pc; /* Saved program counter for FPL procedure */
- struct fplnode *ec_fpl;/* Pointer to cached FPL node */
- struct
- {
- unsigned ecfrmcache:1;
- } ec_flags;
- struct excontext *ec_next; /* Stack link */
- } EXCONTEXT;
-
-
- /*
- ** Forms runtime environment.
- **
- ** This is used by the forms runtime system (frs) as a context stack to support
- ** forms context switches.
- */
-
- typedef struct frscontext
- {
- FORM *fcform; /* Pointer to the current form */
- OBJDSC fcprvfld; /* Previous field descriptor */
- DATACELL *fcprvcell; /* Pointer to the previous datacell */
- OBJDSC fccurfld; /* Current field descriptor */
- DATACELL *fccurcell; /* Pointer to the current datacell */
- OBJDSC fcnxtfld; /* Next field descriptor */
- DATACELL *fcnxtcell; /* (ONLY set in a processing phase) */
- int fccurpick; /* Index into form symbol table of */
- /* the most recent menuitem pick */
- OPTION fcoption; /* Current OPTION (entry event) */
- EXCONTEXT *fcfplbase; /* Pointer to base activation frame */
- /* in the FPL execution stack */
- DATOBJ *fcobjstate; /* List of all of the form's data */
- /* (to support re-entrant forms) */
- ENTRY fcentry; /* Shared entry structure */
- struct frscontext *fcnext; /* Stack link */
-
- /*
- ** fcftab and fcfbacktab work together to record the directory the
- ** operator last moved the cursor on the form. They are set only
- ** when we detect a TAB or BACKTAB character and are cleared prior
- ** to reading input and also when fsfsetcurfld is called.
- */
-
- struct
- {
- unsigned fcftab:1; /* True if most recent operation was
- a tab */
- unsigned fcfbacktab:1; /* True if most recent operation was
- a backtab. */
- } fcflags;
-
- } FRSCONTEXT;
-
- /*
- ** List of forms used by the application.
- **
- ** This list is used by the forms runtime system (frs) to resolve form
- ** references. This list is built partially (or totally) when forms are
- ** compiled. Then, at runtime, if form references cannot be resolved from
- ** this list, the form will be read from the database and added to the list.
- */
-
- typedef struct frmdef
- {
- char *fdname; /* Form name */
- char *fdversion; /* Version number for form */
- struct
- {
- unsigned fdfpreload:1; /* Load form before first reference */
- } fdflags;
- FORM *fdform; /* Pointer to actual in-core form (if */
- /* NULL, form must be loaded from db) */
- struct frmdef *fdnext; /* Next form in list */
- } FRMDEF;
-
- /*
- ** The following definitions are for function key support.
- **
- ** A FUNCTIONKEY is used to describe each possible function key that is
- ** available.
- **
- ** FSFUNCTIONKEY is a structure that maps procedures to functions keys
- ** in a manner similar to FSPROCEDURE.
- **
- ** The procedure fsinstallkeys and fskeyargs are used to define the key
- ** mapping and provide arguments for the mapped routines.
- */
-
- typedef int FUNCTIONKEY;
-
- /*
- ** FKEY<n> are the name of our function keys
- */
-
- #define FKEYS 32 /* number of function keys */
-
- #define FKEY1 (FUNCTIONKEY) 1
- #define FKEY2 (FUNCTIONKEY) 2
- #define FKEY3 (FUNCTIONKEY) 3
- #define FKEY4 (FUNCTIONKEY) 4
- #define FKEY5 (FUNCTIONKEY) 5
- #define FKEY6 (FUNCTIONKEY) 6
- #define FKEY7 (FUNCTIONKEY) 7
- #define FKEY8 (FUNCTIONKEY) 8
- #define FKEY9 (FUNCTIONKEY) 9
- #define FKEY10 (FUNCTIONKEY) 10
- #define FKEY11 (FUNCTIONKEY) 11
- #define FKEY12 (FUNCTIONKEY) 12
- #define FKEY13 (FUNCTIONKEY) 13
- #define FKEY14 (FUNCTIONKEY) 14
- #define FKEY15 (FUNCTIONKEY) 15
- #define FKEY16 (FUNCTIONKEY) 16
- #define FKEY17 (FUNCTIONKEY) 17
- #define FKEY18 (FUNCTIONKEY) 18
- #define FKEY19 (FUNCTIONKEY) 19
- #define FKEY20 (FUNCTIONKEY) 20
- #define FKEY21 (FUNCTIONKEY) 21
- #define FKEY22 (FUNCTIONKEY) 22
- #define FKEY23 (FUNCTIONKEY) 23
- #define FKEY24 (FUNCTIONKEY) 24
- #define FKEY25 (FUNCTIONKEY) 25
- #define FKEY26 (FUNCTIONKEY) 26
- #define FKEY27 (FUNCTIONKEY) 27
- #define FKEY28 (FUNCTIONKEY) 28
- #define FKEY29 (FUNCTIONKEY) 29
- #define FKEY30 (FUNCTIONKEY) 30
- #define FKEY31 (FUNCTIONKEY) 31
- #define FKEY32 (FUNCTIONKEY) 32
-
- typedef struct _FSFUNCTIONKEY
- {
- FUNCTIONKEY fkeyname;
- INTFUNCPTR fkeyproc;
- POINTER *fkeyargs;
- int fkeylang;
- } FSFUNCTIONKEY;
-
- struct fkeybind
- {
- FKEYBIND * fk_next; /* Null terminated linked list */
- FUNCTIONKEY fk_key; /* Which key is being bound */
- FPLDSC * fk_binding; /* List of processing bound to the
- key */
- };
-
- /* parser filespec structure */
- typedef struct _FSPEC
- {
- char *version;
- char *wdir;
- char *name;
- #if VMS
- char *diag;
- char *list;
- #endif
- } FSPEC;
-
- /* parser runtime flags structure */
- typedef struct _PFLAGS
- {
- unsigned pf_usefpe:1;
- unsigned pf_rtsyms:1;
- unsigned pf_topt:1;
- unsigned pf_dump:1;
- unsigned pf_sybout:1;
- } PFLAGS;
-
- /*
- ** The following structure is used to pass parameters from Apt-Sql code to
- ** 3GL (C and the other supported languages) code.
- **
- ** A 3GL routine recieves 3 parameters, the context, the arg array set up by
- ** the main-line code, and an array of type FSPASSED. This array contains
- ** one entry for each parameter passed from a 4GL routine. It is NULL if
- ** none were passed.
- **
- ** Since the Apt-Sql routine can pass any of its data types, the FSPASSED
- ** structure has a way of representing them all and a method for informing
- ** the called program of this. The p_type field is set to one of the PT_*
- ** values listed below. This code lets the 3GL program know what to expect
- ** and which field in the union to reference. There is always an extra
- ** parameter in the array whose type is PT_NOMORE. This allows Apt-Sql to
- ** pass a variable number of parameters to the called routine and enables the
- ** called routine to adapt to that number.
- */
-
- #define PT_NOMORE 0
- #define PT_FLDOBJECT 1
- #define PT_INT 2
- #define PT_SMALLINT 3
- #define PT_TINYINT 4
- #define PT_CHAR 5
- #define PT_BIT 6
- #define PT_DATETIME 7
- #define PT_MONEY 8
- #define PT_FLT8 9
- #define PT_BINARY 10
- #define PT_GRPOBJECT 11
-
- typedef struct _fspassed
- {
- short p_type;
- short p_len;
- union
- {
- OBJDSC p_object;
- DBINT p_int;
- DBSMALLINT p_smallint;
- DBTINYINT p_tinyint;
- DBCHAR *p_char;
- DBBIT p_bit;
- DBDATETIME p_datetime;
- DBMONEY p_money;
- DBFLT8 p_flt8;
- DBBINARY *p_binary;
- } p_value;
-
- } FSPASSED;
-
-
- /* APT-Lib function prototypes */
- struct objindex *fsgoialloc(void);
- void fsgoifree(struct objindex *obji);
- void fsgoiassign(struct objindex *obji,int level,int i0,int i1,int i2,int i3,int i4,int i5,int i6,int i7,int i8,int i9);
- int fsgoiget(struct objindex *obji,int index);
- int fsgoigetlevel(struct objindex *obji);
- int fsgoisetlevel(struct objindex *obji,int level);
- int fsgoiset(struct objindex *obji,int index,int value);
- struct datadsc *fsdgetddc(struct objdsc *fld,char *dataval,long dataid);
- char *fsfreadval(struct form *frm,char *fldname,long fldid,struct objindex *fldindex,unsigned char *retbuf,int *buflen);
- int fsgmoverow(struct frscontext *context,struct objdsc *fld);
- struct form *fsiogetform(struct frscxt *frs_cxt);
- int fsprint(struct form *inform,int flags);
- void fsabort(char *message);
- int fsfsetcurfld(struct frscontext *context,struct objdsc *flddsc);
- struct datadsc *fsionxtddc(struct frscxt *frs_io,unsigned char selonly);
- void fsresume(void);
- void fsexitform(void);
- struct objdsc *fsionxtfld(struct frscxt *frs_io,unsigned char modonly);
- int fscallform(struct form *frm);
- struct objdsc *fsfgetfld(struct form *frm,char *fldname,long fldid,struct objindex *index,struct objdsc *retobj);
- int fsfsetvalues(struct objdsc *flddsc,char *text);
- struct objdsc *fsionxtrow(struct frscxt *frsio,unsigned char modonly);
- void fsseticon(short *icon,int width,int height,int depth);
- void fscancelform(void);
- int fsfwriteval(struct form *frm,char *fldname,long fldid,struct objindex *fldindex,long dataid,short state,unsigned char *val,char *sval,int len,unsigned char setmod);
- int fsiosetddc(struct frscxt *frs_io,struct objdsc *flddsc,struct datadsc *valdsc);
- struct form *fscurform(struct frscontext *context);
- struct objdsc *fsfgetinitfld(struct form *frm,struct objdsc *flddsc);
- void fsfsetinitfld(struct form *frm,struct objdsc *fld);
- struct objdsc *fsfcurfld(struct frscontext *context);
- struct objdsc *fsfprvfld(struct frscontext *context);
- struct datadsc *fsdcurddc(struct frscontext *context);
- char *fsfgetval(struct form *frm,struct objdsc *field,unsigned char *retbuf,int *buflen);
- struct objdsc *fsgaddrow(struct frscontext *context,struct objdsc *grp,int row,struct objdsc *retobj);
- int fsggetmaxrows(struct objdsc *grpobj);
- int fsggetusedrows(struct objdsc *group);
- int fsgsetusedrows(struct form *form,struct objdsc *grpobj,int used);
- int fsiosetfld(struct frscxt *frs_io,struct objdsc *grpdsc,struct objdsc *flddsc);
- int fssql(struct dbprocess *dbproc,char *sqltext);
- void fscopyobj(struct objdsc *dst,struct objdsc *src);
- int fsfsetfldflags(struct form *frm,struct objdsc *fld,int flags);
- int fsgsetgrpflags(struct form *frm,struct objdsc *grp,int flags);
- int fssetformflags(struct form *frm,int flags);
- int fsfclrfldflags(struct form *frm,struct objdsc *fld,int flags);
- int fsgclrgrpflags(struct form *frm,struct objdsc *grp,int flags);
- int fsclrformflags(struct form *frm,int flags);
- unsigned char fsftestfldflags(struct form *frm,struct objdsc *fld,int flags);
- unsigned char fsgtestgrpflags(struct form *frm,struct objdsc *grp,int flags);
- unsigned char fstestformflags(struct form *frm,int flags);
- int fsgdelrow(struct frscontext *context,struct objdsc *grp,int row,struct objdsc *newfld);
- int fsgscrollgrp(struct form *frm,struct objdsc *grpobj,int toprow);
- void fsmessage(char *msg);
- void fssuspend(void);
- struct dbprocess *fsdblogin(struct loginrec * *ploginrec,char *title);
- char *fsformname(struct form *form);
- char *fsformver(struct form *form);
- struct form *fsgetform(char *formname,char *version);
- int fsfreeform(struct form *frm);
- int fsmonmenu(struct form *frm,short menuid);
- int fsmoffmenu(struct form *frm,short menuid);
- short fsmcurmenu(struct frscontext *context);
- void fstsetalarm(long initial_delay,long repeat_delay,void (*alarm_func)(),unsigned char *arguments);
- void fststartcrit(void);
- void fstendcrit(void);
- struct dbprocess *fsdbproc(struct dbprocess *dbproc);
- struct dbprocess *fsdbenviron(struct dbprocess *dbproc);
- int fsfputval(struct form *frm,struct objdsc *fld,long dataid,short state,unsigned char *val,char *sval,int len,unsigned char setmod);
- struct objdsc *fsggetgrp(struct form *frm,char *grpname,long grpid,struct objindex *index,struct objdsc *retobj);
- struct frsprocedure *fsinstallproc(struct frsprocedure *procarray);
- int fsprocargs(char *procname,unsigned char * *procargs);
- int fsprocreturn(void);
- short fsfgettype(struct objdsc *flddsc);
- long fsfgetid(struct objdsc *flddsc);
- char *fsfgetname(struct objdsc *flddsc);
- int fsfgetdtype(struct objdsc *flddsc);
- short fsfgetlen(struct objdsc *flddsc);
- unsigned char fsfisfldmod(struct objdsc *flddsc);
- unsigned char fsisformmod(struct form *form);
- int fsfgetrow(struct objdsc *fld);
- struct objindex *fsggetindex(struct objdsc *obj,struct objindex *indexdsc);
- void fsgcopyindex(struct objindex *dest,struct objindex *source);
- char *fsdgetprvval(struct datadsc *ddptr);
- char *fsdgetval(struct datadsc *ddptr);
- int fsdputval(struct datadsc *ddptr,char *val);
- char *fsfgetdefault(struct objdsc *flddsc,unsigned char *val,int *ptrlen);
- int fsfputdefault(struct objdsc *flddsc,unsigned char *val,char *sval,int len);
- int fsdgetmaxlen(struct datadsc *ddptr);
- int fsdgetlen(struct datadsc *ddptr);
- long fsdgetid(struct datadsc *ddptr);
- short fsdgetstate(struct datadsc *ddptr);
- void fsdputstate(struct datadsc *ddptr,short ss);
- short fsdgetinitstate(struct datadsc *ddptr);
- void fsdputinitstate(struct datadsc *ddptr,short ss);
- struct loginrec *fsdbrec(struct loginrec *loginrec);
- struct objdsc *fsggetparent(struct form *frm,struct objdsc *objdsc,struct objdsc *retobj);
- struct frscxt *fsioalloc(struct form *frm);
- void fsiofree(struct frscxt *frs_cxt);
- int fsopenscreen(int *argcptr,char * *argv,char *label);
- int fsclosescreen(void);
-
- #if VOS
- /* external variables available to Stratus users */
-
- extern char *Sqlroot; /* Root SQL/2000 directory */
- extern char *Term; /* Terminal type */
- extern char *User; /* User Name */
- extern char *Sybformlist; /* directory for formdefs */
- extern char *Printer; /* Printer queue */
- extern char *Sqlbufflen; /* SQL buffer length */
- extern char *Hostname; /* Server Name */
- #endif /* VOS */
-
-