Author: rmeggins
Update of /cvs/dirsec/adminserver/lib/libsi18n
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv6632/adminserver/lib/libsi18n
Modified Files:
getstrprop.c gsadmserv.h
Removed Files:
coreres.c coreres.h getlang.c lock.h makstrdb.c propset.c
propset.h reshash.c reshash.h txtfile.c txtfile.h
Log Message:
removing dead code
Index: getstrprop.c
===================================================================
RCS file: /cvs/dirsec/adminserver/lib/libsi18n/getstrprop.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- getstrprop.c 31 Mar 2006 22:58:34 -0000 1.4
+++ getstrprop.c 14 Jul 2008 20:34:43 -0000 1.5
@@ -27,71 +27,20 @@
#include "getstrmem.h"
-#include "libadminutil/resource.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. */
+ /* we should eventually port this to use proper adminutil
+ resources, but for now, only the in-memory resource
+ model is supported */
if (result == NULL)
result = XP_GetStringFromMemory(strLibraryName,key);
return result;
@@ -150,115 +99,3 @@
}
}
-
-#if 0
-#include "base/crit.h"
-#include "base/systhr.h"
-static int Initialized = 0;
-
-#ifdef XP_UNIX
-
-#include <sys/types.h>
-#include <sys/ipc.h>
-#include <sys/sem.h>
-#include <unistd.h>
-
-union _semarg
-{
- int val;
- struct semid_ds *buf;
- ushort *array;
-};
-
-int _si18n_semMutex;
-pid_t _lockOwner = 0;
-int _si18n_waitQueue;
-struct sembuf _semop_p[1] = {0,-1,0};
-struct sembuf _semop_v[1] = {0,1,0};
-
-
-void _si18n_lock(MutexPointer p)
-{
- pid_t current_pid = getpid();
-
- semop(*((int*)p),_semop_p,1);
- if (current_pid != _lockOwner)
- {
- semop(*((int*)p),_semop_v,1);
- semop(_si18n_waitQueue,_semop_p,1); /* wait for access */
- semop(*((int*)p),_semop_p,1);
- _lockOwner = current_pid;
- }
-
- semop(*((int*)p),_semop_v,1);
-
-}
-
-void _si18n_unlock(MutexPointer p)
-{
- semop(*((int*)p),_semop_p,1);
-
- _lockOwner = 0;
- semop(_si18n_waitQueue,_semop_v,1); /* signal one waiter */
-
- semop(*((int*)p),_semop_v,1);
-
-}
-
-MutexImplementation _nlsMutexImplementation =
-{
- &_si18n_semMutex,
- _si18n_lock,
- _si18n_unlock
-};
-
-MutexImplementation* _pMutexImplementation = &_nlsMutexImplementation;
-
-
-void InitSynchronization(void)
-{
- union _semarg val;
-
- val.val = 1; /* to avoid an aligment fault on certain platforms */
-
- _si18n_semMutex = semget(IPC_PRIVATE,1,IPC_CREAT | 0600);
- _si18n_waitQueue = semget(IPC_PRIVATE,1,IPC_CREAT | 0600);
-
- semctl(_si18n_semMutex,0,SETVAL,val);
- semctl(_si18n_waitQueue,0,SETVAL,val);
-}
-
-#else
-#include "lock.h"
-#include <windows.h>
-
-static CRITICAL_SECTION _csMutex;
-
-void _lock(MutexPointer p)
-{
- EnterCriticalSection((CRITICAL_SECTION*)p);
-}
-
-void _unlock(MutexPointer p)
-{
- LeaveCriticalSection((CRITICAL_SECTION*)p);
-}
-
-MutexImplementation _nlsMutexImplementation =
-{
- &_csMutex,
- _lock,
- _unlock
-};
-
-MutexImplementation* _pMutexImplementation = &_nlsMutexImplementation;
-
-void InitSynchronization(void)
-{
- InitializeCriticalSection(&_csMutex);
-}
-
-#endif
-
-#endif
-
Index: gsadmserv.h
===================================================================
RCS file: /cvs/dirsec/adminserver/lib/libsi18n/gsadmserv.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- gsadmserv.h 18 Jul 2007 22:10:31 -0000 1.6
+++ gsadmserv.h 14 Jul 2008 20:34:43 -0000 1.7
@@ -26,13 +26,10 @@
#undef LIBRARY_NAME
#include "../admserv/cgi-src40/dbtcgiadmin.h"
#undef LIBRARY_NAME
-#include "base/dbtbase.h"
-#undef LIBRARY_NAME
#include "libadmin/dbtlibadmin.h"
-static RESOURCE_GLOBAL allxpstr[] = {
+static res_RESOURCE_GLOBAL allxpstr[] = {
admserv,
- base,
0
};
--- coreres.c DELETED ---
--- coreres.h DELETED ---
--- getlang.c DELETED ---
--- lock.h DELETED ---
--- makstrdb.c DELETED ---
--- propset.c DELETED ---
--- propset.h DELETED ---
--- reshash.c DELETED ---
--- reshash.h DELETED ---
--- txtfile.c DELETED ---
--- txtfile.h DELETED ---