mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-24 13:33:01 +03:00
Remove BeOS support
Haiku shouldn't be affected.
This commit is contained in:
@@ -921,10 +921,6 @@ else
|
|||||||
WITH_THREADS="1"
|
WITH_THREADS="1"
|
||||||
THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_WIN32_THREADS"
|
THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_WIN32_THREADS"
|
||||||
;;
|
;;
|
||||||
*beos*)
|
|
||||||
WITH_THREADS="1"
|
|
||||||
THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_BEOS_THREADS"
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
dnl Use pthread by default in other cases
|
dnl Use pthread by default in other cases
|
||||||
_libs=$LIBS
|
_libs=$LIBS
|
||||||
|
|||||||
@@ -75,16 +75,8 @@
|
|||||||
* A couple portability macros
|
* A couple portability macros
|
||||||
*/
|
*/
|
||||||
#ifndef _WINSOCKAPI_
|
#ifndef _WINSOCKAPI_
|
||||||
#if !defined(__BEOS__) || defined(__HAIKU__)
|
|
||||||
#define closesocket(s) close(s)
|
#define closesocket(s) close(s)
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __BEOS__
|
|
||||||
#ifndef PF_INET
|
|
||||||
#define PF_INET AF_INET
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef _AIX
|
#ifdef _AIX
|
||||||
#ifdef HAVE_BROKEN_SS_FAMILY
|
#ifdef HAVE_BROKEN_SS_FAMILY
|
||||||
|
|||||||
18
nanohttp.c
18
nanohttp.c
@@ -76,19 +76,11 @@
|
|||||||
* A couple portability macros
|
* A couple portability macros
|
||||||
*/
|
*/
|
||||||
#ifndef _WINSOCKAPI_
|
#ifndef _WINSOCKAPI_
|
||||||
#if !defined(__BEOS__) || defined(__HAIKU__)
|
|
||||||
#define closesocket(s) close(s)
|
#define closesocket(s) close(s)
|
||||||
#endif
|
|
||||||
#define SOCKET int
|
#define SOCKET int
|
||||||
#define INVALID_SOCKET (-1)
|
#define INVALID_SOCKET (-1)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __BEOS__
|
|
||||||
#ifndef PF_INET
|
|
||||||
#define PF_INET AF_INET
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef XML_SOCKLEN_T
|
#ifndef XML_SOCKLEN_T
|
||||||
#define XML_SOCKLEN_T unsigned int
|
#define XML_SOCKLEN_T unsigned int
|
||||||
#endif
|
#endif
|
||||||
@@ -890,15 +882,6 @@ xmlNanoHTTPConnectAttempt(struct sockaddr *addr)
|
|||||||
status = ioctl(s, FIONBIO, &enable);
|
status = ioctl(s, FIONBIO, &enable);
|
||||||
}
|
}
|
||||||
#else /* VMS */
|
#else /* VMS */
|
||||||
#if defined(__BEOS__) && !defined(__HAIKU__)
|
|
||||||
{
|
|
||||||
bool noblock = true;
|
|
||||||
|
|
||||||
status =
|
|
||||||
setsockopt(s, SOL_SOCKET, SO_NONBLOCK, &noblock,
|
|
||||||
sizeof(noblock));
|
|
||||||
}
|
|
||||||
#else /* __BEOS__ */
|
|
||||||
if ((status = fcntl(s, F_GETFL, 0)) != -1) {
|
if ((status = fcntl(s, F_GETFL, 0)) != -1) {
|
||||||
#ifdef O_NONBLOCK
|
#ifdef O_NONBLOCK
|
||||||
status |= O_NONBLOCK;
|
status |= O_NONBLOCK;
|
||||||
@@ -917,7 +900,6 @@ xmlNanoHTTPConnectAttempt(struct sockaddr *addr)
|
|||||||
closesocket(s);
|
closesocket(s);
|
||||||
return INVALID_SOCKET;
|
return INVALID_SOCKET;
|
||||||
}
|
}
|
||||||
#endif /* !__BEOS__ */
|
|
||||||
#endif /* !VMS */
|
#endif /* !VMS */
|
||||||
#endif /* !_WINSOCKAPI_ */
|
#endif /* !_WINSOCKAPI_ */
|
||||||
|
|
||||||
|
|||||||
52
runtest.c
52
runtest.c
@@ -4175,58 +4175,6 @@ testThread(void)
|
|||||||
return (res);
|
return (res);
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif defined __BEOS__
|
|
||||||
#include <OS.h>
|
|
||||||
|
|
||||||
static thread_id tid[MAX_ARGC];
|
|
||||||
|
|
||||||
static int
|
|
||||||
testThread(void)
|
|
||||||
{
|
|
||||||
unsigned int i, repeat;
|
|
||||||
status_t ret;
|
|
||||||
int res = 0;
|
|
||||||
|
|
||||||
xmlInitParser();
|
|
||||||
for (repeat = 0; repeat < 500; repeat++) {
|
|
||||||
xmlLoadCatalog(catalog);
|
|
||||||
for (i = 0; i < num_threads; i++) {
|
|
||||||
tid[i] = (thread_id) - 1;
|
|
||||||
}
|
|
||||||
for (i = 0; i < num_threads; i++) {
|
|
||||||
tid[i] =
|
|
||||||
spawn_thread(thread_specific_data, "xmlTestThread",
|
|
||||||
B_NORMAL_PRIORITY, (void *) &threadParams[i]);
|
|
||||||
if (tid[i] < B_OK) {
|
|
||||||
fprintf(stderr, "beos_thread_create failed\n");
|
|
||||||
return (1);
|
|
||||||
}
|
|
||||||
printf("beos_thread_create %d -> %d\n", i, tid[i]);
|
|
||||||
}
|
|
||||||
for (i = 0; i < num_threads; i++) {
|
|
||||||
void *result;
|
|
||||||
ret = wait_for_thread(tid[i], &result);
|
|
||||||
printf("beos_thread_wait %d -> %d\n", i, ret);
|
|
||||||
if (ret != B_OK) {
|
|
||||||
fprintf(stderr, "beos_thread_wait failed\n");
|
|
||||||
return (1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
xmlCatalogCleanup();
|
|
||||||
ret = B_OK;
|
|
||||||
for (i = 0; i < num_threads; i++)
|
|
||||||
if (threadParams[i].okay == 0) {
|
|
||||||
printf("Thread %d handling %s failed\n", i,
|
|
||||||
threadParams[i].filename);
|
|
||||||
ret = B_ERROR;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (ret != B_OK)
|
|
||||||
return(1);
|
|
||||||
return (0);
|
|
||||||
}
|
|
||||||
|
|
||||||
#elif defined HAVE_PTHREAD_H
|
#elif defined HAVE_PTHREAD_H
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
|
||||||
|
|||||||
@@ -12,8 +12,6 @@
|
|||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#elif defined HAVE_WIN32_THREADS
|
#elif defined HAVE_WIN32_THREADS
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#elif defined HAVE_BEOS_THREADS
|
|
||||||
#include <OS.h>
|
|
||||||
#endif
|
#endif
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#if !defined(_MSC_VER)
|
#if !defined(_MSC_VER)
|
||||||
@@ -27,8 +25,6 @@
|
|||||||
static pthread_t tid[MAX_ARGC];
|
static pthread_t tid[MAX_ARGC];
|
||||||
#elif defined HAVE_WIN32_THREADS
|
#elif defined HAVE_WIN32_THREADS
|
||||||
static HANDLE tid[MAX_ARGC];
|
static HANDLE tid[MAX_ARGC];
|
||||||
#elif defined HAVE_BEOS_THREADS
|
|
||||||
static thread_id tid[MAX_ARGC];
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@@ -209,61 +205,7 @@ main(void)
|
|||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
#elif defined HAVE_BEOS_THREADS
|
#endif /* pthreads */
|
||||||
int
|
|
||||||
main(void)
|
|
||||||
{
|
|
||||||
unsigned int i, repeat;
|
|
||||||
status_t ret;
|
|
||||||
|
|
||||||
xmlInitParser();
|
|
||||||
printf("Parser initialized\n");
|
|
||||||
for (repeat = 0;repeat < TEST_REPEAT_COUNT;repeat++) {
|
|
||||||
printf("repeat: %d\n",repeat);
|
|
||||||
xmlLoadCatalog(catalog);
|
|
||||||
printf("loaded catalog: %s\n", catalog);
|
|
||||||
for (i = 0; i < num_threads; i++) {
|
|
||||||
tid[i] = (thread_id) -1;
|
|
||||||
}
|
|
||||||
printf("cleaned threads\n");
|
|
||||||
for (i = 0; i < num_threads; i++) {
|
|
||||||
tid[i] = spawn_thread(thread_specific_data, "xmlTestThread", B_NORMAL_PRIORITY, (void *) &threadParams[i]);
|
|
||||||
if (tid[i] < B_OK) {
|
|
||||||
perror("beos_thread_create");
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
printf("beos_thread_create %d -> %d\n", i, tid[i]);
|
|
||||||
}
|
|
||||||
for (i = 0; i < num_threads; i++) {
|
|
||||||
void *result;
|
|
||||||
ret = wait_for_thread(tid[i], &result);
|
|
||||||
printf("beos_thread_wait %d -> %d\n", i, ret);
|
|
||||||
if (ret != B_OK) {
|
|
||||||
perror("beos_thread_wait");
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
xmlCatalogCleanup();
|
|
||||||
ret = B_OK;
|
|
||||||
for (i = 0; i < num_threads; i++)
|
|
||||||
if (threadParams[i].okay == 0) {
|
|
||||||
printf("Thread %d handling %s failed\n", i,
|
|
||||||
threadParams[i].filename);
|
|
||||||
ret = B_ERROR;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
xmlCleanupParser();
|
|
||||||
xmlMemoryDump();
|
|
||||||
|
|
||||||
if (ret == B_OK)
|
|
||||||
printf("testThread : BeOS : SUCCESS!\n");
|
|
||||||
else
|
|
||||||
printf("testThread : BeOS : FAILED!\n");
|
|
||||||
|
|
||||||
return (0);
|
|
||||||
}
|
|
||||||
#endif /* pthreads or BeOS threads */
|
|
||||||
|
|
||||||
#else /* !LIBXML_THREADS_ENABLED */
|
#else /* !LIBXML_THREADS_ENABLED */
|
||||||
int
|
int
|
||||||
|
|||||||
142
threads.c
142
threads.c
@@ -26,11 +26,6 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_BEOS_THREADS
|
|
||||||
#include <OS.h>
|
|
||||||
#include <TLS.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(SOLARIS)
|
#if defined(SOLARIS)
|
||||||
#include <note.h>
|
#include <note.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -88,9 +83,6 @@ struct _xmlMutex {
|
|||||||
pthread_mutex_t lock;
|
pthread_mutex_t lock;
|
||||||
#elif defined HAVE_WIN32_THREADS
|
#elif defined HAVE_WIN32_THREADS
|
||||||
CRITICAL_SECTION cs;
|
CRITICAL_SECTION cs;
|
||||||
#elif defined HAVE_BEOS_THREADS
|
|
||||||
sem_id sem;
|
|
||||||
thread_id tid;
|
|
||||||
#else
|
#else
|
||||||
int empty;
|
int empty;
|
||||||
#endif
|
#endif
|
||||||
@@ -108,10 +100,6 @@ struct _xmlRMutex {
|
|||||||
pthread_cond_t cv;
|
pthread_cond_t cv;
|
||||||
#elif defined HAVE_WIN32_THREADS
|
#elif defined HAVE_WIN32_THREADS
|
||||||
CRITICAL_SECTION cs;
|
CRITICAL_SECTION cs;
|
||||||
#elif defined HAVE_BEOS_THREADS
|
|
||||||
xmlMutexPtr lock;
|
|
||||||
thread_id tid;
|
|
||||||
int32 count;
|
|
||||||
#else
|
#else
|
||||||
int empty;
|
int empty;
|
||||||
#endif
|
#endif
|
||||||
@@ -142,14 +130,6 @@ static struct {
|
|||||||
LONG control;
|
LONG control;
|
||||||
} run_once = { 0, 0};
|
} run_once = { 0, 0};
|
||||||
static volatile LPCRITICAL_SECTION global_init_lock = NULL;
|
static volatile LPCRITICAL_SECTION global_init_lock = NULL;
|
||||||
|
|
||||||
/* endif HAVE_WIN32_THREADS */
|
|
||||||
#elif defined HAVE_BEOS_THREADS
|
|
||||||
int32 globalkey = 0;
|
|
||||||
thread_id mainthread = 0;
|
|
||||||
int32 run_once_init = 0;
|
|
||||||
static int32 global_init_lock = -1;
|
|
||||||
static vint32 global_init_count = 0;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static xmlRMutexPtr xmlLibraryLock = NULL;
|
static xmlRMutexPtr xmlLibraryLock = NULL;
|
||||||
@@ -178,12 +158,6 @@ xmlNewMutex(void)
|
|||||||
pthread_mutex_init(&tok->lock, NULL);
|
pthread_mutex_init(&tok->lock, NULL);
|
||||||
#elif defined HAVE_WIN32_THREADS
|
#elif defined HAVE_WIN32_THREADS
|
||||||
InitializeCriticalSection(&tok->cs);
|
InitializeCriticalSection(&tok->cs);
|
||||||
#elif defined HAVE_BEOS_THREADS
|
|
||||||
if ((tok->sem = create_sem(1, "xmlMutex")) < B_OK) {
|
|
||||||
free(tok);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
tok->tid = -1;
|
|
||||||
#endif
|
#endif
|
||||||
return (tok);
|
return (tok);
|
||||||
}
|
}
|
||||||
@@ -206,8 +180,6 @@ xmlFreeMutex(xmlMutexPtr tok)
|
|||||||
pthread_mutex_destroy(&tok->lock);
|
pthread_mutex_destroy(&tok->lock);
|
||||||
#elif defined HAVE_WIN32_THREADS
|
#elif defined HAVE_WIN32_THREADS
|
||||||
DeleteCriticalSection(&tok->cs);
|
DeleteCriticalSection(&tok->cs);
|
||||||
#elif defined HAVE_BEOS_THREADS
|
|
||||||
delete_sem(tok->sem);
|
|
||||||
#endif
|
#endif
|
||||||
free(tok);
|
free(tok);
|
||||||
}
|
}
|
||||||
@@ -228,14 +200,6 @@ xmlMutexLock(xmlMutexPtr tok)
|
|||||||
pthread_mutex_lock(&tok->lock);
|
pthread_mutex_lock(&tok->lock);
|
||||||
#elif defined HAVE_WIN32_THREADS
|
#elif defined HAVE_WIN32_THREADS
|
||||||
EnterCriticalSection(&tok->cs);
|
EnterCriticalSection(&tok->cs);
|
||||||
#elif defined HAVE_BEOS_THREADS
|
|
||||||
if (acquire_sem(tok->sem) != B_NO_ERROR) {
|
|
||||||
#ifdef DEBUG_THREADS
|
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
|
||||||
"xmlMutexLock():BeOS:Couldn't acquire semaphore\n");
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
tok->tid = find_thread(NULL);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -256,11 +220,6 @@ xmlMutexUnlock(xmlMutexPtr tok)
|
|||||||
pthread_mutex_unlock(&tok->lock);
|
pthread_mutex_unlock(&tok->lock);
|
||||||
#elif defined HAVE_WIN32_THREADS
|
#elif defined HAVE_WIN32_THREADS
|
||||||
LeaveCriticalSection(&tok->cs);
|
LeaveCriticalSection(&tok->cs);
|
||||||
#elif defined HAVE_BEOS_THREADS
|
|
||||||
if (tok->tid == find_thread(NULL)) {
|
|
||||||
tok->tid = -1;
|
|
||||||
release_sem(tok->sem);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -290,12 +249,6 @@ xmlNewRMutex(void)
|
|||||||
}
|
}
|
||||||
#elif defined HAVE_WIN32_THREADS
|
#elif defined HAVE_WIN32_THREADS
|
||||||
InitializeCriticalSection(&tok->cs);
|
InitializeCriticalSection(&tok->cs);
|
||||||
#elif defined HAVE_BEOS_THREADS
|
|
||||||
if ((tok->lock = xmlNewMutex()) == NULL) {
|
|
||||||
free(tok);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
tok->count = 0;
|
|
||||||
#endif
|
#endif
|
||||||
return (tok);
|
return (tok);
|
||||||
}
|
}
|
||||||
@@ -319,8 +272,6 @@ xmlFreeRMutex(xmlRMutexPtr tok ATTRIBUTE_UNUSED)
|
|||||||
}
|
}
|
||||||
#elif defined HAVE_WIN32_THREADS
|
#elif defined HAVE_WIN32_THREADS
|
||||||
DeleteCriticalSection(&tok->cs);
|
DeleteCriticalSection(&tok->cs);
|
||||||
#elif defined HAVE_BEOS_THREADS
|
|
||||||
xmlFreeMutex(tok->lock);
|
|
||||||
#endif
|
#endif
|
||||||
free(tok);
|
free(tok);
|
||||||
}
|
}
|
||||||
@@ -358,14 +309,6 @@ xmlRMutexLock(xmlRMutexPtr tok)
|
|||||||
pthread_mutex_unlock(&tok->lock);
|
pthread_mutex_unlock(&tok->lock);
|
||||||
#elif defined HAVE_WIN32_THREADS
|
#elif defined HAVE_WIN32_THREADS
|
||||||
EnterCriticalSection(&tok->cs);
|
EnterCriticalSection(&tok->cs);
|
||||||
#elif defined HAVE_BEOS_THREADS
|
|
||||||
if (tok->lock->tid == find_thread(NULL)) {
|
|
||||||
tok->count++;
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
xmlMutexLock(tok->lock);
|
|
||||||
tok->count = 1;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -394,14 +337,6 @@ xmlRMutexUnlock(xmlRMutexPtr tok ATTRIBUTE_UNUSED)
|
|||||||
pthread_mutex_unlock(&tok->lock);
|
pthread_mutex_unlock(&tok->lock);
|
||||||
#elif defined HAVE_WIN32_THREADS
|
#elif defined HAVE_WIN32_THREADS
|
||||||
LeaveCriticalSection(&tok->cs);
|
LeaveCriticalSection(&tok->cs);
|
||||||
#elif defined HAVE_BEOS_THREADS
|
|
||||||
if (tok->lock->tid == find_thread(NULL)) {
|
|
||||||
tok->count--;
|
|
||||||
if (tok->count == 0) {
|
|
||||||
xmlMutexUnlock(tok->lock);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -455,34 +390,6 @@ __xmlGlobalInitMutexLock(void)
|
|||||||
|
|
||||||
/* Lock the chosen critical section */
|
/* Lock the chosen critical section */
|
||||||
EnterCriticalSection(global_init_lock);
|
EnterCriticalSection(global_init_lock);
|
||||||
#elif defined HAVE_BEOS_THREADS
|
|
||||||
int32 sem;
|
|
||||||
|
|
||||||
/* Allocate a new semaphore */
|
|
||||||
sem = create_sem(1, "xmlGlobalinitMutex");
|
|
||||||
|
|
||||||
while (global_init_lock == -1) {
|
|
||||||
if (atomic_add(&global_init_count, 1) == 0) {
|
|
||||||
global_init_lock = sem;
|
|
||||||
} else {
|
|
||||||
snooze(1);
|
|
||||||
atomic_add(&global_init_count, -1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* If another thread successfully recorded its critical
|
|
||||||
* section in the global_init_lock then discard the one
|
|
||||||
* allocated by this thread. */
|
|
||||||
if (global_init_lock != sem)
|
|
||||||
delete_sem(sem);
|
|
||||||
|
|
||||||
/* Acquire the chosen semaphore */
|
|
||||||
if (acquire_sem(global_init_lock) != B_NO_ERROR) {
|
|
||||||
#ifdef DEBUG_THREADS
|
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
|
||||||
"xmlGlobalInitMutexLock():BeOS:Couldn't acquire semaphore\n");
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -499,8 +406,6 @@ __xmlGlobalInitMutexUnlock(void)
|
|||||||
if (global_init_lock != NULL) {
|
if (global_init_lock != NULL) {
|
||||||
LeaveCriticalSection(global_init_lock);
|
LeaveCriticalSection(global_init_lock);
|
||||||
}
|
}
|
||||||
#elif defined HAVE_BEOS_THREADS
|
|
||||||
release_sem(global_init_lock);
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -613,24 +518,6 @@ static CRITICAL_SECTION cleanup_helpers_cs;
|
|||||||
#endif /* HAVE_COMPILER_TLS */
|
#endif /* HAVE_COMPILER_TLS */
|
||||||
#endif /* HAVE_WIN32_THREADS */
|
#endif /* HAVE_WIN32_THREADS */
|
||||||
|
|
||||||
#if defined HAVE_BEOS_THREADS
|
|
||||||
|
|
||||||
/**
|
|
||||||
* xmlGlobalStateCleanup:
|
|
||||||
* @data: unused parameter
|
|
||||||
*
|
|
||||||
* Used for Beos only
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
xmlGlobalStateCleanup(void *data)
|
|
||||||
{
|
|
||||||
void *globalval = tls_get(globalkey);
|
|
||||||
|
|
||||||
if (globalval != NULL)
|
|
||||||
xmlFreeGlobalState(globalval);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* xmlGetGlobalState:
|
* xmlGetGlobalState:
|
||||||
*
|
*
|
||||||
@@ -713,21 +600,6 @@ xmlGetGlobalState(void)
|
|||||||
}
|
}
|
||||||
return (globalval);
|
return (globalval);
|
||||||
#endif /* HAVE_COMPILER_TLS */
|
#endif /* HAVE_COMPILER_TLS */
|
||||||
#elif defined HAVE_BEOS_THREADS
|
|
||||||
xmlGlobalState *globalval;
|
|
||||||
|
|
||||||
xmlOnceInit();
|
|
||||||
|
|
||||||
if ((globalval = (xmlGlobalState *) tls_get(globalkey)) == NULL) {
|
|
||||||
xmlGlobalState *tsd = xmlNewGlobalState();
|
|
||||||
if (tsd == NULL)
|
|
||||||
return (NULL);
|
|
||||||
|
|
||||||
tls_set(globalkey, tsd);
|
|
||||||
on_exit_thread(xmlGlobalStateCleanup, NULL);
|
|
||||||
return (tsd);
|
|
||||||
}
|
|
||||||
return (globalval);
|
|
||||||
#else
|
#else
|
||||||
return (NULL);
|
return (NULL);
|
||||||
#endif
|
#endif
|
||||||
@@ -763,8 +635,6 @@ xmlGetThreadId(void)
|
|||||||
return (ret);
|
return (ret);
|
||||||
#elif defined HAVE_WIN32_THREADS
|
#elif defined HAVE_WIN32_THREADS
|
||||||
return GetCurrentThreadId();
|
return GetCurrentThreadId();
|
||||||
#elif defined HAVE_BEOS_THREADS
|
|
||||||
return find_thread(NULL);
|
|
||||||
#else
|
#else
|
||||||
return ((int) 0);
|
return ((int) 0);
|
||||||
#endif
|
#endif
|
||||||
@@ -788,8 +658,6 @@ xmlIsMainThread(void)
|
|||||||
pthread_once(&once_control, xmlOnceInit);
|
pthread_once(&once_control, xmlOnceInit);
|
||||||
#elif defined HAVE_WIN32_THREADS
|
#elif defined HAVE_WIN32_THREADS
|
||||||
xmlOnceInit();
|
xmlOnceInit();
|
||||||
#elif defined HAVE_BEOS_THREADS
|
|
||||||
xmlOnceInit();
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_THREADS
|
#ifdef DEBUG_THREADS
|
||||||
@@ -799,8 +667,6 @@ xmlIsMainThread(void)
|
|||||||
return (pthread_equal(mainthread,pthread_self()));
|
return (pthread_equal(mainthread,pthread_self()));
|
||||||
#elif defined HAVE_WIN32_THREADS
|
#elif defined HAVE_WIN32_THREADS
|
||||||
return (mainthread == GetCurrentThreadId());
|
return (mainthread == GetCurrentThreadId());
|
||||||
#elif defined HAVE_BEOS_THREADS
|
|
||||||
return (mainthread == find_thread(NULL));
|
|
||||||
#else
|
#else
|
||||||
return (1);
|
return (1);
|
||||||
#endif
|
#endif
|
||||||
@@ -975,14 +841,6 @@ xmlOnceInit(void)
|
|||||||
Sleep(0);
|
Sleep(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#elif defined HAVE_BEOS_THREADS
|
|
||||||
if (atomic_add(&run_once_init, 1) == 0) {
|
|
||||||
globalkey = tls_allocate();
|
|
||||||
tls_set(globalkey, NULL);
|
|
||||||
mainthread = find_thread(NULL);
|
|
||||||
__xmlInitializeDict();
|
|
||||||
} else
|
|
||||||
atomic_add(&run_once_init, -1);
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
108
xmlmodule.c
108
xmlmodule.c
@@ -350,112 +350,4 @@ XML_POP_WARNINGS
|
|||||||
|
|
||||||
#endif /* _WIN32 */
|
#endif /* _WIN32 */
|
||||||
|
|
||||||
#ifdef HAVE_BEOS
|
|
||||||
|
|
||||||
#include <kernel/image.h>
|
|
||||||
|
|
||||||
/*
|
|
||||||
* xmlModulePlatformOpen:
|
|
||||||
* beos api info: http://www.beunited.org/bebook/The%20Kernel%20Kit/Images.html
|
|
||||||
* returns a handle on success, and zero on error.
|
|
||||||
*/
|
|
||||||
|
|
||||||
static void *
|
|
||||||
xmlModulePlatformOpen(const char *name)
|
|
||||||
{
|
|
||||||
return (void *) load_add_on(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* xmlModulePlatformClose:
|
|
||||||
* beos api info: http://www.beunited.org/bebook/The%20Kernel%20Kit/Images.html
|
|
||||||
* returns 0 on success, and non-zero on error.
|
|
||||||
*/
|
|
||||||
|
|
||||||
static int
|
|
||||||
xmlModulePlatformClose(void *handle)
|
|
||||||
{
|
|
||||||
status_t rc;
|
|
||||||
|
|
||||||
rc = unload_add_on((image_id) handle);
|
|
||||||
|
|
||||||
if (rc == B_OK)
|
|
||||||
return 0;
|
|
||||||
else
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* xmlModulePlatformSymbol:
|
|
||||||
* beos api info: http://www.beunited.org/bebook/The%20Kernel%20Kit/Images.html
|
|
||||||
* returns 0 on success and the loaded symbol in result, and -1 on error.
|
|
||||||
*/
|
|
||||||
|
|
||||||
static int
|
|
||||||
xmlModulePlatformSymbol(void *handle, const char *name, void **symbol)
|
|
||||||
{
|
|
||||||
status_t rc;
|
|
||||||
|
|
||||||
rc = get_image_symbol((image_id) handle, name, B_SYMBOL_TYPE_ANY, symbol);
|
|
||||||
|
|
||||||
return (rc == B_OK) ? 0 : -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* HAVE_BEOS */
|
|
||||||
|
|
||||||
#ifdef HAVE_OS2
|
|
||||||
|
|
||||||
#include <os2.h>
|
|
||||||
|
|
||||||
/*
|
|
||||||
* xmlModulePlatformOpen:
|
|
||||||
* os2 api info: http://www.edm2.com/os2api/Dos/DosLoadModule.html
|
|
||||||
* returns a handle on success, and zero on error.
|
|
||||||
*/
|
|
||||||
|
|
||||||
static void *
|
|
||||||
xmlModulePlatformOpen(const char *name)
|
|
||||||
{
|
|
||||||
char errbuf[256];
|
|
||||||
void *handle;
|
|
||||||
int rc;
|
|
||||||
|
|
||||||
rc = DosLoadModule(errbuf, sizeof(errbuf) - 1, name, &handle);
|
|
||||||
|
|
||||||
if (rc)
|
|
||||||
return 0;
|
|
||||||
else
|
|
||||||
return (handle);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* xmlModulePlatformClose:
|
|
||||||
* os2 api info: http://www.edm2.com/os2api/Dos/DosFreeModule.html
|
|
||||||
* returns 0 on success, and non-zero on error.
|
|
||||||
*/
|
|
||||||
|
|
||||||
static int
|
|
||||||
xmlModulePlatformClose(void *handle)
|
|
||||||
{
|
|
||||||
return DosFreeModule(handle);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* xmlModulePlatformSymbol:
|
|
||||||
* os2 api info: http://www.edm2.com/os2api/Dos/DosQueryProcAddr.html
|
|
||||||
* returns 0 on success and the loaded symbol in result, and -1 on error.
|
|
||||||
*/
|
|
||||||
|
|
||||||
static int
|
|
||||||
xmlModulePlatformSymbol(void *handle, const char *name, void **symbol)
|
|
||||||
{
|
|
||||||
int rc;
|
|
||||||
|
|
||||||
rc = DosQueryProcAddr(handle, 0, name, symbol);
|
|
||||||
|
|
||||||
return (rc == NO_ERROR) ? 0 : -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* HAVE_OS2 */
|
|
||||||
|
|
||||||
#endif /* LIBXML_MODULES_ENABLED */
|
#endif /* LIBXML_MODULES_ENABLED */
|
||||||
|
|||||||
Reference in New Issue
Block a user