home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Applications / UIFlow 1.0.1 / UIFlow Source / VSet2.0 / temp / vtest6.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-12-12  |  748 b   |  29 lines  |  [TEXT/????]

  1. #include "vg.h"
  2. main(ac,av) int ac; char**av; {
  3. DF * f;
  4. char * fname;
  5. char name[80];
  6. int id;
  7.  
  8. printf("%s: tests the routines VSfind() and Vfind()\n",av[0]);
  9. printf(" Enter a vgroup or vdata name, and the program will look in the\n");
  10. printf("given hdf-file and return the id (ref) of the vgroup or vdata\n\n");
  11.  
  12. if (ac!=2) { printf("usage: %s hdffile\n",av[0]); exit(0); }
  13.  
  14. fname = av[1];
  15. if (NULL == (f=DFopen(fname,DFACC_ALL,0))) {
  16.     printf("error open %s\n", fname); exit(0);    
  17.     }
  18. while(1) {
  19.   printf("find what? (or 'quit') ");
  20.   scanf("%s",name); if (!strcmp(name,"quit")) break;
  21.   id = VSfind (f,name);    
  22.   printf("VSfind [%s] rets id= %d\n", name, id);
  23.   id = Vfind (f,name);    
  24.   printf("Vfind [%s] rets id= %d\n", name, id);
  25.   }
  26. DFclose(f);
  27. }
  28.  
  29.