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) |
|
void | system (sys) |
|
static int | singular_manual (char *str, BOOLEAN isIndexEntry) |
|
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 176 of file fehelp.cc.
183 while (fgets(
buf,
sizeof(
buf),
f))
185 if ((
buf[0]!=
'#') && (
buf[0]>
' ')) br++;
191 while (fgets(
buf,
sizeof(
buf),
f))
193 if ((
buf[0]!=
'#') && (
buf[0]>
' '))
196 char *req=strtok(
NULL,
"!");
197 char *cmd=strtok(
NULL,
"!");
200 while ((cmd[0]!=
'\0') && (cmd[strlen(cmd)-1]<=
' '))
201 cmd[strlen(cmd)-1]=
'\0';
212 Print(
"syntax error in help.cnf, at line starting with %s\n",
buf);
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
int name
New type name for int.
◆ feHelp()
void feHelp |
( |
char * |
str | ) |
|
Definition at line 89 of file fehelp.cc.
101 memset(&hentry,0,
sizeof(hentry));
135 strcpy(mkey + 1,
str);
143 Warn(
"No help for topic '%s' (not even for '*%s*')",
str,
str);
144 WarnS(
"Try '?;' for general help");
145 WarnS(
"or '?Index;' for all available help topics.");
158 Warn(
"No unique help for '%s'",
str);
160 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 248 of file fehelp.cc.
254 if (which ==
NULL || *which ==
'\0')
297 if (warn)
Warn(
"No help browser '%s' available.", which);
330 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 340 of file fehelp.cc.
void StringAppendS(const char *st)
◆ heBrowserHelp()
static void heBrowserHelp |
( |
heEntry |
hentry | ) |
|
|
static |
Definition at line 768 of file fehelp.cc.
771 int kchksum = (hentry !=
NULL && hentry->
chksum > 0 ?
786 WarnS(
"Use 'system(\"--browser\", <browser>);' to change browser,");
797 if (browsers[strlen(browsers)-2] ==
',')
799 browsers[strlen(browsers)-2] =
'.';
800 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 1031 of file fehelp.cc.
1034 hentry->
key :
"Top");
static int singular_manual(char *str, BOOLEAN isIndexEntry)
◆ heDummyHelp()
static void heDummyHelp |
( |
heEntry |
hentry, |
|
|
int |
|
|
) |
| |
|
static |
Definition at line 1013 of file fehelp.cc.
1015 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 1022 of file fehelp.cc.
1024 WarnS(
"Your help command could not be executed. Use");
1026 (hentry !=
NULL && *(hentry->
node) !=
'\0' ? hentry->
node :
"Top"));
1027 WarnS(
"to enter the Singular online help. For general");
1028 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 870 of file fehelp.cc.
890 if ((*
p==
'h')&&(htmldir!=
NULL))
891 strcat(sys,
"file://localhost");
892 else if ((*
p==
'H')||(htmldir==
NULL))
895 if (hentry !=
NULL && *(hentry->
url) !=
'\0')
896 #ifdef HAVE_VSNPRINTF
900 snprintf(temp,256,
"%s/%d-%d/%s", htmldir,
904 snprintf(temp,256,
"%s/%d-%d-%d/%s", htmldir,
911 snprintf(temp,256,
"%s/%s", htmldir, hentry->
url);
916 snprintf(temp,256,
"%s/%d-%d-%d/index.htm", htmldir,
922 snprintf(temp,256,
"%s/index.htm", htmldir);
927 sprintf(temp,
"%s/%d-%d-%d/%s", htmldir,
933 sprintf(temp,
"%s/%d-%d-%d/%s", htmldir, hentry->
url);
937 sprintf(temp,
"%s/%d-%d-%d/index.htm", htmldir,
943 sprintf(temp,
"%s/index.htm", htmldir);
949 char *
pp=(
char *)strchr(sys,
'#');
963 if (i_res!=
NULL) strcat(sys,i_res);
966 WarnS(
"singular.info not found");
975 if ((hentry!=
NULL) && (*(hentry->
node) !=
'\0'))
976 sprintf(temp,
"%s",hentry->
node);
◆ heGenInit()
static BOOLEAN heGenInit |
( |
int |
warn, |
|
|
int |
br |
|
) |
| |
|
static |
Definition at line 811 of file fehelp.cc.
826 if (warn)
Warn(
"resource `%c` not found",*
p);
833 if (warn)
WarnS(
"resource `D` not found");
846 while (((*
p==
':')||(*
p<=
' ')) && (*
p!=
'\0'))
p++;
847 while((
i<127) && (*
p>
' ') && (*
p!=
':'))
853 if ((op==
'O') && (strcmp(
name,S_UNAME)!=0))
857 if (warn)
Warn(
"executable `%s` not found",
name);
862 default:
Warn(
"unknown char %c",*
p);
char * omFindExec(const char *name, char *exec)
◆ heKey2Entry()
static BOOLEAN heKey2Entry |
( |
char * |
filename, |
|
|
char * |
key, |
|
|
heEntry |
hentry |
|
) |
| |
|
static |
Definition at line 387 of file fehelp.cc.
392 *(hentry->
key) =
'\0';
393 *(hentry->
url) =
'\0';
394 *(hentry->
node) =
'\0';
397 fd = fopen(filename,
"r");
403 while ((c = getc(
fd)) != EOF)
408 while (getc(
fd) !=
'\n') {};
421 if (getc(
fd) !=
'\t')
goto Failure;
424 if (hentry->
key != key) strcpy(hentry->
key, key);
427 while ((c = getc(
fd)) !=
'\t' && c != EOF)
432 if (c == EOF)
goto Failure;
433 if (hentry->
node[0]==
'\0')
434 strcpy(hentry->
node,hentry->
key);
439 while ((c = getc(
fd)) !=
'\t' && c != EOF)
444 if (c == EOF)
goto Failure;
447 hentry->
url[
i] =
'\0';
449 if (si_fscanf(
fd,
"%ld\n", &(hentry->
chksum)) != 1)
◆ heKeyChksum()
static long heKeyChksum |
( |
char * |
key | ) |
|
|
static |
Definition at line 748 of file fehelp.cc.
750 if (key ==
NULL || *key ==
'\0')
return 0;
755 if (
pi !=
NULL)
return pi->data.s.help_chksum;
◆ heOnlineHelp()
static BOOLEAN heOnlineHelp |
( |
char * |
s | ) |
|
|
static |
Definition at line 620 of file fehelp.cc.
625 if ((ss=strstr(
s,
"::"))!=
NULL)
632 Print(
"help for %s from package %s\n",ss,
s);
635 strcat(s_help,
"_help");
640 else Print(
"package %s not found\n",
s);
650 if((lib!=
NULL)&&(*lib!=
'\0'))
652 Print(
"// proc %s from lib %s\n",
s,lib);
679 if (strlen(
s) >=4 && strcmp(&
s[ls-3],
"lib") == 0)
681 if (
s[ls - 4] ==
'.')
str =
s;
696 if ((
str[1]!=
'\0') &&
711 Warn(
"library %s has an old format. Please fix it for the next time",
715 while (fgets(
buf,
sizeof(
buf),
fp))
717 if (strncmp(
buf,
"//",2)==0)
721 else if ((strncmp(
buf,
"proc ",5)==0)||(strncmp(
buf,
"LIB ",4)==0))
723 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 607 of file fehelp.cc.
615 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 567 of file fehelp.cc.
573 if (filename ==
NULL || key ==
NULL)
return 0;
574 fd = fopen(filename,
"r");
577 while (si_fscanf(
fd,
"%[^\t]\t%*[^\n]\n", index_key) == 1)
582 Werror(
"index file corrupt at line >>%s<<",index_key);
static BOOLEAN strmatch(char *s, char *re)
void Werror(const char *fmt,...)
◆ Print()
Print |
( |
"running `%s`\n" |
, |
|
|
sys |
|
|
) |
| |
◆ show()
static int show |
( |
unsigned long |
offset, |
|
|
char * |
close |
|
) |
| |
|
static |
Definition at line 1058 of file fehelp.cc.
1067 while( (!feof(
help))
1071 printf(
"%s", buffer);
1074 printf(
"\n Press <RETURN> to continue or x to exit help.\n");
1076 *close = (char)getchar();
1087 printf(
"\nEnd of part. Press <RETURN> to continue or x to exit help.\n");
1089 *close = (char)getchar();
EXTERN_VAR int pagelength
◆ singular_manual()
static int singular_manual |
( |
char * |
str, |
|
|
BOOLEAN |
isIndexEntry |
|
) |
| |
|
static |
Definition at line 1098 of file fehelp.cc.
1120 while ((
p !=
str) && (*
p<=
' '));
1123 (void)sprintf(String,
" %s ",
str);
1127 (void)sprintf(String,
" %s",
str);
1137 if (si_sscanf(buffer,
"Node:%[^\177]\177%ld\n", Index, &
offset)!=2)
1142 (void)strcat(Index,
" ");
1143 if( strstr(Index, String)!=
NULL)
1148 else if( strcmp(Index, String)==0)
1160 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 363 of file fehelp.cc.
367 while ((*
s <=
' ') && (*
s !=
'\0'))
s++;
368 if (*
s ==
'\0')
return NULL;
370 while (*ss!=
'\0') ss++;
372 while ((*ss <=
' ') && (*ss !=
'\0'))
377 if (*ss ==
'\0')
return NULL;
◆ strmatch()
static BOOLEAN strmatch |
( |
char * |
s, |
|
|
char * |
re |
|
) |
| |
|
static |
Definition at line 479 of file fehelp.cc.
481 if (
s ==
NULL || *
s ==
'\0')
482 return (re ==
NULL || *re ==
'\0' || strcmp(re,
"*") == 0);
483 if (re ==
NULL || *re ==
'\0')
return FALSE;
488 char *
l, *r, *ll, *rr;
495 if (*
s >=
'A' && *
s <=
'Z') ls[
i] = *
s + (
'a' -
'A');
499 }
while (*
s !=
'\0');
507 if (*re >=
'A' && *re <=
'Z') rs[
i]= *re + (
'a' -
'A');
511 }
while (*re !=
'\0');
516 while (*r !=
'*' && *r !=
'\0' && *
l !=
'\0')
518 if (*r != *
l)
return FALSE;
524 if (*r ==
'\0')
return (*
l ==
'\0');
525 if (*r ==
'*' && r[1] ==
'\0')
return TRUE;
526 if (*
l ==
'\0')
return FALSE;
528 rr = &r[strlen(r) - 1];
529 ll = &
l[strlen(
l) - 1];
530 while (*rr !=
'*' && *rr !=
'\0' && *ll !=
'\0')
532 if (*rr != *ll)
return FALSE;
538 if (*rr ==
'\0')
return (*ll ==
'\0');
539 if (*rr ==
'*' && rr[-1] ==
'\0')
return TRUE;
540 if (*ll ==
'\0')
return FALSE;
548 while (*rr !=
'*' && *rr !=
'\0') rr++;
◆ system()
◆ tolow()
static char tolow |
( |
char |
p | ) |
|
|
inlinestatic |
Definition at line 1051 of file fehelp.cc.
1053 if ((
'A'<=
p)&&(
p<=
'Z'))
return p | 040;
◆ feHelpCalled
◆ heCurrentHelpBrowser
◆ heCurrentHelpBrowserIndex
◆ heHelpBrowsers