home *** CD-ROM | disk | FTP | other *** search
- /*
- helpdecl.h
-
- % Header for C-scape help system.
-
- written by Joe DeSantis.
-
- C-scape 3.2
- Copyright (c) 1986, 1987, by Oakland Group, Inc.
- ALL RIGHTS RESERVED.
-
- Revision History:
- -----------------
- 9/01/87 jmd added NO_PROTO option
- 9/16/88 jmd added help_fptr, _arg
- 12/13/88 jmd added hshow_fptr
-
- 4/22/89 jmd renamed border element in structures to bord
- 7/15/89 ted Converted '_func' prototypes from typedef to macro.
-
- 3/08/90 jmd improved index array scheme
- 3/28/90 jmd ansi-fied
- 5/08/90 jmd added underscores to func macros for vms compiler
- */
-
- #define HELPLINE 100 /* size of help line buffer */
-
- /** help_Init return values **/
-
- #define HELP_OK 0
- #define HELP_NOMEM 1
- #define HELP_BADARG 2
- #define HELP_BADFILE 3
- #define HELP_NOMSG 4
-
-
- #define help_func(fname) int fname(struct help_struct *_help)
-
- /** the help structure **/
-
- typedef struct help_struct {
-
- int msg; /* the current message */
- int chap; /* the current chapter */
- int par; /* the current paragraph */
-
- int high_msg; /* highest accessed message */
-
- FILE *fp; /* the help file */
- larray offset; /* larray of offsets in help file */
-
- unsigned int size; /* size of text */
- char *text; /* message text buffer */
- char title[HELPLINE+3]; /* title string */
-
- int *index; /* the index of messages */
- int chap_count; /* number of chapters */
- int par_count; /* number of paragraphs */
-
- help_func ((*disp)); /* the display function */
-
- VOID *data; /* the help data pointer */
-
- } *help_type;
-
- /** the help display function type **/
-
- typedef help_func ((*help_fptr));
-
- #define help_GetMessage(h) ((h)->msg)
- #define help_GetChapter(h) ((h)->chap)
- #define help_GetParagraph(h) ((h)->par)
-
- #define help_GetData(h) ((h)->data)
- #define help_GetTitle(h) ((h)->title)
- #define help_GetText(h) ((h)->text)
- #define help_GetSize(h) ((h)->size)
-
- /*** Functions ***/
-
- #define hshow_func(fname) int fname(int _chap, int _par)
- typedef hshow_func ((*hshow_fptr));
-
- /* HELP.C */
- extern int help_Init(FILE *fp, help_fptr disp, unsigned size, VOID *data);
- extern int _help_Show(int chap, int par);
- extern int help_Index(int chap, int par);
- extern boolean help_LookUp(int msg);
- extern void help_Close(void);
-
- /* HELPSHOW.C */
- extern int help_Show(int chap, int par);
- extern void _help_InitShow(hshow_fptr func);
-
- /* HELPVIEW.C */
- extern int help_View(help_type h);
-
- /* HELPXREF.C */
- extern int help_Xref(help_type h);
-
- /* misc data structures */
-
- struct hv_struct { /* used by help_View */
- int row; /* row position of help window */
- int col; /* col position of help window */
- int height; /* height of help window */
- int width; /* width of help window */
- char color; /* color of help window */
- bd_fptr bord; /* help window border function */
- };
-
- struct hx_struct { /* used by help_Xref */
- char bk_clr; /* background color of help window */
- char reg_clr; /* color of choices */
- char sel_clr; /* color of selected choice */
- char bd_clr; /* color of help window border */
- bd_fptr bord; /* help window border function */
- };
-