/* Simple program to test out a given langmod */

#include <stdio.h>
#include <exec/types.h>

#include <proto/langmod.h>

/* Should read:
	"Nearly five and twenty to four (am)"
	"Thursday 12th December 1996"
*/

/* test result ok! */

struct Library *LangModBase;

struct EngTime etime ={
	3,0,34,1996,12,12,4
};

void main(int argc, char **argv) {
	char name[100];
	char buffer[200], buffer2[200];
	ULONG error;

	if(argc!=2) {
		printf("Incorrect args!\n\t%s {language name}\n\te.g: %s english\n",argv[0],argv[0]);
		return;
	}
	sprintf(name,"%s.langmod",argv[1]);

	if(!(LangModBase=OpenLibrary(name,0))) {
		printf("Unsupported language!\n");
		return;
	}
	
	printf("Time: %s\n",ECM_GetTimeStr((UBYTE *)&buffer[0],199,&error,&etime));
	if(error==ERR_BUFSIZE) 
		printf("Buffer size (time) was not big enough!\n");

	printf("Date: %s\n",ECM_GetDateStr((UBYTE *)&buffer2[0],199,&error,&etime));
	if(error==ERR_BUFSIZE) 
		printf("Buffer size (date) was not big enough!\n");
	
	end:
	CloseLibrary(LangModBase);
}