Changeset 35664ec in git
- Timestamp:
- May 3, 2005, 4:30:09 PM (18 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '23b0a9c07070b684aa12355009488dc00d9501e3')
- Children:
- 762bfd45c4210aff6f5f912140dfdf36131213c9
- Parents:
- 2e6eac218988a6cdb89b0be44b0a24dd62ac41a7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/fehelp.cc
r2e6eac2 r35664ec 4 4 /* 5 5 * ABSTRACT: help system 6 * versin $Id: fehelp.cc,v 1.4 1 2005-05-02 16:31:55Singular Exp $6 * versin $Id: fehelp.cc,v 1.42 2005-05-03 14:30:09 Singular Exp $ 7 7 */ 8 8 … … 637 637 } 638 638 639 // test for h being a string and print it 640 static void hePrintHelpStr(const idhdl hh,const char *id,const char *pa) 641 { 642 if ((hh!=NULL) && (IDTYP(hh)==STRING_CMD)) 643 { 644 PrintS(IDSTRING(hh)); 645 PrintLn(); 646 } 647 else 648 Print("`%s` not found in package %s\n",id,pa); 649 } 639 650 // try to find the help string as a loaded procedure or library 640 651 // if found, display the help and return TRUE … … 642 653 static BOOLEAN heOnlineHelp(char* s) 643 654 { 644 #ifdef HAVE_NS645 655 idhdl h=IDROOT->get(s,myynest); 646 #else 647 idhdl h=idroot->get(s,myynest); 648 #endif /* HAVE_NS */ 656 char *ss; 649 657 650 658 // try help for a procedure 651 if ((h!=NULL) && (IDTYP(h)==PROC_CMD)) 652 { 653 char *lib=iiGetLibName(IDPROC(h)); 654 if((lib!=NULL)&&(*lib!='\0')) 655 { 656 Print("// proc %s from lib %s\n",s,lib); 657 s=iiGetLibProcBuffer(IDPROC(h), 0); 658 if (s!=NULL) 659 { 660 PrintS(s); 661 omFree((ADDRESS)s); 662 } 663 return TRUE; 659 if (h!=NULL) 660 { 661 if (IDTYP(h)==PROC_CMD) 662 { 663 char *lib=iiGetLibName(IDPROC(h)); 664 if((lib!=NULL)&&(*lib!='\0')) 665 { 666 Print("// proc %s from lib %s\n",s,lib); 667 s=iiGetLibProcBuffer(IDPROC(h), 0); 668 if (s!=NULL) 669 { 670 PrintS(s); 671 omFree((ADDRESS)s); 672 } 673 return TRUE; 674 } 675 else 676 { 677 char s_help[200]; 678 strcpy(s_help,s); 679 strcat(s_help,"_help"); 680 idhdl hh=IDROOT->get(s_help,0); 681 hePrintHelpStr(hh,s_help,"Top"); 682 } 683 } 684 else if (IDTYP(h)==PACKAGE_CMD) 685 { 686 idhdl hh=IDPACKAGE(h)->idroot->get("info",0); 687 hePrintHelpStr(hh,"info",s); 688 } 689 else if ((ss=strstr(s,"::"))!=NULL) 690 { 691 *ss='\0'; 692 ss+=2; 693 h=ggetid(s); 694 if (h!=NULL) 695 { 696 Print("help for %s from package %\n",ss,s); 697 char s_help[200]; 698 strcpy(s_help,ss); 699 strcat(s_help,"_help"); 700 idhdl hh=IDPACKAGE(h)->idroot->get(s_help,0); 701 hePrintHelpStr(hh,s_help,s); 702 } 703 else Print("package %s not found\n",s); 664 704 } 665 705 return FALSE;
Note: See TracChangeset
for help on using the changeset viewer.