/usr/include/searpc-client.h is in libsearpc-dev 3.0.8-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | #ifndef SEARPC_CLIENT_H
#define SEARPC_CLIENT_H
#include <glib.h>
#include <glib-object.h>
#include <jansson.h>
#ifndef DFT_DOMAIN
#define DFT_DOMAIN g_quark_from_string(G_LOG_DOMAIN)
#endif
typedef char *(*TransportCB)(void *arg, const gchar *fcall_str,
size_t fcall_len, size_t *ret_len);
/**
* @rpc_priv is used by the rpc_client to store information related to
* this rpc call.
* @fcall_str is an allocated string, and the sender should free it
* when not needed.
*/
typedef int (*AsyncTransportSend)(void *arg, gchar *fcall_str,
size_t fcall_len, void *rpc_priv);
typedef void (*AsyncCallback) (void *result, void *user_data, GError *error);
struct _SearpcClient {
TransportCB send;
void *arg;
AsyncTransportSend async_send;
void *async_arg;
};
typedef struct _SearpcClient SearpcClient;
SearpcClient *searpc_client_new ();
void searpc_client_free (SearpcClient *client);
void
searpc_client_call (SearpcClient *client, const char *fname,
const char *ret_type, GType gobject_type,
void *ret_ptr, GError **error,
int n_params, ...);
int
searpc_client_call__int (SearpcClient *client, const char *fname,
GError **error, int n_params, ...);
gint64
searpc_client_call__int64 (SearpcClient *client, const char *fname,
GError **error, int n_params, ...);
char *
searpc_client_call__string (SearpcClient *client, const char *fname,
GError **error, int n_params, ...);
GObject *
searpc_client_call__object (SearpcClient *client, const char *fname,
GType object_type,
GError **error, int n_params, ...);
GList*
searpc_client_call__objlist (SearpcClient *client, const char *fname,
GType object_type,
GError **error, int n_params, ...);
json_t *
searpc_client_call__json (SearpcClient *client, const char *fname,
GError **error, int n_params, ...);
char* searpc_client_transport_send (SearpcClient *client,
const gchar *fcall_str,
size_t fcall_len,
size_t *ret_len);
int
searpc_client_async_call__int (SearpcClient *client,
const char *fname,
AsyncCallback callback, void *cbdata,
int n_params, ...);
int
searpc_client_async_call__int64 (SearpcClient *client,
const char *fname,
AsyncCallback callback, void *cbdata,
int n_params, ...);
int
searpc_client_async_call__string (SearpcClient *client,
const char *fname,
AsyncCallback callback, void *cbdata,
int n_params, ...);
int
searpc_client_async_call__object (SearpcClient *client,
const char *fname,
AsyncCallback callback,
GType object_type, void *cbdata,
int n_params, ...);
int
searpc_client_async_call__objlist (SearpcClient *client,
const char *fname,
AsyncCallback callback,
GType object_type, void *cbdata,
int n_params, ...);
int
searpc_client_async_call__json (SearpcClient *client,
const char *fname,
AsyncCallback callback, void *cbdata,
int n_params, ...);
/* called by the transport layer, the rpc layer should be able to
* modify the str, but not take ownership of it */
int
searpc_client_generic_callback (char *retstr, size_t len,
void *vdata, const char *errstr);
/* in case of transport error, the following code and message will be
* set in GError */
#define TRANSPORT_ERROR "Transport Error"
#define TRANSPORT_ERROR_CODE 500
#endif
|