 |
My Project
debian-1:4.1.1-p2+ds-4build1
|
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.
187 while (fgets(
buf,
sizeof(
buf),
f))
189 if ((
buf[0]!=
'#') && (
buf[0]>
' ')) br++;
195 while (fgets(
buf,
sizeof(
buf),
f))
197 if ((
buf[0]!=
'#') && (
buf[0]>
' '))
200 char *req=strtok(
NULL,
"!");
201 char *cmd=strtok(
NULL,
"!");
204 while ((cmd[0]!=
'\0') && (cmd[strlen(cmd)-1]<=
' '))
205 cmd[strlen(cmd)-1]=
'\0';
216 Print(
"syntax error in help.cnf, at line starting with %s\n",
buf);
◆ feHelp()
void feHelp |
( |
char * |
str | ) |
|
Definition at line 89 of file fehelp.cc.
92 *****************************************************************/
101 BOOLEAN key_is_regexp = (strchr(str,
'*') !=
NULL);
105 memset(&hentry,0,
sizeof(hentry));
109 if (!key_is_regexp && (idxfile !=
NULL) &&
heKey2Entry(idxfile, str, &hentry))
139 strcpy(mkey + 1, str);
147 Warn(
"No help for topic '%s' (not even for '*%s*')", str, str);
148 WarnS(
"Try '?;' for general help");
149 WarnS(
"or '?Index;' for all available help topics.");
162 Warn(
"No unique help for '%s'", str);
164 Warn(
"No help for topic '%s'", str);
174 strcpy(hentry.
key, str);
◆ feHelpBrowser()
const char* feHelpBrowser |
( |
char * |
which, |
|
|
int |
warn |
|
) |
| |
Definition at line 248 of file fehelp.cc.
258 if (which ==
NULL || *which ==
'\0')
301 if (warn)
Warn(
"No help browser '%s' available.", which);
◆ feStringAppendBrowsers()
void feStringAppendBrowsers |
( |
int |
warn | ) |
|
◆ heBrowserHelp()
static void heBrowserHelp |
( |
heEntry |
hentry | ) |
|
|
static |
Definition at line 766 of file fehelp.cc.
768 *****************************************************************/
775 int kchksum = (hentry !=
NULL && hentry->
chksum > 0 ?
790 WarnS(
"Use 'system(\"--browser\", <browser>);' to change browser,");
801 if (browsers[strlen(browsers)-2] ==
',')
803 browsers[strlen(browsers)-2] =
'.';
804 browsers[strlen(browsers)-1] =
'\0';
◆ heBuiltinHelp()
static void heBuiltinHelp |
( |
heEntry |
hentry, |
|
|
int |
|
|
) |
| |
|
static |
Definition at line 1029 of file fehelp.cc.
1031 WarnS(
"to enter the Singular online help. For general");
1032 WarnS(
"information on Singular running under Emacs, type C-h m.");
◆ heDummyHelp()
static void heDummyHelp |
( |
heEntry |
hentry, |
|
|
int |
|
|
) |
| |
|
static |
◆ heDummyInit()
static BOOLEAN heDummyInit |
( |
int |
, |
|
|
int |
|
|
) |
| |
|
static |
◆ heEmacsHelp()
static void heEmacsHelp |
( |
heEntry |
hentry, |
|
|
int |
|
|
) |
| |
|
static |
◆ heEmacsInit()
static BOOLEAN heEmacsInit |
( |
int |
, |
|
|
int |
|
|
) |
| |
|
static |
◆ heGenHelp()
static void heGenHelp |
( |
heEntry |
hentry, |
|
|
int |
br |
|
) |
| |
|
static |
Definition at line 868 of file fehelp.cc.
894 if ((*
p==
'h')&&(htmldir!=
NULL))
895 strcat(sys,
"file://localhost");
896 else if ((*
p==
'H')||(htmldir==
NULL))
899 if (hentry !=
NULL && *(hentry->
url) !=
'\0')
900 #ifdef HAVE_VSNPRINTF
904 snprintf(temp,256,
"%s/%d-%d/%s", htmldir,
908 snprintf(temp,256,
"%s/%d-%d-%d/%s", htmldir,
915 snprintf(temp,256,
"%s/%s", htmldir, hentry->
url);
920 snprintf(temp,256,
"%s/%d-%d-%d/index.htm", htmldir,
926 snprintf(temp,256,
"%s/index.htm", htmldir);
931 sprintf(temp,
"%s/%d-%d-%d/%s", htmldir,
937 sprintf(temp,
"%s/%d-%d-%d/%s", htmldir, hentry->
url);
941 sprintf(temp,
"%s/%d-%d-%d/index.htm", htmldir,
947 sprintf(temp,
"%s/index.htm", htmldir);
953 char *
pp=(
char *)strchr(sys,
'#');
967 if (i_res!=
NULL) strcat(sys,i_res);
970 WarnS(
"singular.hlp not found");
979 if ((hentry!=
NULL) && (*(hentry->
node) !=
'\0'))
980 sprintf(temp,
"%s",hentry->
node);
◆ heGenInit()
static BOOLEAN heGenInit |
( |
int |
warn, |
|
|
int |
br |
|
) |
| |
|
static |
Definition at line 809 of file fehelp.cc.
830 if (warn)
Warn(
"resource `%c` not found",*
p);
837 if (warn)
WarnS(
"resource `D` not found");
850 while (((*
p==
':')||(*
p<=
' ')) && (*
p!=
'\0'))
p++;
851 while((
i<127) && (*
p>
' ') && (*
p!=
':'))
857 if ((op==
'O') && (strcmp(
name,S_UNAME)!=0))
861 if (warn)
Warn(
"executable `%s` not found",
name);
866 default:
Warn(
"unknown char %c",*
p);
◆ heKey2Entry()
static BOOLEAN heKey2Entry |
( |
char * |
filename, |
|
|
char * |
key, |
|
|
heEntry |
hentry |
|
) |
| |
|
static |
Definition at line 386 of file fehelp.cc.
396 *(hentry->
key) =
'\0';
397 *(hentry->
url) =
'\0';
398 *(hentry->
node) =
'\0';
401 fd = fopen(filename,
"r");
407 while ((c = getc(
fd)) != EOF)
412 while (getc(
fd) !=
'\n') {};
425 if (getc(
fd) !=
'\t')
goto Failure;
428 if (hentry->
key != key) strcpy(hentry->
key, key);
431 while ((c = getc(
fd)) !=
'\t' && c != EOF)
436 if (c == EOF)
goto Failure;
437 if (hentry->
node[0]==
'\0')
438 strcpy(hentry->
node,hentry->
key);
443 while ((c = getc(
fd)) !=
'\t' && c != EOF)
448 if (c == EOF)
goto Failure;
451 hentry->
url[
i] =
'\0';
453 if (si_fscanf(
fd,
"%ld\n", &(hentry->
chksum)) != 1)
◆ heKeyChksum()
static long heKeyChksum |
( |
char * |
key | ) |
|
|
static |
Definition at line 747 of file fehelp.cc.
754 if (key ==
NULL || *key ==
'\0')
return 0;
◆ heOnlineHelp()
static BOOLEAN heOnlineHelp |
( |
char * |
s | ) |
|
|
static |
Definition at line 619 of file fehelp.cc.
629 if ((ss=strstr(
s,
"::"))!=
NULL)
636 Print(
"help for %s from package %s\n",ss,
s);
639 strcat(s_help,
"_help");
644 else Print(
"package %s not found\n",
s);
654 if((lib!=
NULL)&&(*lib!=
'\0'))
656 Print(
"// proc %s from lib %s\n",
s,lib);
683 if (strlen(
s) >=4 && strcmp(&
s[ls-3],
"lib") == 0)
685 if (
s[ls - 4] ==
'.') str =
s;
700 if ((str[1]!=
'\0') &&
715 Warn(
"library %s has an old format. Please fix it for the next time",
719 while (fgets(
buf,
sizeof(
buf),
fp))
721 if (strncmp(
buf,
"//",2)==0)
725 else if ((strncmp(
buf,
"proc ",5)==0)||(strncmp(
buf,
"LIB ",4)==0))
727 if (!
found)
WarnS(
"no help part in library found");
◆ hePrintHelpStr()
◆ heReKey2Entry()
static int heReKey2Entry |
( |
char * |
filename, |
|
|
char * |
key, |
|
|
heEntry |
hentry |
|
) |
| |
|
static |
Definition at line 566 of file fehelp.cc.
577 if (filename ==
NULL || key ==
NULL)
return 0;
578 fd = fopen(filename,
"r");
581 while (si_fscanf(
fd,
"%[^\t]\t%*[^\n]\n", index_key) == 1)
586 Werror(
"index file corrupt at line >>%s<<",index_key);
◆ Print()
Print |
( |
"running `%s`\n" |
, |
|
|
sys |
|
|
) |
| |
◆ show()
static int show |
( |
unsigned long |
offset, |
|
|
char * |
close |
|
) |
| |
|
static |
Definition at line 1056 of file fehelp.cc.
1057 if ((
'A'<=
p)&&(
p<=
'Z'))
return p | 040;
1062 static int show(
unsigned long offset,
char *close)
1071 while( (!feof(
help))
1075 printf(
"%s", buffer);
1078 printf(
"\n Press <RETURN> to continue or x to exit help.\n");
1080 *close = (char)getchar();
1091 printf(
"\nEnd of part. Press <RETURN> to continue or x to exit help.\n");
1093 *close = (char)getchar();
◆ singular_manual()
static int singular_manual |
( |
char * |
str, |
|
|
BOOLEAN |
isIndexEntry |
|
) |
| |
|
static |
Definition at line 1096 of file fehelp.cc.
1110 Print(
"HELP >>%s>>\n",str);
1124 while ((
p != str) && (*
p<=
' '));
1127 (void)sprintf(String,
" %s ", str);
1131 (void)sprintf(String,
" %s", str);
1141 if (si_sscanf(buffer,
"Node:%[^\177]\177%ld\n", Index, &
offset)!=2)
1146 (void)strcat(Index,
" ");
1147 if( strstr(Index, String)!=
NULL)
1152 else if( strcmp(Index, String)==0)
◆ strclean()
static char * strclean |
( |
char * |
str | ) |
|
|
static |
Definition at line 362 of file fehelp.cc.
365 *****************************************************************/
371 while ((*
s <=
' ') && (*
s !=
'\0'))
s++;
372 if (*
s ==
'\0')
return NULL;
374 while (*ss!=
'\0') ss++;
376 while ((*ss <=
' ') && (*ss !=
'\0'))
◆ strmatch()
static BOOLEAN strmatch |
( |
char * |
s, |
|
|
char * |
re |
|
) |
| |
|
static |
Definition at line 478 of file fehelp.cc.
485 if (
s ==
NULL || *
s ==
'\0')
486 return (re ==
NULL || *re ==
'\0' || strcmp(re,
"*") == 0);
487 if (re ==
NULL || *re ==
'\0')
return FALSE;
492 char *
l, *r, *ll, *rr;
499 if (*
s >=
'A' && *
s <=
'Z') ls[
i] = *
s + (
'a' -
'A');
503 }
while (*
s !=
'\0');
511 if (*re >=
'A' && *re <=
'Z') rs[
i]= *re + (
'a' -
'A');
515 }
while (*re !=
'\0');
520 while (*r !=
'*' && *r !=
'\0' && *
l !=
'\0')
522 if (*r != *
l)
return FALSE;
528 if (*r ==
'\0')
return (*
l ==
'\0');
529 if (*r ==
'*' && r[1] ==
'\0')
return TRUE;
530 if (*
l ==
'\0')
return FALSE;
532 rr = &r[strlen(r) - 1];
533 ll = &
l[strlen(
l) - 1];
534 while (*rr !=
'*' && *rr !=
'\0' && *ll !=
'\0')
536 if (*rr != *ll)
return FALSE;
542 if (*rr ==
'\0')
return (*ll ==
'\0');
543 if (*rr ==
'*' && rr[-1] ==
'\0')
return TRUE;
544 if (*ll ==
'\0')
return FALSE;
552 while (*rr !=
'*' && *rr !=
'\0') rr++;
◆ system()
◆ tolow()
static char tolow |
( |
char |
p | ) |
|
|
inlinestatic |
◆ feHelpCalled
◆ heCurrentHelpBrowser
◆ heCurrentHelpBrowserIndex
int heCurrentHelpBrowserIndex = -1 |
|
static |
◆ heHelpBrowsers
static int show(unsigned long offset, char *close)
static char * iiGetLibName(const procinfov pi)
find the library of an proc
static BOOLEAN feHelpCalled
void StringAppendS(const char *st)
static int singular_manual(char *str, BOOLEAN isIndexEntry)
FILE * feFopen(const char *path, const char *mode, char *where, short useWerror, short path_only)
static int heReKey2Entry(char *filename, char *key, heEntry hentry)
static void feBrowserFile()
heBrowserInitProc init_proc
BOOLEAN iiLocateLib(const char *lib, char *where)
int yylplex(const char *libname, const char *libfile, lib_style_types *lib_style, idhdl pl, BOOLEAN autoexport=FALSE, lp_modes=LOAD_LIB)
static BOOLEAN heOnlineHelp(char *s)
static BOOLEAN heEmacsInit(int, int)
static void heBuiltinHelp(heEntry hentry, int)
char key[MAX_HE_ENTRY_LENGTH]
static BOOLEAN heDummyInit(int, int)
#define MAX_HE_ENTRY_LENGTH
int status int void * buf
void PrintS(const char *s)
static void hePrintHelpStr(const idhdl hh, const char *id, const char *pa)
Print("running `%s`\n", sys)
char * iiGetLibProcBuffer(procinfo *pi, int part)
static void heBrowserHelp(heEntry hentry)
static void heEmacsHelp(heEntry hentry, int)
static heBrowser heCurrentHelpBrowser
static void heGenHelp(heEntry hentry, int)
static int heCurrentHelpBrowserIndex
static BOOLEAN heKey2Entry(char *filename, char *key, heEntry hentry)
static void heDummyHelp(heEntry hentry, int)
char node[MAX_HE_ENTRY_LENGTH]
static long heKeyChksum(char *key)
char * omFindExec(const char *name, char *exec)
struct fe_option feOptSpec[]
heBrowserHelpProc help_proc
static char * feResource(feResourceConfig config, int warn)
void StringSetS(const char *st)
void Werror(const char *fmt,...)
char name(const Variable &v)
void WerrorS(const char *s)
static heBrowser_s * heHelpBrowsers
static char tolow(char p)
static BOOLEAN heGenInit(int, int)
char url[MAX_HE_ENTRY_LENGTH]
static BOOLEAN strmatch(char *s, char *re)
idhdl ggetid(const char *n)
const CanonicalForm int s
static void * feOptValue(feOptIndex opt)
static int index(p_Length length, p_Ord ord)
static char * strclean(char *str)
const char * feHelpBrowser(char *which, int warn)