home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / misc / edu / DITOdev.lha / DITOdev / Library / Examples / FileInfo.c next >
Encoding:
C/C++ Source or Header  |  1997-01-23  |  898 b   |  46 lines

  1. /*
  2.  *   FileInfo © Dirk Holtwick, 1996
  3.  *
  4.  *   Small tool that demonstrates how to get informations of
  5.  *   a DITO vocabulary file, without loading it.
  6.  *
  7.  */
  8.  
  9. #include <stdio.h>
  10.  
  11. #include <proto/exec.h>
  12. #include <proto/dito.h>
  13.  
  14. struct Library *DitoBase;
  15.  
  16. struct DITO_FileInfo fi;
  17.  
  18. main(int argc, char *argv[]){
  19.     if(argc==2){
  20.         if(DitoBase = OpenLibrary(DITO_NAME, DITO_VMIN)){
  21.             DITO_GetFileInfo (&fi, argv[1]);
  22.             printf(
  23.                 "\033[1mFileinfo of '%s'\033[0m\n\n"
  24.                 "Language:   %s\n"
  25.                 "Version:    %x\n"
  26.                 "Author:     %s\n"
  27.                 "Title:      %s\n"
  28.                 "Descript.:  %s\n"
  29.                 "Comment:    %s\n"
  30.                 "Entries:    %d\n",
  31.                 argv[1],
  32.                 fi.Language,
  33.                 fi.Version,
  34.                 fi.Author,
  35.                 fi.Title,
  36.                 fi.Description,
  37.                 fi.Comment,
  38.                 fi.Sum
  39.             );
  40.             CloseLibrary(DitoBase);
  41.  
  42.         }else puts("Couldn't open required version of dito.library");
  43.  
  44.     }else puts("USAGE: DITOFileInfo [file.voc]");
  45. }
  46.