Bring win32 up to current
This commit is contained in:
parent
b4bc212f65
commit
15e6302fc0
|
@ -446,7 +446,7 @@ void *os_libfunc(char **pe, void *handle, char *function) {
|
|||
return retval;
|
||||
}
|
||||
|
||||
int *os_unload(void *handle) {
|
||||
int os_unload(void *handle) {
|
||||
return dlclose(handle);
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
2
src/os.h
2
src/os.h
|
@ -36,7 +36,7 @@ extern int os_chown(char *path, char *user);
|
|||
/* library loading functions */
|
||||
extern void *os_loadlib(char **pe, char *path);
|
||||
extern void *os_libfunc(char **pe, void *handle, char *function);
|
||||
extern void *os_unload(void *handle);
|
||||
extern int os_unload(void *handle);
|
||||
|
||||
#ifdef WIN32
|
||||
# include "os-win32.h"
|
||||
|
|
|
@ -54,7 +54,7 @@ typedef struct tag_pluginentry {
|
|||
static PLUGIN_ENTRY _plugin_list;
|
||||
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[] = {
|
||||
"Success.",
|
||||
|
@ -322,11 +322,13 @@ XMLSTRUCT *pi_xml_init(WS_CONNINFO *pwsc, int emit_header) {
|
|||
}
|
||||
|
||||
void pi_xml_push(XMLSTRUCT *pxml, char *term) {
|
||||
return xml_push(pxml, term);
|
||||
xml_push(pxml, term);
|
||||
return;
|
||||
}
|
||||
|
||||
void pi_xml_pop(XMLSTRUCT *pxml) {
|
||||
return xml_pop(pxml);
|
||||
xml_pop(pxml);
|
||||
return;
|
||||
}
|
||||
|
||||
/* FIXME: 256? */
|
||||
|
|
|
@ -168,6 +168,9 @@
|
|||
<File
|
||||
RelativePath="..\src\os-win32.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\plugin.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\redblack.c">
|
||||
</File>
|
||||
|
|
Loading…
Reference in New Issue