/*
 *   FileInfo © Dirk Holtwick, 1996
 *
 *   Small tool that demonstrates how to get informations of
 *   a DITO vocabulary file, without loading it.
 *
 */

#include <stdio.h>

#include <proto/exec.h>
#include <proto/dito.h>

struct Library *DitoBase;

struct DITO_FileInfo fi;

main(int argc, char *argv[]){
	if(argc==2){
		if(DitoBase = OpenLibrary(DITO_NAME, DITO_VMIN)){
			DITO_GetFileInfo (&fi, argv[1]);
			printf(
				"\033[1mFileinfo of '%s'\033[0m\n\n"
				"Language:   %s\n"
				"Version:    %x\n"
				"Author:     %s\n"
				"Title:      %s\n"
				"Descript.:  %s\n"
				"Comment:    %s\n"
				"Entries:    %d\n",
				argv[1],
				fi.Language,
				fi.Version,
				fi.Author,
				fi.Title,
				fi.Description,
				fi.Comment,
				fi.Sum
			);
			CloseLibrary(DitoBase);

		}else puts("Couldn't open required version of dito.library");

	}else puts("USAGE: DITOFileInfo [file.voc]");
}
