ICU-84 S/390 DLL code update.
X-SVN-Rev: 937
This commit is contained in:
parent
fdf872dd09
commit
a24534df38
@ -1002,10 +1002,6 @@ u_getDataDirectory(void) {
|
||||
/* puts(__environ[i]); */
|
||||
/* } */
|
||||
# endif
|
||||
#ifdef OS390BATCH
|
||||
path = "DD:ICUDATA";
|
||||
#endif
|
||||
|
||||
# ifdef WIN32
|
||||
/* next, try to read the path from the registry */
|
||||
if(path==NULL || *path==0) {
|
||||
@ -1365,7 +1361,7 @@ const char* uprv_getDefaultCodepage()
|
||||
#if defined(OS400)
|
||||
return "ibm-37";
|
||||
#elif defined(OS390)
|
||||
return "ibm-1047";
|
||||
return "ibm-37-s390";
|
||||
#elif defined(XP_MAC)
|
||||
/* TBD */
|
||||
#elif defined(WIN32)
|
||||
|
@ -34,6 +34,11 @@
|
||||
#define COMMON_DATA_NAME_LENGTH 7
|
||||
#define DATA_TYPE "dat"
|
||||
|
||||
#ifdef OS390BATCH
|
||||
/* prefixed with "//" to search MVS first regardless of the POSIX setting */
|
||||
#define MVS_COMMON_DATA_NAME "//icudata"
|
||||
#endif
|
||||
|
||||
static UDataMemory *
|
||||
doOpenChoice(const char *path, const char *type, const char *name,
|
||||
UDataMemoryIsAcceptable *isAcceptable, void *context,
|
||||
@ -223,7 +228,7 @@ udata_close(UDataMemory *pData) {
|
||||
|
||||
/* POSIX implementations ---------------------------------------------------- */
|
||||
|
||||
#elif defined (LINUX)||defined(POSIX)||defined(SOLARIS)||defined(AIX)||defined(HPUX)
|
||||
#elif defined (LINUX)||defined(POSIX)||defined(SOLARIS)||defined(AIX)||defined(HPUX)||defined(OS390)
|
||||
|
||||
/* If you are excruciatingly bored turn this on .. */
|
||||
/* #define UDATA_DEBUG 1 */
|
||||
@ -257,7 +262,7 @@ struct UDataMemory {
|
||||
|
||||
#if defined(ICU_USE_SHL_LOAD)
|
||||
|
||||
|
||||
#if !defined(OS390)
|
||||
# include <dl.h>
|
||||
/* HPUX compatibility stubs: shl_load, etc.. */
|
||||
#define RTLD_LAZY 0
|
||||
@ -311,13 +316,60 @@ int dlclose (void *handle)
|
||||
return shl_unload((shl_t)handle);
|
||||
}
|
||||
|
||||
#elif defined(OS390) /* OS390 */
|
||||
|
||||
#include <dll.h>
|
||||
|
||||
#define RTLD_LAZY 0
|
||||
#define RTLD_GLOBAL 0
|
||||
|
||||
void *dlopen (const char *filename, int flag)
|
||||
{
|
||||
dllhandle *handle;
|
||||
|
||||
#ifdef UDATA_DEBUG
|
||||
fprintf(stderr, "dllload: %s ", filename);
|
||||
#endif
|
||||
|
||||
handle = dllload(filename);
|
||||
|
||||
#ifdef UDATA_DEBUG
|
||||
fprintf(stderr, " -> %08X\n", handle );
|
||||
#endif
|
||||
|
||||
return handle;
|
||||
}
|
||||
|
||||
void *dlsym(void *h, const char *symbol)
|
||||
{
|
||||
void *val = 0;
|
||||
|
||||
val = dllqueryvar((dllhandle*)h,symbol);
|
||||
|
||||
#ifdef UDATA_DEBUG
|
||||
fprintf(stderr, "dllqueryvar(%08X, %s) -> %08X\n", h,
|
||||
symbol, val);
|
||||
#endif
|
||||
|
||||
return val;
|
||||
|
||||
}
|
||||
|
||||
int dlclose (void *handle)
|
||||
{
|
||||
#ifdef UDATA_DEBUG
|
||||
fprintf(stderr, "dllfree: %08X\n", handle);
|
||||
#endif
|
||||
|
||||
return dllfree((dllhandle*)handle);
|
||||
}
|
||||
|
||||
|
||||
#else
|
||||
/* 'de facto standard' dlopen etc */
|
||||
# include <dlfcn.h>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
typedef void *Library;
|
||||
|
||||
@ -711,11 +763,6 @@ doOpenChoice(const char *path, const char *type, const char *name,
|
||||
MappedData *p;
|
||||
UErrorCode errorCode=U_ZERO_ERROR;
|
||||
|
||||
#ifdef OS390BATCH
|
||||
/* Try DD:ICUDATA first */
|
||||
char *c;
|
||||
char tmpPathName[23];
|
||||
#endif
|
||||
/* set up path and basename */
|
||||
if(path==NULL) {
|
||||
isICUData=TRUE;
|
||||
@ -838,43 +885,6 @@ doOpenChoice(const char *path, const char *type, const char *name,
|
||||
/* try the common data first */
|
||||
p=NULL;
|
||||
|
||||
#ifdef OS390BATCH
|
||||
/*
|
||||
Try DD:ICUDATA first.
|
||||
*/
|
||||
uprv_strcpy(tmpPathName, "//DD:ICUDATA(");
|
||||
/*
|
||||
Delete the '-' character from the file name. It is not a vaild
|
||||
charater for a MVS data set name.
|
||||
We could convert it to '@', but because icu supports 9 character
|
||||
converter file name(for example, ibm-12712.cnv), it's better to
|
||||
delete it(member name of a PDS must be <= 8 characters).
|
||||
*/
|
||||
c = uprv_strstr(name, "-");
|
||||
if (c != NULL) {
|
||||
uprv_strncat(tmpPathName, name, c-name);
|
||||
uprv_strcat(tmpPathName, c+1);
|
||||
}
|
||||
else
|
||||
uprv_strcat(tmpPathName, name);
|
||||
uprv_strcat(tmpPathName, ")");
|
||||
lib=LOAD_LIBRARY(tmpPathName, name, FALSE);
|
||||
|
||||
if(IS_LIBRARY(lib)) {
|
||||
/* look for the entry point */
|
||||
# ifdef UDATA_MAP
|
||||
/* entryName passed as NULL: prevent TOC lookup for single, mapped files */
|
||||
p=getChoice(lib, NULL, type, name, isAcceptable, context, &errorCode);
|
||||
# else
|
||||
p=getChoice(lib, entryName, type, name, isAcceptable, context, &errorCode);
|
||||
# endif
|
||||
if(p==NULL)
|
||||
UNLOAD_LIBRARY(lib);
|
||||
}
|
||||
|
||||
if(p==NULL) {
|
||||
|
||||
#endif
|
||||
# ifdef UDATA_INDIRECT
|
||||
if(hasBasename) {
|
||||
/* get the common data */
|
||||
@ -889,7 +899,11 @@ doOpenChoice(const char *path, const char *type, const char *name,
|
||||
if(!IS_LIBRARY(lib)) {
|
||||
/* try path/basename first */
|
||||
uprv_strcpy(suffix, LIB_SUFFIX);
|
||||
#ifdef OS390BATCH
|
||||
lib=LOAD_LIBRARY(MVS_COMMON_DATA_NAME, MVS_COMMON_DATA_NAME, TRUE);
|
||||
# else
|
||||
lib=LOAD_LIBRARY(path, basename, TRUE);
|
||||
#endif
|
||||
if(!IS_LIBRARY(lib)) {
|
||||
/* try basename only next */
|
||||
lib=LOAD_LIBRARY(basename, basename, TRUE);
|
||||
@ -931,9 +945,6 @@ doOpenChoice(const char *path, const char *type, const char *name,
|
||||
}
|
||||
# endif
|
||||
|
||||
#ifdef OS390BATCH
|
||||
}
|
||||
#endif
|
||||
/* if the data is not found in the common data, then look for a separate library */
|
||||
|
||||
/* try basename+"_"+entryName[+LIB_SUFFIX] first */
|
||||
|
@ -26,12 +26,12 @@ else
|
||||
ICU_IEEE =
|
||||
endif
|
||||
|
||||
CFLAGS390= -Wc,"langlvl(extended),spill(2000)" $(ICU_IEEE) -Wc,dll,expo
|
||||
CFLAGS390= -Wc,"langlvl(extended),spill(2000)" $(ICU_BUILD_OPTIONS) $(ICU_IEEE) -Wc,dll,expo
|
||||
## OS390BATCH
|
||||
ifeq (${OS390BATCH},1)
|
||||
DEFS390= -D_OPEN_THREADS -D_XOPEN_SOURCE_EXTENDED -DOS390BATCH -D_SHARE_EXT_VARS
|
||||
DEFS390= -D_OPEN_THREADS -D_XOPEN_SOURCE_EXTENDED -DOS390BATCH -D_SHR_TZNAME -D_SHR_TIMEZONE
|
||||
else
|
||||
DEFS390= -D_OPEN_THREADS -D_XOPEN_SOURCE_EXTENDED -D_SHARE_EXT_VARS
|
||||
DEFS390= -D_OPEN_THREADS -D_XOPEN_SOURCE_EXTENDED -D_SHR_TZNAME -D_SHR_TIMEZONE
|
||||
endif
|
||||
ARFLAGS= -cr
|
||||
|
||||
@ -77,9 +77,6 @@ LIBICU-TOOLUTIL=$(top_builddir)/tools/toolutil/libicu-toolutil.x
|
||||
%.o :$(srcdir)/%.cpp
|
||||
$(COMPILE.cc) -o $@ $<
|
||||
|
||||
../data/%.o : ../data/%.c
|
||||
$(COMPILE.c) -o $@ $<
|
||||
|
||||
## Dependency rules
|
||||
%.d : %.u
|
||||
@$(SHELL) -ec 'cat $< \
|
||||
|
@ -141,7 +141,12 @@ int main(int argc, char *argv[]) {
|
||||
const int32_t gentz::MAX_GMT_OFFSET = (int32_t)24*60*60; // seconds
|
||||
const char gentz::COMMENT = '#';
|
||||
const char gentz::CR = ((char)13);
|
||||
// OS390 uses x'15' NL new line for LF
|
||||
#ifdef OS390
|
||||
const char gentz::LF = ((char)21);
|
||||
#else
|
||||
const char gentz::LF = ((char)10);
|
||||
#endif
|
||||
const char gentz::MINUS = '-';
|
||||
const char gentz::SPACE = ' ';
|
||||
const char gentz::TAB = ((char)9);
|
||||
@ -482,7 +487,7 @@ void gentz::parseDSTRule(char*& p, TZRule& rule) {
|
||||
if (*p++ != SEP) {
|
||||
die("Separator missing");
|
||||
}
|
||||
switch (rule.mode) {
|
||||
switch ((char)rule.mode) {
|
||||
case 'w':
|
||||
rule.mode = WALL_TIME;
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user