home *** CD-ROM | disk | FTP | other *** search
- /**
- *
- * Name HLDISP -- Display help in a virtual window and read
- * user responses.
- *
- * Synopsis presult = hldisp (pdatabase_path, pid_string, offset,
- * pfinal, option);
- *
- * WN_EVENT *presult pfinal, or NIL if an error
- * occurred.
- * const char The name of the help database to
- * *pdatabase_path search.
- * const char *pid_string The help ID string to search
- * for.
- * unsigned long offset If pid_string is NIL or points
- * to the NUL string ("\0"), this
- * is the absolute offset of the
- * help record in the help
- * database.
- * WN_EVENT *pfinal Pointer to structure to fill in
- * with a copy of the event which
- * terminated the read.
- * int option Bitwise ORing of the following:
- * HL_USE_MOUSE: Use the mouse if
- * it is present.
- * HL_NO_MOUSE: Do not use the
- * mouse.
- * HL_KBIGNORE: Ignore the keyboard
- * and discard all keystrokes.
- *
- *
- * Description This function will read the help text for the specified
- * help record from the specified help database, display it
- * and read responses from it until the user hits ESC or
- * Enter. The option argument can be used to ignore the
- * mouse if it is present.
- *
- * The help window's characteristics (i.e., viewport size,
- * attributes, etc.) are taken from the help database
- * record.
- *
- * An error occurs if the database does not exist or if
- * the specified help record is not in the database.
- *
- * The return value is a pointer to an internal static copy
- * of the event node which terminated the read; this copy
- * will be overwritten with each call to HLREAD.
- *
- * Returns pfinal Pointer to event node which terminated
- * the read process (the event's action
- * will be either WN_TRANSMIT or
- * WN_ABORT), or NIL if error.
- * b_pcurwin NIL.
- * b_wnerr Possible values:
- * (No change) Success.
- * WN_BAD_DEV Unknown device or
- * window dimensions
- * overflow screen.
- * WN_ILL_DIM Viewport is larger
- * than data area, or
- * origin is illegal.
- * WN_NO_MEMORY Insufficient memory.
- * WN_BAD_WIN Internal error.
- * WN_ALREADY_SHOWN Internal error.
- * WN_BAD_NODE Internal error.
- * WN_BAD_PAGE Internal error.
- * WN_COVERED Internal error.
- * WN_NOT_SHOWN Internal error.
- * WN_NULL_PTR Internal error.
- *
- * Version 6.00 (C)Copyright Blaise Computing Inc. 1989
- *
- **/
-
- #include <bhelp.h>
-
-
- WN_EVENT *hldisp(pdatabase_path, pid_string, offset, pfinal,
- option)
- const char *pdatabase_path;
- const char *pid_string;
- unsigned long offset;
- WN_EVENT *pfinal;
- int option;
- {
- HL_WINDOW help_window;
- char *phelp_text;
- int text_length;
- WN_EVENT *presult;
- int error;
-
- error = hllookup(pdatabase_path, pid_string, offset, &help_window,
- &phelp_text, &text_length, HL_COMPRESSED);
- if (error != HL_NO_ERROR)
- return(NIL);
-
- presult = hlread(NIL, &help_window, phelp_text, text_length,
- pfinal, HL_COMPRESSED | (option & ~HL_TEXT_TYPE));
-
- free(phelp_text);
-
- return(presult);
- }