1
0
mirror of https://github.com/haiwen/libsearpc.git synced 2025-09-18 16:07:05 +00:00

export to generate lib

This commit is contained in:
caixiangyue
2019-11-01 15:52:36 +08:00
parent 3291d04cec
commit 8b853cf41d
5 changed files with 76 additions and 26 deletions

View File

@@ -1,6 +1,12 @@
#ifndef SEARPC_NAMED_PIPE_TRANSPORT_H
#define SEARPC_NAMED_PIPE_TRANSPORT_H
#ifdef LIBSEARPC_EXPORTS
#define LIBSEARPC_API __declspec(dllexport)
#else
#define LIBSEARPC_API
#endif
#include <pthread.h>
#include <glib.h>
#include <glib-object.h>
@@ -34,12 +40,15 @@ struct _SearpcNamedPipeServer {
GThreadPool *named_pipe_server_thread_pool;
};
typedef struct _SearpcNamedPipeServer SearpcNamedPipeServer;
typedef struct _SearpcNamedPipeServer LIBSEARPC_API SearpcNamedPipeServer;
LIBSEARPC_API
SearpcNamedPipeServer* searpc_create_named_pipe_server(const char *path);
LIBSEARPC_API
SearpcNamedPipeServer* searpc_create_named_pipe_server_with_threadpool(const char *path, int named_pipe_server_thread_pool_size);
LIBSEARPC_API
int searpc_named_pipe_server_start(SearpcNamedPipeServer *server);
// Client side interface.
@@ -49,14 +58,18 @@ struct _SearpcNamedPipeClient {
SearpcNamedPipe pipe_fd;
};
typedef struct _SearpcNamedPipeClient SearpcNamedPipeClient;
typedef struct _SearpcNamedPipeClient LIBSEARPC_API SearpcNamedPipeClient;
LIBSEARPC_API
SearpcNamedPipeClient* searpc_create_named_pipe_client(const char *path);
LIBSEARPC_API
SearpcClient * searpc_client_with_named_pipe_transport(SearpcNamedPipeClient *client, const char *service);
LIBSEARPC_API
int searpc_named_pipe_client_connect(SearpcNamedPipeClient *client);
LIBSEARPC_API
void searpc_free_client_with_pipe_transport (SearpcClient *client);
#endif // SEARPC_NAMED_PIPE_TRANSPORT_H