From 68a07bf03b7624c9924065cce9ffa45497225834 Mon Sep 17 00:00:00 2001 From: Akinori Ito Date: Thu, 8 Nov 2001 05:14:08 +0000 Subject: Initial revision --- islang.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 islang.c (limited to 'islang.c') diff --git a/islang.c b/islang.c new file mode 100644 index 0000000..af124c7 --- /dev/null +++ b/islang.c @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2000, NBG01720@nifty.ne.jp + * + * To compile this program: + * gcc -Zomf -Zcrtdll -O2 -Wall -s islang.c + */ +#define INCL_DOSNLS +#include +#include +#include +#include +#include + +int main(int argc,char**argv){ + if(argc<=1) + return 1; + + if(isdigit((int)*argv[1])){ + ULONG CpList[8],CpSize; + APIRET rc=DosQueryCp(sizeof(CpList),CpList,&CpSize); + if(rc) + return rc; + while(--argc>0) + if(*CpList==atoi(argv[argc])) + return 0; + }else{ + char*lang=getenv("LANG"); + if(!lang||!*lang){ + lang=getenv("LANGUAGE"); + if(!lang||!*lang) + return 1; + } + if(!strnicmp(lang,argv[1],2)) + return 0; + } + return 1; +} -- cgit v1.2.3