try to find the help string as a loaded procedure or library if found, display the help and return TRUE otherwise, return FALSE
| 619 | // if found, display the help and return TRUE |
| 620 | // otherwise, return FALSE |
| 621 | static 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; |
no test coverage detected