Bring win32 up to current

This commit is contained in:
Ron Pedde 2006-04-22 20:03:26 +00:00
parent b4bc212f65
commit 15e6302fc0
5 changed files with 38 additions and 5 deletions

View File

@ -446,7 +446,7 @@ void *os_libfunc(char **pe, void *handle, char *function) {
return retval; return retval;
} }
int *os_unload(void *handle) { int os_unload(void *handle) {
return dlclose(handle); return dlclose(handle);
} }

View File

@ -674,4 +674,32 @@ void _os_unlock(void) {
} }
} }
/**
* load a loadable library
*/
void *os_loadlib(char **pe, char *path) {
void *retval;
retval = (void*)LoadLibrary(path);
if(!retval) {
if(pe) *pe = strdup(os_strerror(0));
}
return retval;
}
void *os_libfunc(char **pe, void *handle, char *function) {
void *retval;
retval = GetProcAddress((HMODULE)handle, function);
if(!retval) {
if(pe) *pe = strdup(os_strerror(0));
}
return retval;
}
int os_unload(void *handle) {
FreeLibrary(handle);
return TRUE;
}

View File

@ -36,7 +36,7 @@ extern int os_chown(char *path, char *user);
/* library loading functions */ /* library loading functions */
extern void *os_loadlib(char **pe, char *path); extern void *os_loadlib(char **pe, char *path);
extern void *os_libfunc(char **pe, void *handle, char *function); extern void *os_libfunc(char **pe, void *handle, char *function);
extern void *os_unload(void *handle); extern int os_unload(void *handle);
#ifdef WIN32 #ifdef WIN32
# include "os-win32.h" # include "os-win32.h"

View File

@ -54,7 +54,7 @@ typedef struct tag_pluginentry {
static PLUGIN_ENTRY _plugin_list; static PLUGIN_ENTRY _plugin_list;
static int _plugin_initialized = 0; static int _plugin_initialized = 0;
static pthread_rwlock_t _plugin_lock = PTHREAD_MUTEX_INITIALIZER; static pthread_rwlock_t _plugin_lock;
static char* _plugin_error_list[] = { static char* _plugin_error_list[] = {
"Success.", "Success.",
@ -322,11 +322,13 @@ XMLSTRUCT *pi_xml_init(WS_CONNINFO *pwsc, int emit_header) {
} }
void pi_xml_push(XMLSTRUCT *pxml, char *term) { void pi_xml_push(XMLSTRUCT *pxml, char *term) {
return xml_push(pxml, term); xml_push(pxml, term);
return;
} }
void pi_xml_pop(XMLSTRUCT *pxml) { void pi_xml_pop(XMLSTRUCT *pxml) {
return xml_pop(pxml); xml_pop(pxml);
return;
} }
/* FIXME: 256? */ /* FIXME: 256? */

View File

@ -168,6 +168,9 @@
<File <File
RelativePath="..\src\os-win32.c"> RelativePath="..\src\os-win32.c">
</File> </File>
<File
RelativePath="..\src\plugin.c">
</File>
<File <File
RelativePath="..\src\redblack.c"> RelativePath="..\src\redblack.c">
</File> </File>