MCPcopy Create free account
hub / github.com/Singular/Singular / heOnlineHelp

Function heOnlineHelp

Singular/fehelp.cc:621–747  ·  view source on GitHub ↗

try to find the help string as a loaded procedure or library if found, display the help and return TRUE otherwise, return FALSE

Source from the content-addressed store, hash-verified

619// if found, display the help and return TRUE
620// otherwise, return FALSE
621static BOOLEAN heOnlineHelp(char* s)
622{
623 char *ss;
624 idhdl h;
625
626 if ((ss=strstr(s,"::"))!=NULL)
627 {
628 *ss='\0';
629 ss+=2;
630 h=ggetid(s);
631 if (h!=NULL)
632 {
633 Print("help for %s from package %s\n",ss,s);
634 char s_help[200];
635 strcpy(s_help,ss);
636 strcat(s_help,"_help");
637 idhdl hh=IDPACKAGE(h)->idroot->get(s_help,0);
638 hePrintHelpStr(hh,s_help,s);
639 return TRUE;
640 }
641 else Print("package %s not found\n",s);
642 return TRUE; /* do not search the manual */
643 }
644 h=IDROOT->get(s,myynest);
645 // try help for a procedure
646 if (h!=NULL)
647 {
648 if (IDTYP(h)==PROC_CMD)
649 {
650 char *lib=iiGetLibName(IDPROC(h));
651 if((lib!=NULL)&&(*lib!='\0'))
652 {
653 Print("// proc %s from lib %s\n",s,lib);
654 procinfov pi=IDPROC(h);
655 if (pi->language==LANG_SINGULAR)
656 {
657 s=iiGetLibProcBuffer(pi, 0);
658 if (s!=NULL)
659 {
660 PrintS(s);
661 omFree((ADDRESS)s);
662 }
663 return TRUE;
664 }
665 }
666 }
667 else if (IDTYP(h)==PACKAGE_CMD)
668 {
669 idhdl hh=IDPACKAGE(h)->idroot->get("info",0);
670 hePrintHelpStr(hh,"info",s);
671 return TRUE;
672 }
673 return FALSE;
674 }
675
676 // try help for a library
677 int ls = strlen(s);
678 char* str = NULL;

Callers 2

feHelpFunction · 0.85
heBrowserHelpFunction · 0.85

Calls 12

ggetidFunction · 0.85
hePrintHelpStrFunction · 0.85
iiGetLibNameFunction · 0.85
iiGetLibProcBufferFunction · 0.85
PrintSFunction · 0.85
iiLocateLibFunction · 0.85
feFopenFunction · 0.85
reinit_yylpFunction · 0.85
WarnFunction · 0.85
WarnSFunction · 0.85
PrintFunction · 0.50
getMethod · 0.45

Tested by

no test coverage detected