[Fedora-directory-commits] adminserver/lib/libsi18n getstrprop.c, 1.4, 1.4.2.1 gsadmserv.h, 1.6, 1.6.2.1 coreres.c, 1.3, NONE coreres.h, 1.3, NONE getlang.c, 1.5, NONE lock.h, 1.3, NONE makstrdb.c, 1.4, NONE propset.c, 1.4, NONE propset.h, 1.3, NONE reshash.c, 1.3, NONE reshash.h, 1.3, NONE txtfile.c, 1.4, NONE txtfile.h, 1.3, NONE
Richard Allen Megginson (rmeggins)
fedora-directory-commits at redhat.com
Mon Jul 14 20:58:50 UTC 2008
Author: rmeggins
Update of /cvs/dirsec/adminserver/lib/libsi18n
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv9594/adminserver/lib/libsi18n
Modified Files:
Tag: Directory_Server_8_0_Branch
getstrprop.c gsadmserv.h
Removed Files:
Tag: Directory_Server_8_0_Branch
coreres.c coreres.h getlang.c lock.h makstrdb.c propset.c
propset.h reshash.c reshash.h txtfile.c txtfile.h
Log Message:
remove obsolete code from 8.0 branch
Index: getstrprop.c
===================================================================
RCS file: /cvs/dirsec/adminserver/lib/libsi18n/getstrprop.c,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -u -r1.4 -r1.4.2.1
--- getstrprop.c 31 Mar 2006 22:58:34 -0000 1.4
+++ getstrprop.c 14 Jul 2008 20:58:47 -0000 1.4.2.1
@@ -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.6.2.1
diff -u -r1.6 -r1.6.2.1
--- gsadmserv.h 18 Jul 2007 22:10:31 -0000 1.6
+++ gsadmserv.h 14 Jul 2008 20:58:47 -0000 1.6.2.1
@@ -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 ---
More information about the Fedora-directory-commits
mailing list