Bioplib
Protein Structure C Library
|
Provides a simple file-based command line help utility. More...
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include "macros.h"
#include "WindIO.h"
#include "parse.h"
#include "help.h"
#include "general.h"
Go to the source code of this file.
Macros | |
#define | BUFFLEN 240 /* Buffer for reading from file */ |
#define | HELPENV |
Functions | |
void | blHelp (char *string, char *HelpFile) |
void | blDoHelp (char *string, char *HelpFile) |
Provides a simple file-based command line help utility.
This code is NOT IN THE PUBLIC DOMAIN, but it may be copied according to the conditions laid out in the accompanying file COPYING.DOC.
The code may be modified as required, but any modifications must be documented so that the person responsible can be identified.
The code may not be sold commercially or included as part of a commercial product except as described in the file COPYING.DOC.
A pair of routines for handling a help facility. All screen/keyboard I/O is via screen() and GetKybdString() routines.
This is the normal entry point and should be supplied with the complete command including the word `help'. If this is the only word given, the routine will prompt with Help> and give help on each word typed until return is hit to exit help. If help followed by a keyword is given, help only on that topic will be supplied.
Generates help from helpfilename on the topic named by string. If this is `help' or `?', available topics will be listed.
Used to close the help file
Under Unix, the environment variable, HELPDIR should be set to specify the directory in which help files are stored. Under operating systems such as VAX/VMS and AmigaDOS which support the assign command, the HELPDIR: assign should be set up for the help directory.
Definition in file help.c.
#define HELPENV |
void blDoHelp | ( | char * | string, |
char * | HelpFile | ||
) |
[in] | *string | String on which to give help, must include the word "help". If given on its own, sits in a loop prompting for help. |
[in] | *HelpFile | The help file to search |
Handles help facility. This is the normal entry point and should be supplied with the complete command including the word `help'.
e.g. DoHelp("help","foo.hlp"); or DoHelp("help bar","foo.hlp");
If help is the only word given, the routine will prompt with Help> and give help on each word typed until return is hit to exit help. If help followed by a keyword is given, help only on that topic will be supplied.
void blHelp | ( | char * | string, |
char * | HelpFile | ||
) |
[in] | *string | Topic on which to provide help. If "help" or "?" then list all topics |
[in] | *HelpFile | Name of help file, or "CLOSE" to close the help file |
Generates help from a help file on the topic named by string. If this is `help' or `?', available topics will be listed.
Only one help file may be open at a time. Once a file is open, no check is made on the HelpFile string to check that you still require the same help file. You must first close the file before changing to a new file.
Calling: Help(NULL,"CLOSE") will close the help file.
The directory specified by the environment variable or assign specified by the #define HELPENV (normally HELPDIR) will be searched for the help file if not found in the local directory.