Initial import of the CDE 2.1.30 sources from the Open Group.

This commit is contained in:
Peter Howkins
2012-03-10 18:21:40 +00:00
commit 83b6996daa
18978 changed files with 3945623 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
#include <stdlib.h>
#include <stdio.h>
#include "LocaleXlate.h"
#include "XlationSvc.h"
int
main()
{
_DtXlateDb myDb = NULL;
char myPlatform[_DtPLATFORM_MAX_LEN+1];
char *locale;
char *newLocale;
int execVer;
int compVer;
locale = getenv("LANG");
if (!locale || (strcmp(locale, "C") == 0) || (strcmp(locale, "POSIX") == 0)) {
puts("C.ISO-8859-1");
exit(0);
}
if ((_DtLcxOpenAllDbs(&myDb) != 0) ||
(_DtXlateGetXlateEnv(myDb,myPlatform,&execVer,&compVer) != 0)) {
fprintf(stderr,
"Warning: could not open locale translation database.\n");
exit(1);
}
if (_DtLcxXlateOpToStd(myDb,
myPlatform,
execVer,
DtLCX_OPER_SETLOCALE,
locale,
&newLocale,
NULL,
NULL,
NULL)) {
fprintf(stderr,
"Warning: could not translate local to CDE locale\n");
}
puts(newLocale);
_DtLcxCloseDb(&myDb);
}