Nife version Beta
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

56 lines
1.5 KiB

  1. /* Copyright (C) 2011-2013 Patrick H. E. Foubet - S.E.R.I.A.N.E.
  2. This program is free software: you can redistribute it and/or modify
  3. it under the terms of the GNU General Public License as published by
  4. the Free Software Foundation, either version 3 of the License, or any
  5. later version.
  6. This program is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  9. GNU General Public License for more details.
  10. You should have received a copy of the GNU General Public License
  11. along with this program. If not, see <http://www.gnu.org/licenses/>
  12. *******************************************************************/
  13. /* help.c */
  14. #include <stdio.h>
  15. #include <string.h>
  16. #include "help.h"
  17. #include "nife.h"
  18. #define LHLP 200 /* longueur MAX des lignes du fichier hlp */
  19. static char buf[LHLP];
  20. void helpStd(char * L)
  21. {
  22. FILE * fd;
  23. int debut=0,l;
  24. dropTrSuite();
  25. if ((fd = fopen("nife.hlp","r")) == NULL) {
  26. perror("help file");
  27. return;
  28. } else {
  29. while (fgets(buf,LHLP,fd) != NULL) {
  30. if (debut) {
  31. if (buf[0] != ' ') break;
  32. } else {
  33. if (buf[0] == ' ') continue;
  34. l=strlen(L);
  35. if (strncmp(L,buf,l)!=0) continue;
  36. if (buf[l]!=' ') continue;
  37. debut=1;
  38. }
  39. printf("%s",buf);
  40. }
  41. }
  42. if (debut==0) printf("No help find !\n");
  43. fclose(fd);
  44. }
  45. void IF_help(void)
  46. {
  47. putTrSuite(helpStd);
  48. }