mirror of
https://github.com/adtools/clib2.git
synced 2025-12-08 14:59:05 +00:00
- Added the "setlocale.c" test program.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15089 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
29
test_programs/setlocale.c
Executable file
29
test_programs/setlocale.c
Executable file
@ -0,0 +1,29 @@
|
||||
#include <stdio.h>
|
||||
#include <locale.h>
|
||||
|
||||
/* uncomment to fix corruption
|
||||
#include <dos.h>
|
||||
BOOL __open_locale = FALSE;
|
||||
*/
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
char *loc;
|
||||
time_t t;
|
||||
struct tm *m;
|
||||
char buf[200];
|
||||
int len;
|
||||
|
||||
loc = setlocale(LC_ALL, "");
|
||||
printf("loc=%p (%s)\n", loc, loc);
|
||||
|
||||
time(&t);
|
||||
m = gmtime(&t);
|
||||
|
||||
len = strftime(buf, sizeof(buf), "%a %b", m);
|
||||
|
||||
printf("len=%d buf=%s\n", len, buf);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user