AcePerl
view release on metacpan or search on metacpan
acelib/helpsubs.c view on Meta::CPAN
/* File: helpsubs.c
* Author: Fred Wobus (fw@sanger.ac.uk)
* Copyright (C) J Thierry-Mieg and R Durbin, 1998
*-------------------------------------------------------------------
* This file is part of the ACEDB genome database package, written by
* Richard Durbin (MRC LMB, UK) rd@sanger.ac.uk, and
* Jean Thierry-Mieg (CRBM du CNRS, France) mieg@kaa.cnrs-mop.fr
*
* SCCS: %W% %G%
* Description: controls the help system, provides HTML parsing
* Exported functions:
* HISTORY:
* Last edited: Dec 4 14:30 1998 (fw)
* * Oct 12 12:27 1998 (fw): checkSubject now case-insensitive
* * Oct 8 17:23 1998 (fw): removed warning, in case that
an open-list tag (e.g. <UL> was directly followed by a close-list
tag (e.g. </UL>). The warning tried to enforce that
every type of list only has a certain type of items.
* * Oct 8 11:36 1998 (fw): helpSubjectGetFilename takes over logic
from readHelpfile to locate the file containing the
help for a particular subject
* Created: Tue Aug 18 16:11:07 1998 (fw)
*-------------------------------------------------------------------
*/
#include "help_.h"
/************************************************************/
static char *makeHtmlIndex (STORE_HANDLE handle);
static char *makeHtmlImagePage (char *link, STORE_HANDLE handle);
static HtmlNode *parseHtmlText (char *text, STORE_HANDLE handle);
static BOOL parseSection (char **cp, HtmlNode **resultnode,
STORE_HANDLE handle);
/************************************************************/
/************ directory where help files are stored *********/
static char helpDir[MAXPATHLEN] = "" ;
/************************************************************/
/* function to register the helpOnRoutine
This can be called at any stage (before the first helpOn,
or later on, it will affect the system next time helpOn
is called. */
/************************************************************/
static QueryRoutine helpOnRoutine = 0;
UTIL_FUNC_DEF QueryRoutine helpOnRegister (QueryRoutine func)
/* call with func = 0x0 just to check whether
anything has been registered yet */
{
QueryRoutine old = helpOnRoutine ;
if (func)
helpOnRoutine = func ;
return old ;
}
/************************************************************/
/* Sets the helpDir; */
/************************************************************/
UTIL_FUNC_DEF char *helpSetDir (char *dirname)
{
if (dirname)
{
strcpy (helpDir, dirname);
if (filName (dirname,0,"rd"))
return (char*)&helpDir[0];
else
( run in 1.199 second using v1.01-cache-2.11-cpan-99c4e6809bf )