Go to the source code of this file.
|
static char * | strclean (char *str) |
|
static BOOLEAN | heKey2Entry (char *filename, char *key, heEntry hentry) |
|
static int | heReKey2Entry (char *filename, char *key, heEntry hentry) |
|
static BOOLEAN | strmatch (char *s, char *re) |
|
static BOOLEAN | heOnlineHelp (char *s) |
|
static void | heBrowserHelp (heEntry hentry) |
|
static long | heKeyChksum (char *key) |
|
static BOOLEAN | heGenInit (int, int) |
|
static void | heGenHelp (heEntry hentry, int) |
|
static void | heBuiltinHelp (heEntry hentry, int) |
|
static BOOLEAN | heDummyInit (int, int) |
|
static void | heDummyHelp (heEntry hentry, int) |
|
static BOOLEAN | heEmacsInit (int, int) |
|
static void | heEmacsHelp (heEntry hentry, int) |
|
void | feHelp (char *str) |
|
static void | feBrowserFile () |
|
const char * | feHelpBrowser (char *which, int warn) |
|
void | feStringAppendBrowsers (int warn) |
|
static void | hePrintHelpStr (const idhdl hh, const char *id, const char *pa) |
|
| Print ("running `%s`\n", sys) |
|
| if (!FE_OPT_NO_SHELL_FLAG)(void) system(sys) |
|
static int | singular_manual (char *str, BOOLEAN isIndexEntry, heEntry hentry) |
|
static char | tolow (char p) |
|
static int | show (unsigned long offset, char *close) |
|
◆ heEntry_s
◆ heBrowser_s
◆ BUF_LEN
◆ FIN_INDEX
◆ HELP_NOT_FOUND
◆ HELP_NOT_OPEN
◆ HELP_OK
◆ IDX_LEN
◆ MAX_HE_ENTRY_LENGTH
#define MAX_HE_ENTRY_LENGTH 160 |
◆ MAX_SYSCMD_LEN
◆ heBrowser
◆ heBrowserHelpProc
typedef void(* heBrowserHelpProc) (heEntry hentry, int br) |
◆ heBrowserInitProc
typedef BOOLEAN(* heBrowserInitProc) (int warn, int br) |
◆ heEntry
◆ feBrowserFile()
static void feBrowserFile |
( |
| ) |
|
|
static |
Definition at line 177 of file fehelp.cc.
184 while (fgets(
buf,
sizeof(
buf),
f))
186 if ((
buf[0]!=
'#') && (
buf[0]>
' ')) br++;
192 while (fgets(
buf,
sizeof(
buf),
f))
194 if ((
buf[0]!=
'#') && (
buf[0]>
' '))
197 char *req=strtok(
NULL,
"!");
198 char *cmd=strtok(
NULL,
"!");
201 while ((cmd[0]!=
'\0') && (cmd[strlen(cmd)-1]<=
' '))
202 cmd[strlen(cmd)-1]=
'\0';
213 Print(
"syntax error in help.cnf, at line starting with %s\n",
buf);
char name(const Variable &v)
FILE * feFopen(const char *path, const char *mode, char *where, short useWerror, short path_only)
static BOOLEAN heDummyInit(int, int)
Print("running `%s`\n", sys)
static BOOLEAN heGenInit(int, int)
static BOOLEAN heEmacsInit(int, int)
STATIC_VAR heBrowser_s * heHelpBrowsers
heBrowserInitProc init_proc
heBrowserHelpProc help_proc
static void heDummyHelp(heEntry hentry, int)
static void heEmacsHelp(heEntry hentry, int)
static void heBuiltinHelp(heEntry hentry, int)
static void heGenHelp(heEntry hentry, int)
int status int void * buf
◆ feHelp()
void feHelp |
( |
char * |
str | ) |
|
Definition at line 90 of file fehelp.cc.
102 memset(&hentry,0,
sizeof(hentry));
136 strcpy(mkey + 1,
str);
144 Warn(
"No help for topic '%s' (not even for '*%s*')",
str,
str);
145 WarnS(
"Try '?;' for general help");
146 WarnS(
"or '?Index;' for all available help topics.");
159 Warn(
"No unique help for '%s'",
str);
161 Warn(
"No help for topic '%s'",
str);
static char * feResource(feResourceConfig config, int warn)
char url[MAX_HE_ENTRY_LENGTH]
const char * feHelpBrowser(char *which, int warn)
static char * strclean(char *str)
static void heBrowserHelp(heEntry hentry)
static int heReKey2Entry(char *filename, char *key, heEntry hentry)
char node[MAX_HE_ENTRY_LENGTH]
STATIC_VAR heBrowser heCurrentHelpBrowser
#define MAX_HE_ENTRY_LENGTH
char key[MAX_HE_ENTRY_LENGTH]
static BOOLEAN heKey2Entry(char *filename, char *key, heEntry hentry)
static BOOLEAN heOnlineHelp(char *s)
void StringSetS(const char *st)
void PrintS(const char *s)
◆ feHelpBrowser()
const char* feHelpBrowser |
( |
char * |
which, |
|
|
int |
warn |
|
) |
| |
Definition at line 249 of file fehelp.cc.
255 if (which ==
NULL || *which ==
'\0')
298 if (warn)
Warn(
"No help browser '%s' available.", which);
331 strcmp((
char*)
feOptSpec[FE_OPT_BROWSER].value,
static void * feOptValue(feOptIndex opt)
EXTERN_VAR struct fe_option feOptSpec[]
static void feBrowserFile()
STATIC_VAR int heCurrentHelpBrowserIndex
◆ feStringAppendBrowsers()
void feStringAppendBrowsers |
( |
int |
warn | ) |
|
Definition at line 341 of file fehelp.cc.
void StringAppendS(const char *st)
◆ heBrowserHelp()
static void heBrowserHelp |
( |
heEntry |
hentry | ) |
|
|
static |
Definition at line 769 of file fehelp.cc.
772 int kchksum = (hentry !=
NULL && hentry->
chksum > 0 ?
787 WarnS(
"Use 'system(\"--browser\", <browser>);' to change browser,");
798 if (browsers[strlen(browsers)-2] ==
',')
800 browsers[strlen(browsers)-2] =
'.';
801 browsers[strlen(browsers)-1] =
'\0';
STATIC_VAR BOOLEAN feHelpCalled
static long heKeyChksum(char *key)
◆ heBuiltinHelp()
static void heBuiltinHelp |
( |
heEntry |
hentry, |
|
|
int |
|
|
) |
| |
|
static |
Definition at line 1055 of file fehelp.cc.
1058 hentry->
key :
"Top");
static int singular_manual(char *str, BOOLEAN isIndexEntry, heEntry hentry)
◆ heDummyHelp()
static void heDummyHelp |
( |
heEntry |
hentry, |
|
|
int |
|
|
) |
| |
|
static |
Definition at line 1037 of file fehelp.cc.
1039 WerrorS(
"No functioning help browser available.");
void WerrorS(const char *s)
◆ heDummyInit()
static BOOLEAN heDummyInit |
( |
int |
, |
|
|
int |
|
|
) |
| |
|
static |
◆ heEmacsHelp()
static void heEmacsHelp |
( |
heEntry |
hentry, |
|
|
int |
|
|
) |
| |
|
static |
Definition at line 1046 of file fehelp.cc.
1048 WarnS(
"Your help command could not be executed. Use");
1050 (hentry !=
NULL && *(hentry->
node) !=
'\0' ? hentry->
node :
"Top"));
1051 WarnS(
"to enter the Singular online help. For general");
1052 WarnS(
"information on Singular running under Emacs, type C-h m.");
◆ heEmacsInit()
static BOOLEAN heEmacsInit |
( |
int |
, |
|
|
int |
|
|
) |
| |
|
static |
◆ heGenHelp()
static void heGenHelp |
( |
heEntry |
hentry, |
|
|
int |
br |
|
) |
| |
|
static |
Definition at line 871 of file fehelp.cc.
891 if ((*
p==
'h')&&(htmldir!=
NULL))
892 strcat(sys,
"file://localhost");
893 else if ((*
p==
'H')||(htmldir==
NULL))
896 if (hentry !=
NULL && *(hentry->
url) !=
'\0')
897 #ifdef HAVE_VSNPRINTF
901 snprintf(temp,256,
"%s/%d-%d/%s", htmldir,
905 snprintf(temp,256,
"%s/%d-%d-%d/%s", htmldir,
912 snprintf(temp,256,
"%s/%s", htmldir, hentry->
url);
918 snprintf(temp,256,
"%s/%d-%d/index.htm", htmldir,
923 snprintf(temp,256,
"%s/%d-%d-%d/index.htm", htmldir,
930 snprintf(temp,256,
"%s/index.htm", htmldir);
936 sprintf(temp,
"%s/%d-%d/%s", htmldir,
941 sprintf(temp,
"%s/%s", htmldir, hentry->
url);
943 sprintf(temp,
"%s/%d-%d-%d/%s", htmldir,
949 sprintf(temp,
"%s/%s", htmldir, hentry->
url);
955 sprintf(temp,
"%s/%d-%d/index.htm", htmldir,
960 sprintf(temp,
"%s/%d-%d-%d/index.htm", htmldir,
967 sprintf(temp,
"%s/index.htm", htmldir);
973 char *
pp=(
char *)strchr(sys,
'#');
987 if (i_res!=
NULL) strcat(sys,i_res);
990 WarnS(
"singular.info not found");
999 if ((hentry!=
NULL) && (*(hentry->
node) !=
'\0'))
1000 sprintf(temp,
"%s",hentry->
node);
1004 sprintf(temp,
"Top");
◆ heGenInit()
static BOOLEAN heGenInit |
( |
int |
warn, |
|
|
int |
br |
|
) |
| |
|
static |
Definition at line 812 of file fehelp.cc.
827 if (warn)
Warn(
"resource `%c` not found",*
p);
834 if (warn)
WarnS(
"resource `D` not found");
847 while (((*
p==
':')||(*
p<=
' ')) && (*
p!=
'\0'))
p++;
848 while((
i<127) && (*
p>
' ') && (*
p!=
':'))
854 if ((op==
'O') && (strcmp(
name,S_UNAME)!=0))
858 if (warn)
Warn(
"executable `%s` not found",
name);
863 default:
Warn(
"unknown char %c",*
p);
EXTERN_VAR BOOLEAN FE_OPT_NO_SHELL_FLAG
char * omFindExec(const char *name, char *exec)
◆ heKey2Entry()
static BOOLEAN heKey2Entry |
( |
char * |
filename, |
|
|
char * |
key, |
|
|
heEntry |
hentry |
|
) |
| |
|
static |
Definition at line 388 of file fehelp.cc.
393 *(hentry->
key) =
'\0';
394 *(hentry->
url) =
'\0';
395 *(hentry->
node) =
'\0';
398 fd = fopen(filename,
"r");
404 while ((c = getc(
fd)) != EOF)
409 while (getc(
fd) !=
'\n') {};
422 if (getc(
fd) !=
'\t')
goto Failure;
425 if (hentry->
key != key) strcpy(hentry->
key, key);
428 while ((c = getc(
fd)) !=
'\t' && c != EOF)
433 if (c == EOF)
goto Failure;
434 if (hentry->
node[0]==
'\0')
435 strcpy(hentry->
node,hentry->
key);
440 while ((c = getc(
fd)) !=
'\t' && c != EOF)
445 if (c == EOF)
goto Failure;
448 hentry->
url[
i] =
'\0';
450 if (si_fscanf(
fd,
"%ld\n", &(hentry->
chksum)) != 1)
◆ heKeyChksum()
static long heKeyChksum |
( |
char * |
key | ) |
|
|
static |
Definition at line 749 of file fehelp.cc.
751 if (key ==
NULL || *key ==
'\0')
return 0;
756 if (
pi !=
NULL)
return pi->data.s.help_chksum;
◆ heOnlineHelp()
static BOOLEAN heOnlineHelp |
( |
char * |
s | ) |
|
|
static |
Definition at line 621 of file fehelp.cc.
626 if ((ss=strstr(
s,
"::"))!=
NULL)
633 Print(
"help for %s from package %s\n",ss,
s);
636 strcat(s_help,
"_help");
641 else Print(
"package %s not found\n",
s);
651 if((lib!=
NULL)&&(*lib!=
'\0'))
653 Print(
"// proc %s from lib %s\n",
s,lib);
680 if (strlen(
s) >=4 && strcmp(&
s[ls-3],
"lib") == 0)
682 if (
s[ls - 4] ==
'.')
str =
s;
697 if ((
str[1]!=
'\0') &&
712 Warn(
"library %s has an old format. Please fix it for the next time",
716 while (fgets(
buf,
sizeof(
buf),
fp))
718 if (strncmp(
buf,
"//",2)==0)
722 else if ((strncmp(
buf,
"proc ",5)==0)||(strncmp(
buf,
"LIB ",4)==0))
724 if (!
found)
WarnS(
"no help part in library found");
const CanonicalForm int s
static void hePrintHelpStr(const idhdl hh, const char *id, const char *pa)
idhdl ggetid(const char *n)
BOOLEAN iiLocateLib(const char *lib, char *where)
char * iiGetLibProcBuffer(procinfo *pi, int part)
static char * iiGetLibName(const procinfov pi)
find the library of an proc
VAR char libnamebuf[1024]
int yylplex(const char *libname, const char *libfile, lib_style_types *lib_style, idhdl pl, BOOLEAN autoexport=FALSE, lp_modes=LOAD_LIB)
◆ hePrintHelpStr()
Definition at line 608 of file fehelp.cc.
616 Print(
"`%s` not found in package %s\n",
id,
pa);
BOOLEAN pa(leftv res, leftv args)
◆ heReKey2Entry()
static int heReKey2Entry |
( |
char * |
filename, |
|
|
char * |
key, |
|
|
heEntry |
hentry |
|
) |
| |
|
static |
Definition at line 568 of file fehelp.cc.
574 if (filename ==
NULL || key ==
NULL)
return 0;
575 fd = fopen(filename,
"r");
578 while (si_fscanf(
fd,
"%[^\t]\t%*[^\n]\n", index_key) == 1)
583 Werror(
"index file corrupt at line >>%s<<",index_key);
static BOOLEAN strmatch(char *s, char *re)
void Werror(const char *fmt,...)
◆ if()
if |
( |
! |
FE_OPT_NO_SHELL_FLAG | ) |
|
◆ Print()
Print |
( |
"running `%s`\n" |
, |
|
|
sys |
|
|
) |
| |
◆ show()
static int show |
( |
unsigned long |
offset, |
|
|
char * |
close |
|
) |
| |
|
static |
Definition at line 1082 of file fehelp.cc.
1091 while( (!feof(
help))
1095 printf(
"%s", buffer);
1098 printf(
"\n Press <RETURN> to continue or x to exit help.\n");
1100 *close = (char)getchar();
1111 printf(
"\nEnd of part. Press <RETURN> to continue or x to exit help.\n");
1113 *close = (char)getchar();
EXTERN_VAR int pagelength
◆ singular_manual()
static int singular_manual |
( |
char * |
str, |
|
|
BOOLEAN |
isIndexEntry, |
|
|
heEntry |
hentry |
|
) |
| |
|
static |
Definition at line 1122 of file fehelp.cc.
1144 while ((
p !=
str) && (*
p<=
' '));
1147 (void)sprintf(String,
" %s ",
str);
1151 (void)sprintf(String,
" %s",
str);
1157 char temp[256];temp[0]=
'\0';
1159 if (hentry !=
NULL && *(hentry->
url) !=
'\0')
1160 #ifdef HAVE_VSNPRINTF
1163 snprintf(temp,256,
"%s/%d-%d/%s", htmldir,
1167 snprintf(temp,256,
"%s/%d-%d-%d/%s", htmldir,
1177 sprintf(temp,
"%s/%d-%d/%s", htmldir,
1181 sprintf(temp,
"%s/%d-%d-%d/%s", htmldir,
1189 Print(
"url: %s\n",temp);
1194 if (si_sscanf(buffer,
"Node:%[^\177]\177%ld\n", Index, &
offset)!=2)
1199 (void)strcat(Index,
" ");
1200 if( strstr(Index, String)!=
NULL)
1205 else if( strcmp(Index, String)==0)
1217 Warn(
"`%s` not found",String);
static int show(unsigned long offset, char *close)
static char tolow(char p)
static int index(p_Length length, p_Ord ord)
◆ strclean()
static char * strclean |
( |
char * |
str | ) |
|
|
static |
Definition at line 364 of file fehelp.cc.
368 while ((*
s <=
' ') && (*
s !=
'\0'))
s++;
369 if (*
s ==
'\0')
return NULL;
371 while (*ss!=
'\0') ss++;
373 while ((*ss <=
' ') && (*ss !=
'\0'))
378 if (*ss ==
'\0')
return NULL;
◆ strmatch()
static BOOLEAN strmatch |
( |
char * |
s, |
|
|
char * |
re |
|
) |
| |
|
static |
Definition at line 480 of file fehelp.cc.
482 if (
s ==
NULL || *
s ==
'\0')
483 return (re ==
NULL || *re ==
'\0' || strcmp(re,
"*") == 0);
484 if (re ==
NULL || *re ==
'\0')
return FALSE;
489 char *
l, *r, *ll, *rr;
496 if (*
s >=
'A' && *
s <=
'Z') ls[
i] = *
s + (
'a' -
'A');
500 }
while (*
s !=
'\0');
508 if (*re >=
'A' && *re <=
'Z') rs[
i]= *re + (
'a' -
'A');
512 }
while (*re !=
'\0');
517 while (*r !=
'*' && *r !=
'\0' && *
l !=
'\0')
519 if (*r != *
l)
return FALSE;
525 if (*r ==
'\0')
return (*
l ==
'\0');
526 if (*r ==
'*' && r[1] ==
'\0')
return TRUE;
527 if (*
l ==
'\0')
return FALSE;
529 rr = &r[strlen(r) - 1];
530 ll = &
l[strlen(
l) - 1];
531 while (*rr !=
'*' && *rr !=
'\0' && *ll !=
'\0')
533 if (*rr != *ll)
return FALSE;
539 if (*rr ==
'\0')
return (*ll ==
'\0');
540 if (*rr ==
'*' && rr[-1] ==
'\0')
return TRUE;
541 if (*ll ==
'\0')
return FALSE;
549 while (*rr !=
'*' && *rr !=
'\0') rr++;
◆ tolow()
static char tolow |
( |
char |
p | ) |
|
|
inlinestatic |
Definition at line 1075 of file fehelp.cc.
1077 if ((
'A'<=
p)&&(
p<=
'Z'))
return p | 040;
◆ FE_OPT_NO_SHELL_FLAG
◆ feHelpCalled
◆ heCurrentHelpBrowser
◆ heCurrentHelpBrowserIndex
◆ heHelpBrowsers