diff options
author | Rich Megginson <rmeggins@redhat.com> | 2010-02-25 08:46:32 -0700 |
---|---|---|
committer | Rich Megginson <rmeggins@redhat.com> | 2010-02-25 10:14:48 -0700 |
commit | 2cc5ac4e6de01c75d3b974146fde7f41a77b0268 (patch) | |
tree | 5fdc15421e9014bf845ca85cad20efd77080fd58 /lib/libsi18n/getstrprop.c | |
parent | 1ce1a045b77d2726ab1cb52a3e5ad943976d0fa8 (diff) | |
download | ds-2cc5ac4e6de01c75d3b974146fde7f41a77b0268.tar.gz ds-2cc5ac4e6de01c75d3b974146fde7f41a77b0268.tar.xz ds-2cc5ac4e6de01c75d3b974146fde7f41a77b0268.zip |
problems linking with -z defs
https://bugzilla.redhat.com/show_bug.cgi?id=506206
Resolves: bug 506206
Bug Description: problems linking with -z defs
Reviewed by: nhosoi (Thanks!)
Branch: HEAD
Fix Description: Some platforms (debian) and some build checking tools
(rpmlint, others) link with -z defs to look for any undefined references at
link time. We had several of these in various directory server objects.
1) all of the plugins need to link against libslapd.la
2) most of the plugins need to link against ldapcsdk and nspr
3) the pwdstorage plugin needs to link against LIBCRYPT, which is platform
dependent
4) various other link fixes
Platforms tested: RHEL5 x86_64
Flag Day: yes - autotool file changes
Doc impact: no
Diffstat (limited to 'lib/libsi18n/getstrprop.c')
-rw-r--r-- | lib/libsi18n/getstrprop.c | 85 |
1 files changed, 14 insertions, 71 deletions
diff --git a/lib/libsi18n/getstrprop.c b/lib/libsi18n/getstrprop.c index 4a5ab04b..c63d6ba1 100644 --- a/lib/libsi18n/getstrprop.c +++ b/lib/libsi18n/getstrprop.c @@ -49,77 +49,7 @@ #include "getstrmem.h" -#include "coreres.h" - -Resource *hResource = NULL; -char empty_string[] = ""; - -char* -XP_GetStringFromMemory(char* strLibraryName,int iToken); - - - -void -XP_InitStringDatabase(char* pathCWD, char* databaseName) -{ - hResource = core_res_init_resource (pathCWD, databaseName); -} - -char *XP_GetPropertyString(char* strLibraryName,int iToken, ACCEPT_LANGUAGE_LIST lang) -{ - char *key_name; - char *result = NULL; - - if (hResource == NULL) - return NULL; - - /*creating the key*/ - key_name=(char*)malloc(strlen(strLibraryName) + 10); - sprintf(key_name, "%s-%d", strLibraryName, iToken); - if(key_name == NULL) - return NULL; - - result = (char *) core_res_getstring(hResource, key_name, lang) ; - - if (key_name) - free (key_name); - - if (result == NULL) - return empty_string; - else - return result ; -} - -char* -XP_GetStringFromDatabase(char* strLibraryName, - char* strLanguage, - int key) -{ - char *result = NULL; - ACCEPT_LANGUAGE_LIST alanglist; - int n; - - /* - * display first choice language if available, otherwise - * use default which is english in most case - */ - if (hResource) { - n = XP_AccLangList (strLanguage, alanglist); - if (n >= MAX_ACCEPT_LANGUAGE) - alanglist[MAX_ACCEPT_LANGUAGE-1][0] = '\0'; - else - alanglist[n][0] = '\0'; - result = XP_GetPropertyString(strLibraryName, key, alanglist); - } - - /* we should never come here. */ - if (result == NULL) - result = XP_GetStringFromMemory(strLibraryName,key); - return result; -} - - -char* +static char* XP_GetStringFromMemory(char* strLibraryName,int iToken) { /* @@ -171,3 +101,16 @@ XP_GetStringFromMemory(char* strLibraryName,int iToken) } } + +char* +XP_GetStringFromDatabase(char* strLibraryName, + char* strLanguage, + int key) +{ + char *result = NULL; + + /* we use memory strings only in ds. */ + if (result == NULL) + result = XP_GetStringFromMemory(strLibraryName,key); + return result; +} |