76,54 → 76,26 |
}; |
|
|
static void output(const char *s) { |
_asm { |
/* set cx to strlen(s) */ |
push ds |
pop es |
mov di, s |
xor al, al |
cld |
mov cx, 0xff |
repne scasb /* compare ES:DI with AL, inc DI until match */ |
mov cx, di |
sub cx, s |
dec cx |
/* output via DOS */ |
mov ah, 0x40 /* write to handle */ |
mov bx, 1 /* 1=stdout */ |
mov dx, s |
int 0x21 |
} |
static void nls_puts(enum NLS_STRINGS id) { |
puts(svarlang_strid(id)); |
} |
|
|
static void crlf(void) { |
output("\r\n"); |
} |
|
|
static void outputnl(const char *s) { |
output(s); |
crlf(); |
} |
|
|
static void nls_put(enum NLS_STRINGS id) { |
output(svarlang_strid(id)); |
printf("%s", svarlang_strid(id)); |
} |
|
|
static void nls_puts(enum NLS_STRINGS id) { |
nls_put(id); |
crlf(); |
static void crlf(void) { |
puts(""); |
} |
|
|
static void about(void) { |
output("localcfg "); |
printf("localcfg "); |
nls_put(NLS_HLP_VER); |
outputnl(" " PVER ", (C) " PDATE " Mateusz Viste"); |
puts(" " PVER ", (C) " PDATE " Mateusz Viste"); |
crlf(); |
nls_puts(NLS_HLP_DESC); |
crlf(); |
nls_puts(NLS_HLP_USAGE); |
387,8 → 359,7 |
struct country cntdata; |
int changedflag; |
int x; |
char fname[130]; |
char buff[128]; |
static char fname[130]; |
|
svarlang_autoload("localcfg"); |
|
432,34 → 403,26 |
} |
|
nls_put(NLS_INFO_COUNTRY); |
sprintf(buff, " %03d", cntdata.CTYINFO.id); |
outputnl(buff); |
printf(" %03d\r\n", cntdata.CTYINFO.id); |
nls_put(NLS_INFO_CODEPAGE); |
sprintf(buff, " %d", cntdata.CTYINFO.codepage); |
outputnl(buff); |
printf(" %d\r\n", cntdata.CTYINFO.codepage); |
nls_put(NLS_INFO_DECSEP); |
sprintf(buff, " %c", cntdata.CTYINFO.decimal[0]); |
outputnl(buff); |
printf(" %c\r\n", cntdata.CTYINFO.decimal[0]); |
nls_put(NLS_INFO_THOUSEP); |
sprintf(buff, " %c", cntdata.CTYINFO.thousands[0]); |
outputnl(buff); |
printf(" %c\r\n", cntdata.CTYINFO.thousands[0]); |
nls_put(NLS_INFO_DATEFMT); |
sprintf(buff, " %s", datestring(&cntdata)); |
outputnl(buff); |
printf(" %s\r\n", datestring(&cntdata)); |
nls_put(NLS_INFO_TIMEFMT); |
sprintf(buff, " %s", timestring(&cntdata)); |
outputnl(buff); |
printf(" %s\r\n", timestring(&cntdata)); |
nls_put(NLS_INFO_YESNO); |
sprintf(buff, " %c/%c", cntdata.YESNO.yes[0], cntdata.YESNO.no[0]); |
outputnl(buff); |
printf(" %c/%c\r\n", cntdata.YESNO.yes[0], cntdata.YESNO.no[0]); |
nls_put(NLS_INFO_CURREXAMPLE); |
sprintf(" %s", currencystring(&cntdata)); |
outputnl(buff); |
printf(" %s\r\n", currencystring(&cntdata)); |
|
crlf(); |
nls_puts(NLS_MAKESURE); |
sprintf(buff, "COUNTRY=%03d,%03d,%s", cntdata.CTYINFO.id, cntdata.CTYINFO.codepage, fname); |
outputnl(buff); |
printf("COUNTRY=%03d,%03d,%s", cntdata.CTYINFO.id, cntdata.CTYINFO.codepage, fname); |
crlf(); |
|
/* if anything changed, write the new file */ |
if (changedflag != 0) country_write(fname, &cntdata); |