Subversion Repositories SvarDOS

Rev

Rev 606 | Rev 611 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 606 Rev 610
Line 149... Line 149...
149
  nls_puts(NLS_HLP_INFOLOC1);
149
  nls_puts(NLS_HLP_INFOLOC1);
150
  nls_puts(NLS_HLP_INFOLOC2);
150
  nls_puts(NLS_HLP_INFOLOC2);
151
}
151
}
152
 
152
 
153
 
153
 
154
static char *datestring(struct country *c) {
154
static char *datestring(char *result, struct country *c) {
155
  static char result[16];
-
 
156
  switch (c->CTYINFO.datefmt) {
155
  switch (c->CTYINFO.datefmt) {
157
    case COUNTRY_DATE_MDY:
156
    case COUNTRY_DATE_MDY:
158
      sprintf(result, "12%c31%c1990", c->CTYINFO.datesep[0], c->CTYINFO.datesep[0]);
157
      sprintf(result, "12%c31%c1990", c->CTYINFO.datesep[0], c->CTYINFO.datesep[0]);
159
      break;
158
      break;
160
    case COUNTRY_DATE_DMY:
159
    case COUNTRY_DATE_DMY:
Line 167... Line 166...
167
  }
166
  }
168
  return(result);
167
  return(result);
169
}
168
}
170
 
169
 
171
 
170
 
172
static char *timestring(struct country *c) {
171
static char *timestring(char *result, struct country *c) {
173
  static char result[16];
-
 
174
  if (c->CTYINFO.timefmt == COUNTRY_TIME12) {
172
  if (c->CTYINFO.timefmt == COUNTRY_TIME12) {
175
    sprintf(result, "11%c59%c59 PM", c->CTYINFO.timesep[0], c->CTYINFO.timesep[0]);
173
    sprintf(result, "11%c59%c59 PM", c->CTYINFO.timesep[0], c->CTYINFO.timesep[0]);
176
  } else {
174
  } else {
177
    sprintf(result, "23%c59%c59", c->CTYINFO.timesep[0], c->CTYINFO.timesep[0]);
175
    sprintf(result, "23%c59%c59", c->CTYINFO.timesep[0], c->CTYINFO.timesep[0]);
178
  }
176
  }
179
  return(result);
177
  return(result);
180
}
178
}
181
 
179
 
182
 
180
 
183
static char *currencystring(struct country *c) {
181
static char *currencystring(char *result, struct country *c) {
184
  static char result[16];
-
 
185
  char decimalpart[16];
182
  char decimalpart[16];
186
  char space[2] = {0, 0};
183
  char space[2] = {0, 0};
187
  char decsym[8];
184
  char decsym[8];
188
  char cursym[8];
185
  char cursym[8];
189
  decimalpart[0] = '1';
186
  decimalpart[0] = '1';
Line 385... Line 382...
385
 
382
 
386
int main(int argc, char **argv) {
383
int main(int argc, char **argv) {
387
  struct country cntdata;
384
  struct country cntdata;
388
  int changedflag;
385
  int changedflag;
389
  int x;
386
  int x;
390
  char fname[130];
387
  static char fname[130];
391
  char buff[128];
388
  static char buff[64];
392
 
389
 
393
  svarlang_autoload("localcfg");
390
  svarlang_autoload("localcfg");
394
 
391
 
395
  /* scan argv looking for the path to country.sys */
392
  /* scan argv looking for the path to country.sys */
396
  for (x = 1; x < argc; x++) {
393
  for (x = 1; x < argc; x++) {
Line 442... Line 439...
442
  outputnl(buff);
439
  outputnl(buff);
443
  nls_put(NLS_INFO_THOUSEP);
440
  nls_put(NLS_INFO_THOUSEP);
444
  sprintf(buff, " %c", cntdata.CTYINFO.thousands[0]);
441
  sprintf(buff, " %c", cntdata.CTYINFO.thousands[0]);
445
  outputnl(buff);
442
  outputnl(buff);
446
  nls_put(NLS_INFO_DATEFMT);
443
  nls_put(NLS_INFO_DATEFMT);
447
  sprintf(buff, " %s", datestring(&cntdata));
444
  output(" ");
448
  outputnl(buff);
445
  outputnl(datestring(buff, &cntdata));
449
  nls_put(NLS_INFO_TIMEFMT);
446
  nls_put(NLS_INFO_TIMEFMT);
450
  sprintf(buff, " %s", timestring(&cntdata));
447
  output(" ");
451
  outputnl(buff);
448
  outputnl(timestring(buff, &cntdata));
452
  nls_put(NLS_INFO_YESNO);
449
  nls_put(NLS_INFO_YESNO);
453
  sprintf(buff, " %c/%c", cntdata.YESNO.yes[0], cntdata.YESNO.no[0]);
450
  sprintf(buff, " %c/%c", cntdata.YESNO.yes[0], cntdata.YESNO.no[0]);
454
  outputnl(buff);
451
  outputnl(buff);
455
  nls_put(NLS_INFO_CURREXAMPLE);
452
  nls_put(NLS_INFO_CURREXAMPLE);
456
  sprintf(" %s", currencystring(&cntdata));
453
  output(" ");
457
  outputnl(buff);
454
  outputnl(currencystring(buff, &cntdata));
458
 
455
 
459
  crlf();
456
  crlf();
460
  nls_puts(NLS_MAKESURE);
457
  nls_puts(NLS_MAKESURE);
461
  sprintf(buff, "COUNTRY=%03d,%03d,%s", cntdata.CTYINFO.id, cntdata.CTYINFO.codepage, fname);
458
  sprintf(buff, "COUNTRY=%03d,%03d,", cntdata.CTYINFO.id, cntdata.CTYINFO.codepage);
462
  outputnl(buff);
459
  output(buff);
-
 
460
  outputnl(fname);
463
 
461
 
464
  /* if anything changed, write the new file */
462
  /* if anything changed, write the new file */
465
  if (changedflag != 0) country_write(fname, &cntdata);
463
  if (changedflag != 0) country_write(fname, &cntdata);
466
 
464
 
467
  return(0);
465
  return(0);