zio_api_t api;
};
-struct zap_queue;
-#define zap_queue_t struct zap_queue
-
+typedef struct zap_queue zap_queue_t;
typedef zap_status_t (*zap_queue_create_func_t)(zap_queue_t **queue, zap_size_t capacity);
typedef zap_status_t (*zap_queue_enqueue_func_t)(zap_queue_t *queue, void *obj);
typedef void *(*zap_queue_dequeue_func_t)(zap_queue_t *queue);
typedef void (*zap_func_ptr_t) (void);
typedef void * zap_dso_lib_t;
-void zap_dso_destroy(zap_dso_lib_t *lib);
-zap_dso_lib_t zap_dso_open(const char *path, char **err);
-void *zap_dso_func_sym(zap_dso_lib_t lib, const char *sym, char **err);
+OZ_DECLARE(void) zap_dso_destroy(zap_dso_lib_t *lib);
+OZ_DECLARE(zap_dso_lib_t) zap_dso_open(const char *path, char **err);
+OZ_DECLARE(void *) zap_dso_func_sym(zap_dso_lib_t lib, const char *sym, char **err);
#ifdef __cplusplus
}
/>\r
<Tool\r
Name="VCLinkerTool"\r
+ AdditionalDependencies="openzap.lib"\r
LinkIncremental="2"\r
+ AdditionalLibraryDirectories=""$(OutDir)""\r
GenerateDebugInformation="true"\r
SubSystem="2"\r
TargetMachine="1"\r
mcon = &sangoma_boost_data->mcon;
pcon = &sangoma_boost_data->pcon;
- if (sangoma_boost_data->sigmod || FD_ISSET(pcon->socket, &sangoma_boost_data->rfds)) {
+ if (sangoma_boost_data->sigmod
+#ifndef WIN32
+ || FD_ISSET(pcon->socket, &sangoma_boost_data->rfds)
+#endif
+ ) {
event = sangomabc_connection_readp(pcon, sangoma_boost_data->iteration);
}
-
+#ifndef WIN32
/* if there is no event and this is not a sigmod-driven span it's time to try the other connection for events */
if (!event && !sangoma_boost_data->sigmod && FD_ISSET(mcon->socket, &sangoma_boost_data->rfds)) {
event = sangomabc_connection_readp(mcon, sangoma_boost_data->iteration);
}
+#endif
return event;
}
<Tool\r
Name="VCCLCompilerTool"\r
Optimization="0"\r
- AdditionalIncludeDirectories="../../../src/include;../../../src/isdn/include;../../../wanpipe/include"\r
+ AdditionalIncludeDirectories="../../../src/include;../../../src/isdn/include;C:\wanpipe\include"\r
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;"\r
MinimalRebuild="true"\r
BasicRuntimeChecks="3"\r
Name="VCLinkerTool"\r
AdditionalDependencies="openzap.lib libsangoma.lib"\r
LinkIncremental="2"\r
- AdditionalLibraryDirectories=""$(OutDir)";../../../wanpipe/api/lib/x86"\r
+ AdditionalLibraryDirectories=""$(OutDir)";C:\wanpipe\lib"\r
GenerateDebugInformation="true"\r
SubSystem="1"\r
RandomizedBaseAddress="1"\r
#include <stdio.h>
-void zap_dso_destroy(zap_dso_lib_t *lib) {
+OZ_DECLARE(void) zap_dso_destroy(zap_dso_lib_t *lib) {
if (lib && *lib) {
FreeLibrary(*lib);
*lib = NULL;
}
}
-zap_dso_lib_t zap_dso_open(const char *path, char **err) {
+OZ_DECLARE(zap_dso_lib_t) zap_dso_open(const char *path, char **err) {
HINSTANCE lib;
lib = LoadLibraryEx(path, NULL, 0);
return lib;
}
-void* zap_dso_func_sym(zap_dso_lib_t lib, const char *sym, char **err) {
+OZ_DECLARE(void*) zap_dso_func_sym(zap_dso_lib_t lib, const char *sym, char **err) {
FARPROC func = GetProcAddress(lib, sym);
if (!func) {
DWORD error = GetLastError();
#include <dlfcn.h>
-void zap_dso_destroy(zap_dso_lib_t *lib) {
+OZ_DECLARE(void) zap_dso_destroy(zap_dso_lib_t *lib) {
if (lib && *lib) {
dlclose(*lib);
*lib = NULL;
}
}
-zap_dso_lib_t zap_dso_open(const char *path, char **err) {
+OZ_DECLARE(zap_dso_lib_t) zap_dso_open(const char *path, char **err) {
void *lib = dlopen(path, RTLD_NOW | RTLD_LOCAL);
if (lib == NULL) {
*err = zap_strdup(dlerror());
return lib;
}
-void *zap_dso_func_sym(zap_dso_lib_t lib, const char *sym, char **err) {
+OZ_DECLARE(void*) zap_dso_func_sym(zap_dso_lib_t lib, const char *sym, char **err) {
void *func = dlsym(lib, sym);
if (!func) {
*err = zap_strdup(dlerror());
#include "openzap.h"
-#undef zap_queue_t
-typedef struct zap_queue {
+static zap_status_t zap_std_queue_create(zap_queue_t **outqueue, zap_size_t capacity);
+static zap_status_t zap_std_queue_enqueue(zap_queue_t *queue, void *obj);
+static void *zap_std_queue_dequeue(zap_queue_t *queue);
+static zap_status_t zap_std_queue_wait(zap_queue_t *queue, int ms);
+static zap_status_t zap_std_queue_destroy(zap_queue_t **inqueue);
+
+struct zap_queue {
zap_mutex_t *mutex;
zap_condition_t *condition;
zap_size_t capacity;
unsigned rindex;
unsigned windex;
void **elements;
-} zap_queue_t;
-
-static zap_status_t zap_std_queue_create(zap_queue_t **outqueue, zap_size_t capacity);
-static zap_status_t zap_std_queue_enqueue(zap_queue_t *queue, void *obj);
-static void *zap_std_queue_dequeue(zap_queue_t *queue);
-static zap_status_t zap_std_queue_wait(zap_queue_t *queue, int ms);
-static zap_status_t zap_std_queue_destroy(zap_queue_t **inqueue);
+};
OZ_DECLARE_DATA zap_queue_handler_t g_zap_queue_handler =
{
- .create = zap_std_queue_create,
- .enqueue = zap_std_queue_enqueue,
- .dequeue = zap_std_queue_dequeue,
- .wait = zap_std_queue_wait,
- .destroy = zap_std_queue_destroy
+ /*.create = */ zap_std_queue_create,
+ /*.enqueue = */ zap_std_queue_enqueue,
+ /*.dequeue = */ zap_std_queue_dequeue,
+ /*.wait = */ zap_std_queue_wait,
+ /*.destroy = */ zap_std_queue_destroy
};
OZ_DECLARE(zap_status_t) zap_global_set_queue_handler(zap_queue_handler_t *handler)
static zap_status_t zap_std_queue_create(zap_queue_t **outqueue, zap_size_t capacity)
{
+ zap_queue_t *queue = NULL;
zap_assert_return(outqueue, ZAP_FAIL, "Queue double pointer is null\n");
zap_assert_return(capacity > 0, ZAP_FAIL, "Queue capacity is not bigger than 0\n");
*outqueue = NULL;
- zap_queue_t *queue = zap_calloc(1, sizeof(*queue));
+ queue = zap_calloc(1, sizeof(*queue));
if (!queue) {
return ZAP_FAIL;
}