]> www.wagner.pp.ru Git - oss/catdoc.git/blob - compat/langinfo.c
Add detection of ZIP-archive and report that this type of file (i.e. OOXML or OpenDoc...
[oss/catdoc.git] / compat / langinfo.c
1 #include <stdlib.h>
2 #include <stdio.h>
3 #include <dos.h>
4 #include <langinfo.h>
5
6 static char *badParam="";
7 char* __get_dos_codepage(void) {
8         static char codePageName[10];
9         union REGS regs;
10         regs.x.ax=0x6601;
11         intdos(&regs,&regs);
12         sprintf(codePageName,"cp%d",(regs.x.bx & 0xFFFF));
13         if (regs.x.cflag) {
14                 return badParam;
15         }
16         return codePageName;
17 }       
18 char *nl_langinfo(nl_item item) {
19    if (item == CODESET) {
20                 return __get_dos_codepage();
21    } else {
22            return badParam;
23    }       
24 }       
25