mirror of
https://github.com/haiwen/seafile.git
synced 2025-01-07 03:17:13 +08:00
copy some files from ccnet/lib to seafile/lib
This commit is contained in:
parent
20a02ed533
commit
1671133d5e
71
.gitignore
vendored
Normal file
71
.gitignore
vendored
Normal file
@ -0,0 +1,71 @@
|
||||
*~
|
||||
*.bak
|
||||
*.o
|
||||
*.exe
|
||||
cscope*
|
||||
*#
|
||||
Makefile.in
|
||||
ltmain.sh
|
||||
libtool
|
||||
*.lo
|
||||
*.la
|
||||
install-sh
|
||||
depcomp
|
||||
config.guess
|
||||
config.h
|
||||
config.log
|
||||
config.status
|
||||
config.sub
|
||||
config.cache
|
||||
configure
|
||||
*/.deps
|
||||
autom4te*
|
||||
po/POTFILES
|
||||
missing
|
||||
mkinstalldirs
|
||||
stamp-h1
|
||||
*.libs/
|
||||
Makefile
|
||||
aclocal.m4
|
||||
*core
|
||||
m4/intltool.m4
|
||||
m4/libtool.m4
|
||||
m4/ltoptions.m4
|
||||
m4/ltsugar.m4
|
||||
m4/ltversion.m4
|
||||
m4/lt~obsolete.m4
|
||||
ccnet-*.tar.gz
|
||||
config.h.in
|
||||
py-compile
|
||||
*.stamp
|
||||
*.pyc
|
||||
*.tmp.ui
|
||||
*.defs
|
||||
*.log
|
||||
.deps
|
||||
*.db
|
||||
*.dll
|
||||
*.aps
|
||||
*.so
|
||||
build-stamp
|
||||
debian/files
|
||||
debian/seafile
|
||||
debian/*.substvars
|
||||
lib/searpc-marshal.h
|
||||
lib/searpc-signature.h
|
||||
lib/dir.c
|
||||
lib/dirent.c
|
||||
lib/seafile-object.h
|
||||
lib/task.c
|
||||
lib/webaccess.c
|
||||
lib/branch.c
|
||||
lib/commit.c
|
||||
lib/crypt.c
|
||||
lib/repo.c
|
||||
app/seafile
|
||||
app/seafserv-tool
|
||||
daemon/seaf-daemon
|
||||
gui/gtk/seafile-applet
|
||||
server/seaf-server
|
||||
*.mo
|
||||
ccnet-web.sh
|
@ -2,9 +2,9 @@
|
||||
|
||||
#include "common.h"
|
||||
|
||||
#include <ccnet/job-mgr.h>
|
||||
#include "db.h"
|
||||
#include "seafile-session.h"
|
||||
#include "job-mgr.h"
|
||||
|
||||
#define INFO_DB "info.db"
|
||||
|
||||
|
@ -18,11 +18,11 @@
|
||||
|
||||
#include <ccnet.h>
|
||||
#include <ccnet/cevent.h>
|
||||
#include <ccnet/ccnet-object.h>
|
||||
#include <utils.h>
|
||||
|
||||
#include "seafile-session.h"
|
||||
#include "seafile-config.h"
|
||||
#include "ccnet-object.h"
|
||||
#include "vc-utils.h"
|
||||
#include "seaf-utils.h"
|
||||
#include "gc.h"
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include <glib-object.h>
|
||||
#include <ccnet/cevent.h>
|
||||
#include <ccnet/mqclient-proc.h>
|
||||
#include <job-mgr.h>
|
||||
#include <ccnet/job-mgr.h>
|
||||
|
||||
#include "block-mgr.h"
|
||||
#include "fs-mgr.h"
|
||||
|
@ -9,9 +9,9 @@
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <ccnet/job-mgr.h>
|
||||
#include "seafile-session.h"
|
||||
#include "utils.h"
|
||||
#include "job-mgr.h"
|
||||
#include "wt-monitor.h"
|
||||
#define DEBUG_FLAG SEAFILE_DEBUG_WATCH
|
||||
#include "log.h"
|
||||
|
@ -8,9 +8,9 @@
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <ccnet/job-mgr.h>
|
||||
#include "seafile-session.h"
|
||||
#include "utils.h"
|
||||
#include "job-mgr.h"
|
||||
#include "wt-monitor.h"
|
||||
#define DEBUG_FLAG SEAFILE_DEBUG_WATCH
|
||||
#include "log.h"
|
||||
|
@ -7,9 +7,9 @@
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <ccnet/job-mgr.h>
|
||||
#include "seafile-session.h"
|
||||
#include "utils.h"
|
||||
#include "job-mgr.h"
|
||||
#include "wt-monitor.h"
|
||||
#define DEBUG_FLAG SEAFILE_DEBUG_WATCH
|
||||
#include "log.h"
|
||||
|
@ -16,7 +16,12 @@ seafile_object_gen = $(seafile_object_define:.vala=.c)
|
||||
|
||||
EXTRA_DIST = ${seafile_object_define}
|
||||
|
||||
noinst_HEADERS = seafile-object.h
|
||||
utils_headers = async-rpc-proc.h net.h rsa.h threaded-rpcserver-proc.h \
|
||||
bloom-filter.h rpcserver-proc.h utils.h db.h ccnetrpc-transport.h
|
||||
|
||||
utils_srcs = $(utils_headers:.h=.c)
|
||||
|
||||
noinst_HEADERS = seafile-object.h ${utils_headers} rpc-common.h include.h
|
||||
|
||||
seafile-rpc-wrapper.c: seafile-object.h
|
||||
|
||||
@ -28,7 +33,7 @@ seafile-object.h: ${seafile_object_define}
|
||||
rm -f $@
|
||||
valac --pkg posix ${seafile_object_define} -C -H seafile-object.h
|
||||
|
||||
CLEANFILES = seafile-object.h ${seafile_object_gen} ccnetobj.c ccnet-object.h ${searpc_gen}
|
||||
CLEANFILES = seafile-object.h ${seafile_object_gen} ${searpc_gen}
|
||||
|
||||
## library rules
|
||||
lib_LTLIBRARIES = libseafile.la
|
||||
@ -40,9 +45,11 @@ libseafile_la_LIBADD = @GLIB2_LIBS@ @GOBJECT_LIBS@ @SEARPC_LIBS@
|
||||
|
||||
noinst_LTLIBRARIES = libseafile_common.la
|
||||
|
||||
libseafile_common_la_SOURCES = ${seafile_object_gen}
|
||||
libseafile_common_la_SOURCES = ${seafile_object_gen} ${utils_srcs}
|
||||
libseafile_common_la_LDFLAGS = -no-undefined
|
||||
libseafile_common_la_LIBADD = @GLIB2_LIBS@ @GOBJECT_LIBS@
|
||||
libseafile_common_la_LIBADD = @GLIB2_LIBS@ @GOBJECT_LIBS@ -lssl -lcrypto @LIB_GDI32@ \
|
||||
@LIB_UUID@ @LIB_WS32@ @LIB_PSAPI@ -lsqlite3 \
|
||||
-levent @SEARPC_LIBS@ @LIB_SHELL32@
|
||||
|
||||
searpc_gen = searpc-signature.h searpc-marshal.h
|
||||
|
||||
|
138
lib/async-rpc-proc.c
Normal file
138
lib/async-rpc-proc.c
Normal file
@ -0,0 +1,138 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <ccnet.h>
|
||||
#include <searpc-client.h>
|
||||
#include "rpc-common.h"
|
||||
#include "async-rpc-proc.h"
|
||||
|
||||
#define MAX_RET_LEN 5242880 /* 5M */
|
||||
|
||||
typedef struct {
|
||||
const char *service;
|
||||
char *fcall_str;
|
||||
size_t fcall_len;
|
||||
void *rpc_priv;
|
||||
GString *buf;
|
||||
} CcnetAsyncRpcProcPriv;
|
||||
|
||||
#define GET_PRIV(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((o), CCNET_TYPE_ASYNC_RPC_PROC, CcnetAsyncRpcProcPriv))
|
||||
|
||||
G_DEFINE_TYPE (CcnetAsyncRpcProc, ccnet_async_rpc_proc, CCNET_TYPE_PROCESSOR)
|
||||
|
||||
static int start (CcnetProcessor *processor, int argc, char **argv);
|
||||
static void handle_response (CcnetProcessor *processor,
|
||||
char *code, char *code_msg,
|
||||
char *content, int clen);
|
||||
|
||||
static void
|
||||
release_resource(CcnetProcessor *processor)
|
||||
{
|
||||
CcnetAsyncRpcProcPriv *priv = GET_PRIV (processor);
|
||||
g_free (priv->fcall_str);
|
||||
g_assert (priv->buf == NULL);
|
||||
|
||||
CCNET_PROCESSOR_CLASS (ccnet_async_rpc_proc_parent_class)->release_resource (processor);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
ccnet_async_rpc_proc_class_init (CcnetAsyncRpcProcClass *klass)
|
||||
{
|
||||
CcnetProcessorClass *proc_class = CCNET_PROCESSOR_CLASS (klass);
|
||||
|
||||
proc_class->start = start;
|
||||
proc_class->handle_response = handle_response;
|
||||
proc_class->release_resource = release_resource;
|
||||
proc_class->name = "async-rpc-proc";
|
||||
|
||||
g_type_class_add_private (klass, sizeof(CcnetAsyncRpcProcPriv));
|
||||
}
|
||||
|
||||
static void
|
||||
ccnet_async_rpc_proc_init (CcnetAsyncRpcProc *processor)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
ccnet_async_rpc_proc_set_rpc (CcnetAsyncRpcProc *proc,
|
||||
const char *service,
|
||||
char *fcall_str,
|
||||
size_t fcall_len,
|
||||
void *rpc_priv)
|
||||
{
|
||||
CcnetAsyncRpcProcPriv *priv = GET_PRIV (proc);
|
||||
|
||||
priv->service = service;
|
||||
priv->fcall_str = fcall_str;
|
||||
priv->fcall_len = fcall_len;
|
||||
priv->rpc_priv = rpc_priv;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
start (CcnetProcessor *processor, int argc, char **argv)
|
||||
{
|
||||
CcnetAsyncRpcProcPriv *priv = GET_PRIV (processor);
|
||||
char buf[256];
|
||||
|
||||
if (argc != 0) {
|
||||
ccnet_processor_done (processor, FALSE);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (processor->peer_id) {
|
||||
snprintf (buf, sizeof(buf), "remote %s %s",
|
||||
processor->peer_id, priv->service);
|
||||
} else
|
||||
snprintf (buf, sizeof(buf), "%s", priv->service);
|
||||
ccnet_processor_send_request (processor, buf);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
handle_response (CcnetProcessor *processor,
|
||||
char *code, char *code_msg,
|
||||
char *content, int clen)
|
||||
{
|
||||
CcnetAsyncRpcProcPriv *priv = GET_PRIV (processor);
|
||||
|
||||
if (memcmp (code, SC_OK, 3) == 0) {
|
||||
ccnet_processor_send_update (processor, SC_CLIENT_CALL, SS_CLIENT_CALL,
|
||||
priv->fcall_str,
|
||||
priv->fcall_len);
|
||||
return;
|
||||
}
|
||||
|
||||
if (memcmp (code, SC_SERVER_RET, 3) == 0) {
|
||||
if (priv->buf == NULL)
|
||||
searpc_client_generic_callback (content, clen, priv->rpc_priv, NULL);
|
||||
else {
|
||||
g_string_append_len (priv->buf, content, clen);
|
||||
searpc_client_generic_callback (priv->buf->str, priv->buf->len,
|
||||
priv->rpc_priv, NULL);
|
||||
g_string_free (priv->buf, TRUE);
|
||||
priv->buf = NULL;
|
||||
}
|
||||
ccnet_processor_done (processor, TRUE);
|
||||
} else if (memcmp (code, SC_SERVER_MORE, 3) == 0) {
|
||||
if (priv->buf == NULL)
|
||||
priv->buf = g_string_new (NULL);
|
||||
g_string_append_len (priv->buf, content, clen);
|
||||
|
||||
if (priv->buf->len > MAX_RET_LEN) {
|
||||
g_warning ("[async-rpc] ret is too long\n");
|
||||
g_string_free (priv->buf, TRUE);
|
||||
priv->buf = NULL;
|
||||
ccnet_processor_send_update (processor, "400",
|
||||
"Too many data", NULL, 0);
|
||||
ccnet_processor_done (processor, FALSE);
|
||||
} else
|
||||
ccnet_processor_send_update (
|
||||
processor, SC_CLIENT_MORE, SS_CLIENT_MORE, NULL, 0);
|
||||
}
|
||||
|
||||
}
|
35
lib/async-rpc-proc.h
Normal file
35
lib/async-rpc-proc.h
Normal file
@ -0,0 +1,35 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
|
||||
#ifndef CCNET_ASYNC_RPC_PROC_H
|
||||
#define CCNET_ASYNC_RPC_PROC_H
|
||||
|
||||
#include <glib-object.h>
|
||||
|
||||
|
||||
#define CCNET_TYPE_ASYNC_RPC_PROC (ccnet_async_rpc_proc_get_type ())
|
||||
#define CCNET_ASYNC_RPC_PROC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CCNET_TYPE_ASYNC_RPC_PROC, CcnetAsyncRpcProc))
|
||||
#define CCNET_IS_ASYNC_RPC_PROC(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CCNET_TYPE_ASYNC_RPC_PROC))
|
||||
#define CCNET_ASYNC_RPC_PROC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CCNET_TYPE_ASYNC_RPC_PROC, CcnetAsyncRpcProcClass))
|
||||
#define IS_CCNET_ASYNC_RPC_PROC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CCNET_TYPE_ASYNC_RPC_PROC))
|
||||
#define CCNET_ASYNC_RPC_PROC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CCNET_TYPE_ASYNC_RPC_PROC, CcnetAsyncRpcProcClass))
|
||||
|
||||
typedef struct _CcnetAsyncRpcProc CcnetAsyncRpcProc;
|
||||
typedef struct _CcnetAsyncRpcProcClass CcnetAsyncRpcProcClass;
|
||||
|
||||
struct _CcnetAsyncRpcProc {
|
||||
CcnetProcessor parent_instance;
|
||||
};
|
||||
|
||||
struct _CcnetAsyncRpcProcClass {
|
||||
CcnetProcessorClass parent_class;
|
||||
};
|
||||
|
||||
GType ccnet_async_rpc_proc_get_type ();
|
||||
|
||||
void ccnet_async_rpc_proc_set_rpc (CcnetAsyncRpcProc *proc,
|
||||
const char *service,
|
||||
char *fcall_str,
|
||||
size_t fcall_len,
|
||||
void *rpc_priv);
|
||||
#endif
|
||||
|
182
lib/bloom-filter.c
Normal file
182
lib/bloom-filter.c
Normal file
@ -0,0 +1,182 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
|
||||
#include <limits.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <openssl/sha.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "bloom-filter.h"
|
||||
|
||||
#define SETBIT(a, n) (a[n/CHAR_BIT] |= (1<<(n%CHAR_BIT)))
|
||||
#define CLEARBIT(a, n) (a[n/CHAR_BIT] &= ~(1<<(n%CHAR_BIT)))
|
||||
#define GETBIT(a, n) (a[n/CHAR_BIT] & (1<<(n%CHAR_BIT)))
|
||||
|
||||
Bloom* bloom_create(size_t size, int k, int counting)
|
||||
{
|
||||
Bloom *bloom;
|
||||
size_t csize = 0;
|
||||
|
||||
if (k <=0 || k > 10) return NULL;
|
||||
|
||||
if ( !(bloom = malloc(sizeof(Bloom))) ) return NULL;
|
||||
if ( !(bloom->a = calloc((size+CHAR_BIT-1)/CHAR_BIT, sizeof(char))) )
|
||||
{
|
||||
free (bloom);
|
||||
return NULL;
|
||||
}
|
||||
if (counting) {
|
||||
csize = size*4;
|
||||
bloom->counters = calloc((csize+CHAR_BIT-1)/CHAR_BIT, sizeof(char));
|
||||
if (!bloom->counters) {
|
||||
free (bloom);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
bloom->asize = size;
|
||||
bloom->csize = csize;
|
||||
bloom->k = k;
|
||||
bloom->counting = counting;
|
||||
|
||||
return bloom;
|
||||
}
|
||||
|
||||
int bloom_destroy(Bloom *bloom)
|
||||
{
|
||||
free (bloom->a);
|
||||
if (bloom->counting) free (bloom->counters);
|
||||
free (bloom);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
incr_bit (Bloom *bf, unsigned int bit_idx)
|
||||
{
|
||||
unsigned int char_idx, offset;
|
||||
unsigned char value;
|
||||
unsigned int high;
|
||||
unsigned int low;
|
||||
|
||||
SETBIT (bf->a, bit_idx);
|
||||
|
||||
if (!bf->counting) return;
|
||||
|
||||
char_idx = bit_idx / 2;
|
||||
offset = bit_idx % 2;
|
||||
|
||||
value = bf->counters[char_idx];
|
||||
low = value & 0xF;
|
||||
high = (value & 0xF0) >> 4;
|
||||
|
||||
if (offset == 0) {
|
||||
if (low < 0xF)
|
||||
low++;
|
||||
} else {
|
||||
if (high < 0xF)
|
||||
high++;
|
||||
}
|
||||
value = ((high << 4) | low);
|
||||
|
||||
bf->counters[char_idx] = value;
|
||||
}
|
||||
|
||||
static void
|
||||
decr_bit (Bloom *bf, unsigned int bit_idx)
|
||||
{
|
||||
unsigned int char_idx, offset;
|
||||
unsigned char value;
|
||||
unsigned int high;
|
||||
unsigned int low;
|
||||
|
||||
if (!bf->counting) {
|
||||
CLEARBIT (bf->a, bit_idx);
|
||||
return;
|
||||
}
|
||||
|
||||
char_idx = bit_idx / 2;
|
||||
offset = bit_idx % 2;
|
||||
|
||||
value = bf->counters[char_idx];
|
||||
low = value & 0xF;
|
||||
high = (value & 0xF0) >> 4;
|
||||
|
||||
/* decrement, but once we have reached the max, never go back! */
|
||||
if (offset == 0) {
|
||||
if ((low > 0) && (low < 0xF))
|
||||
low--;
|
||||
if (low == 0) {
|
||||
CLEARBIT (bf->a, bit_idx);
|
||||
}
|
||||
} else {
|
||||
if ((high > 0) && (high < 0xF))
|
||||
high--;
|
||||
if (high == 0) {
|
||||
CLEARBIT (bf->a, bit_idx);
|
||||
}
|
||||
}
|
||||
value = ((high << 4) | low);
|
||||
|
||||
bf->counters[char_idx] = value;
|
||||
}
|
||||
|
||||
int bloom_add(Bloom *bloom, const char *s)
|
||||
{
|
||||
int i;
|
||||
SHA_CTX c;
|
||||
unsigned char sha1[20];
|
||||
int16_t *sha_int = (int16_t *)&sha1;
|
||||
|
||||
assert (s && *s);
|
||||
|
||||
SHA1_Init(&c);
|
||||
SHA1_Update(&c, s, strlen(s));
|
||||
SHA1_Final (sha1, &c);
|
||||
|
||||
for (i=0; i < bloom->k; ++i)
|
||||
incr_bit (bloom, sha_int[i] % bloom->asize);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int bloom_remove(Bloom *bloom, const char *s)
|
||||
{
|
||||
int i;
|
||||
SHA_CTX c;
|
||||
unsigned char sha1[20];
|
||||
int16_t *sha_int = (int16_t *)&sha1;
|
||||
|
||||
assert (s && *s);
|
||||
|
||||
if (!bloom->counting)
|
||||
return -1;
|
||||
|
||||
SHA1_Init(&c);
|
||||
SHA1_Update(&c, s, strlen(s));
|
||||
SHA1_Final (sha1, &c);
|
||||
|
||||
for (i=0; i < bloom->k; ++i)
|
||||
decr_bit (bloom, sha_int[i] % bloom->asize);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int bloom_test(Bloom *bloom, const char *s)
|
||||
{
|
||||
int i;
|
||||
SHA_CTX c;
|
||||
unsigned char sha1[20];
|
||||
int16_t *sha_int = (int16_t *)&sha1;
|
||||
|
||||
assert (s && *s);
|
||||
|
||||
SHA1_Init(&c);
|
||||
SHA1_Update(&c, s, strlen(s));
|
||||
SHA1_Final (sha1, &c);
|
||||
|
||||
for (i=0; i < bloom->k; ++i)
|
||||
if(!(GETBIT(bloom->a, sha_int[i] % bloom->asize))) return 0;
|
||||
|
||||
return 1;
|
||||
}
|
23
lib/bloom-filter.h
Normal file
23
lib/bloom-filter.h
Normal file
@ -0,0 +1,23 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
|
||||
#ifndef __BLOOM_H__
|
||||
#define __BLOOM_H__
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
typedef struct {
|
||||
size_t asize;
|
||||
unsigned char *a;
|
||||
size_t csize;
|
||||
unsigned char *counters;
|
||||
int k;
|
||||
char counting:1;
|
||||
} Bloom;
|
||||
|
||||
Bloom *bloom_create (size_t size, int k, int counting);
|
||||
int bloom_destroy (Bloom *bloom);
|
||||
int bloom_add (Bloom *bloom, const char *s);
|
||||
int bloom_remove (Bloom *bloom, const char *s);
|
||||
int bloom_test (Bloom *bloom, const char *s);
|
||||
|
||||
#endif
|
106
lib/ccnetrpc-transport.c
Normal file
106
lib/ccnetrpc-transport.c
Normal file
@ -0,0 +1,106 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "ccnetrpc-transport.h"
|
||||
#include "rpc-common.h"
|
||||
#include "async-rpc-proc.h"
|
||||
|
||||
|
||||
char *
|
||||
ccnetrpc_transport_send (void *arg, const gchar *fcall_str,
|
||||
size_t fcall_len, size_t *ret_len)
|
||||
{
|
||||
CcnetrpcTransportParam *priv;
|
||||
CcnetClient *session;
|
||||
struct CcnetResponse *rsp;
|
||||
uint32_t req_id;
|
||||
|
||||
g_warn_if_fail (arg != NULL && fcall_str != NULL);
|
||||
|
||||
priv = (CcnetrpcTransportParam *)arg;
|
||||
session = priv->session;
|
||||
|
||||
req_id = ccnet_client_get_rpc_request_id (session, priv->peer_id, priv->service);
|
||||
ccnet_client_send_update (session, req_id,
|
||||
SC_CLIENT_CALL, SS_CLIENT_CALL,
|
||||
fcall_str, fcall_len);
|
||||
|
||||
/* read response */
|
||||
if (ccnet_client_read_response (session) < 0) {
|
||||
*ret_len = 0;
|
||||
ccnet_client_clean_rpc_request (session, req_id);
|
||||
return NULL;
|
||||
}
|
||||
rsp = &session->response;
|
||||
|
||||
if (memcmp (rsp->code, SC_SERVER_RET, 3) == 0) {
|
||||
*ret_len = (size_t) rsp->clen;
|
||||
return g_strndup (rsp->content, rsp->clen);
|
||||
}
|
||||
|
||||
if (memcmp (rsp->code, SC_SERVER_MORE, 3) == 0) {
|
||||
GString *buf;
|
||||
|
||||
buf = g_string_new_len (rsp->content, rsp->clen);
|
||||
*ret_len = (size_t) rsp->clen;
|
||||
|
||||
do {
|
||||
ccnet_client_send_update (session, req_id,
|
||||
SC_CLIENT_MORE, SS_CLIENT_MORE,
|
||||
fcall_str, fcall_len);
|
||||
if (ccnet_client_read_response (session) < 0) {
|
||||
*ret_len = 0;
|
||||
g_string_free (buf, TRUE);
|
||||
ccnet_client_clean_rpc_request (session, req_id);
|
||||
return NULL;
|
||||
}
|
||||
rsp = &session->response;
|
||||
if (memcmp (rsp->code, SC_SERVER_ERR, 3) == 0) {
|
||||
g_warning ("[Sea RPC] Bad response: %s %s.\n",
|
||||
rsp->code, rsp->code_msg);
|
||||
*ret_len = 0;
|
||||
g_string_free (buf, TRUE);
|
||||
ccnet_client_clean_rpc_request (session, req_id);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
g_string_append_len (buf, rsp->content, rsp->clen);
|
||||
*ret_len += (size_t) rsp->clen;
|
||||
} while (memcmp (rsp->code, SC_SERVER_MORE, 3) == 0);
|
||||
|
||||
return g_string_free (buf, FALSE);
|
||||
}
|
||||
|
||||
g_warning ("[Sea RPC] Bad response: %s %s.\n", rsp->code, rsp->code_msg);
|
||||
*ret_len = 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
ccnetrpc_async_transport_send (void *arg, gchar *fcall_str,
|
||||
size_t fcall_len, void *rpc_priv)
|
||||
{
|
||||
CcnetrpcAsyncTransportParam *priv;
|
||||
CcnetClient *session;
|
||||
CcnetProcessor *proc;
|
||||
|
||||
g_warn_if_fail (arg != NULL && fcall_str != NULL);
|
||||
|
||||
priv = (CcnetrpcAsyncTransportParam *)arg;
|
||||
session = priv->session;
|
||||
|
||||
if (!priv->peer_id)
|
||||
proc = ccnet_proc_factory_create_master_processor (
|
||||
session->proc_factory, "async-rpc");
|
||||
else
|
||||
proc = ccnet_proc_factory_create_remote_master_processor (
|
||||
session->proc_factory, "async-rpc", priv->peer_id);
|
||||
|
||||
ccnet_async_rpc_proc_set_rpc ((CcnetAsyncRpcProc *)proc, priv->service,
|
||||
fcall_str, fcall_len, rpc_priv);
|
||||
ccnet_processor_start (proc, 0, NULL);
|
||||
return 0;
|
||||
}
|
28
lib/ccnetrpc-transport.h
Normal file
28
lib/ccnetrpc-transport.h
Normal file
@ -0,0 +1,28 @@
|
||||
#ifndef CCNETRPC_TRANPORT_H
|
||||
#define CCNETRPC_TRANPORT_H
|
||||
|
||||
#include <ccnet.h>
|
||||
|
||||
typedef struct {
|
||||
CcnetClient *session;
|
||||
char *peer_id; /* NULL if local */
|
||||
char *service;
|
||||
} CcnetrpcTransportParam; /* this structure will be parsed to
|
||||
* ccnet_transport_send ()
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
CcnetClient *session;
|
||||
char *peer_id; /* NULL if local */
|
||||
char *service;
|
||||
} CcnetrpcAsyncTransportParam; /* this structure will be parsed to
|
||||
* ccnet_async_transport_send ()
|
||||
*/
|
||||
|
||||
char *ccnetrpc_transport_send (void *arg,
|
||||
const gchar *fcall_str, size_t fcall_len, size_t *ret_len);
|
||||
|
||||
int ccnetrpc_async_transport_send (void *arg, gchar *fcall_str,
|
||||
size_t fcall_len, void *rpc_priv);
|
||||
|
||||
#endif /* SEARPC_TRANPORT_H */
|
223
lib/db.c
Normal file
223
lib/db.c
Normal file
@ -0,0 +1,223 @@
|
||||
|
||||
#include <glib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "db.h"
|
||||
|
||||
int
|
||||
sqlite_open_db (const char *db_path, sqlite3 **db)
|
||||
{
|
||||
int result;
|
||||
const char *errmsg;
|
||||
|
||||
result = sqlite3_open (db_path, db);
|
||||
if (result) {
|
||||
errmsg = sqlite3_errmsg (*db);
|
||||
|
||||
g_warning ("Couldn't open database:'%s', %s\n",
|
||||
db_path, errmsg ? errmsg : "no error given");
|
||||
|
||||
sqlite3_close (*db);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sqlite_close_db (sqlite3 *db)
|
||||
{
|
||||
return sqlite3_close (db);
|
||||
}
|
||||
|
||||
sqlite3_stmt *
|
||||
sqlite_query_prepare (sqlite3 *db, const char *sql)
|
||||
{
|
||||
sqlite3_stmt *stmt;
|
||||
int result;
|
||||
|
||||
result = sqlite3_prepare_v2 (db, sql, -1, &stmt, NULL);
|
||||
|
||||
if (result != SQLITE_OK) {
|
||||
const gchar *str = sqlite3_errmsg (db);
|
||||
|
||||
g_warning ("Couldn't prepare query, error:%d->'%s'\n\t%s\n",
|
||||
result, str ? str : "no error given", sql);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return stmt;
|
||||
}
|
||||
|
||||
int
|
||||
sqlite_query_exec (sqlite3 *db, const char *sql)
|
||||
{
|
||||
char *errmsg = NULL;
|
||||
int result;
|
||||
|
||||
result = sqlite3_exec (db, sql, NULL, NULL, &errmsg);
|
||||
|
||||
if (result != SQLITE_OK) {
|
||||
if (errmsg != NULL) {
|
||||
g_warning ("SQL error: %d - %s\n:\t%s\n", result, errmsg, sql);
|
||||
sqlite3_free (errmsg);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
sqlite_begin_transaction (sqlite3 *db)
|
||||
{
|
||||
char *sql = "BEGIN TRANSACTION;";
|
||||
return sqlite_query_exec (db, sql);
|
||||
}
|
||||
|
||||
int
|
||||
sqlite_end_transaction (sqlite3 *db)
|
||||
{
|
||||
char *sql = "END TRANSACTION;";
|
||||
return sqlite_query_exec (db, sql);
|
||||
}
|
||||
|
||||
|
||||
gboolean
|
||||
sqlite_check_for_existence (sqlite3 *db, const char *sql)
|
||||
{
|
||||
sqlite3_stmt *stmt;
|
||||
int result;
|
||||
|
||||
stmt = sqlite_query_prepare (db, sql);
|
||||
if (!stmt)
|
||||
return FALSE;
|
||||
|
||||
result = sqlite3_step (stmt);
|
||||
if (result == SQLITE_ERROR) {
|
||||
const gchar *str = sqlite3_errmsg (db);
|
||||
|
||||
g_warning ("Couldn't execute query, error: %d->'%s'\n",
|
||||
result, str ? str : "no error given");
|
||||
sqlite3_finalize (stmt);
|
||||
return FALSE;
|
||||
}
|
||||
sqlite3_finalize (stmt);
|
||||
|
||||
if (result == SQLITE_ROW)
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
int
|
||||
sqlite_foreach_selected_row (sqlite3 *db, const char *sql,
|
||||
SqliteRowFunc callback, void *data)
|
||||
{
|
||||
sqlite3_stmt *stmt;
|
||||
int result;
|
||||
int n_rows = 0;
|
||||
|
||||
stmt = sqlite_query_prepare (db, sql);
|
||||
if (!stmt) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
while (1) {
|
||||
result = sqlite3_step (stmt);
|
||||
if (result != SQLITE_ROW)
|
||||
break;
|
||||
n_rows++;
|
||||
if (!callback (stmt, data))
|
||||
break;
|
||||
}
|
||||
|
||||
if (result == SQLITE_ERROR) {
|
||||
const gchar *s = sqlite3_errmsg (db);
|
||||
|
||||
g_warning ("Couldn't execute query, error: %d->'%s'\n",
|
||||
result, s ? s : "no error given");
|
||||
sqlite3_finalize (stmt);
|
||||
return -1;
|
||||
}
|
||||
|
||||
sqlite3_finalize (stmt);
|
||||
return n_rows;
|
||||
}
|
||||
|
||||
int sqlite_get_int (sqlite3 *db, const char *sql)
|
||||
{
|
||||
int ret = -1;
|
||||
int result;
|
||||
sqlite3_stmt *stmt;
|
||||
|
||||
if ( !(stmt = sqlite_query_prepare(db, sql)) )
|
||||
return 0;
|
||||
|
||||
result = sqlite3_step (stmt);
|
||||
if (result == SQLITE_ROW) {
|
||||
ret = sqlite3_column_int (stmt, 0);
|
||||
sqlite3_finalize (stmt);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (result == SQLITE_ERROR) {
|
||||
const gchar *str = sqlite3_errmsg (db);
|
||||
g_warning ("Couldn't prepare query, error: %d->'%s'\n",
|
||||
result, str ? str : "no error given");
|
||||
sqlite3_finalize (stmt);
|
||||
return 0;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
gint64 sqlite_get_int64 (sqlite3 *db, const char *sql)
|
||||
{
|
||||
gint64 ret = -1;
|
||||
int result;
|
||||
sqlite3_stmt *stmt;
|
||||
|
||||
if ( !(stmt = sqlite_query_prepare(db, sql)) )
|
||||
return 0;
|
||||
|
||||
result = sqlite3_step (stmt);
|
||||
if (result == SQLITE_ROW) {
|
||||
ret = sqlite3_column_int64 (stmt, 0);
|
||||
sqlite3_finalize (stmt);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (result == SQLITE_ERROR) {
|
||||
const gchar *str = sqlite3_errmsg (db);
|
||||
g_warning ("Couldn't prepare query, error: %d->'%s'\n",
|
||||
result, str ? str : "no error given");
|
||||
sqlite3_finalize (stmt);
|
||||
return 0;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
char *sqlite_get_string (sqlite3 *db, const char *sql)
|
||||
{
|
||||
const char *res = NULL;
|
||||
int result;
|
||||
sqlite3_stmt *stmt;
|
||||
|
||||
if ( !(stmt = sqlite_query_prepare(db, sql)) )
|
||||
return NULL;
|
||||
|
||||
result = sqlite3_step (stmt);
|
||||
if (result == SQLITE_ROW) {
|
||||
res = (const char *)sqlite3_column_text (stmt, 0);
|
||||
sqlite3_finalize (stmt);
|
||||
return g_strdup(res);
|
||||
}
|
||||
|
||||
if (result == SQLITE_ERROR) {
|
||||
const gchar *str = sqlite3_errmsg (db);
|
||||
g_warning ("Couldn't prepare query, error: %d->'%s'\n",
|
||||
result, str ? str : "no error given");
|
||||
sqlite3_finalize (stmt);
|
||||
return NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
33
lib/db.h
Normal file
33
lib/db.h
Normal file
@ -0,0 +1,33 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
|
||||
#ifndef DB_UTILS_H
|
||||
#define DB_UTILS_H
|
||||
|
||||
#include <sqlite3.h>
|
||||
|
||||
int sqlite_open_db (const char *db_path, sqlite3 **db);
|
||||
|
||||
int sqlite_close_db (sqlite3 *db);
|
||||
|
||||
sqlite3_stmt *sqlite_query_prepare (sqlite3 *db, const char *sql);
|
||||
|
||||
int sqlite_query_exec (sqlite3 *db, const char *sql);
|
||||
int sqlite_begin_transaction (sqlite3 *db);
|
||||
int sqlite_end_transaction (sqlite3 *db);
|
||||
|
||||
gboolean sqlite_check_for_existence (sqlite3 *db, const char *sql);
|
||||
|
||||
typedef gboolean (*SqliteRowFunc) (sqlite3_stmt *stmt, void *data);
|
||||
|
||||
int
|
||||
sqlite_foreach_selected_row (sqlite3 *db, const char *sql,
|
||||
SqliteRowFunc callback, void *data);
|
||||
|
||||
int sqlite_get_int (sqlite3 *db, const char *sql);
|
||||
|
||||
gint64 sqlite_get_int64 (sqlite3 *db, const char *sql);
|
||||
|
||||
char *sqlite_get_string (sqlite3 *db, const char *sql);
|
||||
|
||||
|
||||
#endif
|
34
lib/include.h
Normal file
34
lib/include.h
Normal file
@ -0,0 +1,34 @@
|
||||
|
||||
#include <config.h>
|
||||
#include <stdint.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#include "utils.h"
|
||||
#include <ccnet/valid-check.h>
|
||||
|
||||
#ifndef ccnet_warning
|
||||
#define ccnet_warning(fmt, ...) g_warning( "%s: " fmt, __func__ , ##__VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#ifndef ccnet_error
|
||||
#define ccnet_error(fmt, ...) g_error( "%s: " fmt, __func__ , ##__VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#ifndef ccnet_message
|
||||
#define ccnet_message(fmt, ...) g_message(fmt, ##__VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#ifndef ccnet_debug
|
||||
#define ccnet_debug(fmt, ...) g_debug(fmt, ##__VA_ARGS__)
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef ENABLE_DEBUG
|
||||
#undef g_debug
|
||||
#define g_debug(...)
|
||||
#endif
|
72
lib/net.h
Normal file
72
lib/net.h
Normal file
@ -0,0 +1,72 @@
|
||||
|
||||
#ifndef CCNET_NET_H
|
||||
#define CCNET_NET_H
|
||||
|
||||
#ifdef WIN32
|
||||
#include <inttypes.h>
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
typedef int socklen_t;
|
||||
#define UNUSED
|
||||
#else
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
#include <sys/un.h>
|
||||
#include <net/if.h>
|
||||
#include <netinet/tcp.h>
|
||||
#endif
|
||||
|
||||
#include <evutil.h>
|
||||
|
||||
#ifdef WIN32
|
||||
#define ECONNREFUSED WSAECONNREFUSED
|
||||
#define ECONNRESET WSAECONNRESET
|
||||
#define EHOSTUNREACH WSAEHOSTUNREACH
|
||||
#define EINPROGRESS WSAEINPROGRESS
|
||||
#define ENOTCONN WSAENOTCONN
|
||||
#define EWOULDBLOCK WSAEWOULDBLOCK
|
||||
#define sockerrno WSAGetLastError( )
|
||||
#else
|
||||
#include <errno.h>
|
||||
#define sockerrno errno
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
extern int inet_aton(const char *string, struct in_addr *addr);
|
||||
extern const char *inet_ntop(int af, const void *src, char *dst, size_t size);
|
||||
extern int inet_pton(int af, const char *src, void *dst);
|
||||
#endif
|
||||
|
||||
evutil_socket_t ccnet_net_open_tcp (const struct sockaddr *sa, int nonblock);
|
||||
evutil_socket_t ccnet_net_bind_tcp (int port, int nonblock);
|
||||
evutil_socket_t ccnet_net_accept (evutil_socket_t b,
|
||||
struct sockaddr_storage *cliaddr,
|
||||
socklen_t *len, int nonblock);
|
||||
|
||||
/* bind to an IPv4 address, if (*port == 0) the port number will be returned */
|
||||
evutil_socket_t ccnet_net_bind_v4 (const char *ipaddr, int *port);
|
||||
|
||||
int ccnet_netSetTOS ( evutil_socket_t s, int tos );
|
||||
|
||||
char *sock_ntop(const struct sockaddr *sa, socklen_t salen);
|
||||
uint16_t sock_port (const struct sockaddr *sa);
|
||||
|
||||
/* return 1 if addr_str is a valid ipv4 or ipv6 address */
|
||||
int is_valid_ipaddr (const char *addr_str);
|
||||
|
||||
|
||||
/* return 0 if success, -1 if error */
|
||||
int sock_pton (const char *addr_str, uint16_t port,
|
||||
struct sockaddr_storage *sa);
|
||||
|
||||
evutil_socket_t udp_client (const char *host, const char *serv,
|
||||
struct sockaddr **saptr, socklen_t *lenp);
|
||||
|
||||
int mcast_set_loop(evutil_socket_t sockfd, int onoff);
|
||||
|
||||
evutil_socket_t create_multicast_sock (struct sockaddr *sasend, socklen_t salen);
|
||||
|
||||
#endif
|
41
lib/rpc-common.h
Normal file
41
lib/rpc-common.h
Normal file
@ -0,0 +1,41 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
|
||||
#ifndef RPC_COMMON_H
|
||||
#define RPC_COMMON_H
|
||||
|
||||
#include "ccnet/packet.h"
|
||||
|
||||
#define SC_CLIENT_CALL "301"
|
||||
#define SS_CLIENT_CALL "CLIENT CALL"
|
||||
#define SC_CLIENT_MORE "302"
|
||||
#define SS_CLIENT_MORE "MORE"
|
||||
#define SC_SERVER_RET "311"
|
||||
#define SS_SERVER_RET "SERVER RET"
|
||||
#define SC_SERVER_MORE "312"
|
||||
#define SS_SERVER_MORE "HAS MORE"
|
||||
#define SC_SERVER_ERR "411"
|
||||
#define SS_SERVER_ERR "Fail to invoke the function, check the function"
|
||||
|
||||
/* MESSAGE_HEADER = SC_SERVER_RET(3) + " " + SS_SERVER_RET(10) + "\n"(1) + "\n"(1) */
|
||||
#define MESSAGE_HEADER 64 /* leave enough space */
|
||||
#define MAX_TRANSFER_LENGTH (CCNET_PACKET_MAX_PAYLOAD_LEN - MESSAGE_HEADER)
|
||||
|
||||
/*
|
||||
Client Server
|
||||
<xxx>-rpcserver
|
||||
---------------------->
|
||||
|
||||
200 OK
|
||||
<----------------------
|
||||
301 Func String
|
||||
---------------------->
|
||||
|
||||
312 HAS MORE
|
||||
<-----------------------
|
||||
302 MORE
|
||||
---------------------->
|
||||
311 SERVER RET
|
||||
<-----------------------
|
||||
*/
|
||||
|
||||
#endif
|
117
lib/rpcserver-proc.c
Normal file
117
lib/rpcserver-proc.c
Normal file
@ -0,0 +1,117 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
|
||||
#include "include.h"
|
||||
|
||||
#include <ccnet/processor.h>
|
||||
#include "rpcserver-proc.h"
|
||||
#include "searpc-server.h"
|
||||
#include "rpc-common.h"
|
||||
|
||||
typedef struct {
|
||||
char *buf;
|
||||
int len;
|
||||
int off;
|
||||
} CcnetRpcserverProcPriv;
|
||||
|
||||
#define GET_PRIV(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((o), CCNET_TYPE_RPCSERVER_PROC, CcnetRpcserverProcPriv))
|
||||
|
||||
G_DEFINE_TYPE (CcnetRpcserverProc, ccnet_rpcserver_proc, CCNET_TYPE_PROCESSOR)
|
||||
|
||||
static int start (CcnetProcessor *processor, int argc, char **argv);
|
||||
static void handle_update (CcnetProcessor *processor,
|
||||
char *code, char *code_msg,
|
||||
char *content, int clen);
|
||||
|
||||
static void
|
||||
release_resource(CcnetProcessor *processor)
|
||||
{
|
||||
CCNET_PROCESSOR_CLASS (ccnet_rpcserver_proc_parent_class)->release_resource (processor);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
ccnet_rpcserver_proc_class_init (CcnetRpcserverProcClass *klass)
|
||||
{
|
||||
CcnetProcessorClass *proc_class = CCNET_PROCESSOR_CLASS (klass);
|
||||
|
||||
proc_class->start = start;
|
||||
proc_class->handle_update = handle_update;
|
||||
proc_class->release_resource = release_resource;
|
||||
proc_class->name = "rpcserver-proc";
|
||||
|
||||
g_type_class_add_private (klass, sizeof(CcnetRpcserverProcPriv));
|
||||
}
|
||||
|
||||
static void
|
||||
ccnet_rpcserver_proc_init (CcnetRpcserverProc *processor)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
start (CcnetProcessor *processor, int argc, char **argv)
|
||||
{
|
||||
ccnet_processor_send_response (processor, SC_OK, SS_OK, NULL, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
handle_update (CcnetProcessor *processor,
|
||||
char *code, char *code_msg,
|
||||
char *content, int clen)
|
||||
{
|
||||
CcnetRpcserverProcPriv *priv = GET_PRIV (processor);
|
||||
|
||||
if (memcmp (code, SC_CLIENT_CALL, 3) == 0) {
|
||||
gsize ret_len;
|
||||
char *svc_name = processor->name;
|
||||
char *ret = searpc_server_call_function (svc_name, content, clen, &ret_len);
|
||||
|
||||
g_assert (ret != NULL);
|
||||
if (ret_len < MAX_TRANSFER_LENGTH) {
|
||||
ccnet_processor_send_response (
|
||||
processor, SC_SERVER_RET, SS_SERVER_RET, ret, ret_len + 1);
|
||||
g_free (ret);
|
||||
/* ccnet_processor_done (processor, TRUE); */
|
||||
return;
|
||||
}
|
||||
|
||||
/* we need to split data into multiple segments */
|
||||
priv->buf = ret;
|
||||
priv->len = ret_len + 1; /* include trailing '\0' */
|
||||
priv->off = 0;
|
||||
|
||||
ccnet_processor_send_response (processor, SC_SERVER_MORE,
|
||||
SS_SERVER_MORE, priv->buf,
|
||||
MAX_TRANSFER_LENGTH);
|
||||
priv->off = MAX_TRANSFER_LENGTH;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (memcmp (code, SC_CLIENT_MORE, 3) == 0) {
|
||||
if (priv->off + MAX_TRANSFER_LENGTH < priv->len) {
|
||||
ccnet_processor_send_response (
|
||||
processor, SC_SERVER_MORE, SS_SERVER_MORE,
|
||||
priv->buf + priv->off, MAX_TRANSFER_LENGTH);
|
||||
priv->off += MAX_TRANSFER_LENGTH;
|
||||
} else {
|
||||
ccnet_processor_send_response (
|
||||
processor, SC_SERVER_RET, SS_SERVER_RET,
|
||||
priv->buf + priv->off, priv->len - priv->off);
|
||||
g_free (priv->buf);
|
||||
/* ccnet_processor_done (processor, TRUE); */
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
ccnet_processor_send_response (processor, SC_BAD_UPDATE_CODE,
|
||||
SS_BAD_UPDATE_CODE, NULL, 0);
|
||||
g_warning ("[rpc-server] Bad update: %s %s.\n", code, code_msg);
|
||||
if (priv->buf)
|
||||
g_free (priv->buf);
|
||||
ccnet_processor_done (processor, FALSE);
|
||||
}
|
30
lib/rpcserver-proc.h
Normal file
30
lib/rpcserver-proc.h
Normal file
@ -0,0 +1,30 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
|
||||
#ifndef CCNET_RPCSERVER_PROC_H
|
||||
#define CCNET_RPCSERVER_PROC_H
|
||||
|
||||
#include <glib-object.h>
|
||||
|
||||
|
||||
#define CCNET_TYPE_RPCSERVER_PROC (ccnet_rpcserver_proc_get_type ())
|
||||
#define CCNET_RPCSERVER_PROC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CCNET_TYPE_RPCSERVER_PROC, CcnetRpcserverProc))
|
||||
#define CCNET_IS_RPCSERVER_PROC(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CCNET_TYPE_RPCSERVER_PROC))
|
||||
#define CCNET_RPCSERVER_PROC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CCNET_TYPE_RPCSERVER_PROC, CcnetRpcserverProcClass))
|
||||
#define IS_CCNET_RPCSERVER_PROC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CCNET_TYPE_RPCSERVER_PROC))
|
||||
#define CCNET_RPCSERVER_PROC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CCNET_TYPE_RPCSERVER_PROC, CcnetRpcserverProcClass))
|
||||
|
||||
typedef struct _CcnetRpcserverProc CcnetRpcserverProc;
|
||||
typedef struct _CcnetRpcserverProcClass CcnetRpcserverProcClass;
|
||||
|
||||
struct _CcnetRpcserverProc {
|
||||
CcnetProcessor parent_instance;
|
||||
};
|
||||
|
||||
struct _CcnetRpcserverProcClass {
|
||||
CcnetProcessorClass parent_class;
|
||||
};
|
||||
|
||||
GType ccnet_rpcserver_proc_get_type ();
|
||||
|
||||
#endif
|
||||
|
161
lib/rsa.c
Normal file
161
lib/rsa.c
Normal file
@ -0,0 +1,161 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/rand.h>
|
||||
#include <openssl/rsa.h>
|
||||
#include <openssl/err.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <glib.h>
|
||||
|
||||
#include "rsa.h"
|
||||
#include "utils.h"
|
||||
|
||||
RSA*
|
||||
private_key_to_pub(RSA *priv)
|
||||
{
|
||||
RSA *pub = RSA_new();
|
||||
|
||||
pub->n = BN_dup(priv->n);
|
||||
pub->e = BN_dup(priv->e);
|
||||
|
||||
return pub;
|
||||
}
|
||||
|
||||
|
||||
GString* public_key_to_gstring(const RSA *rsa)
|
||||
{
|
||||
GString *buf = g_string_new(NULL);
|
||||
unsigned char *temp;
|
||||
char *coded;
|
||||
|
||||
gsize len = BN_num_bytes(rsa->n);
|
||||
temp = malloc(len);
|
||||
BN_bn2bin(rsa->n, temp);
|
||||
coded = g_base64_encode(temp, len);
|
||||
g_string_append (buf, coded);
|
||||
g_string_append_c (buf, ' ');
|
||||
g_free(coded);
|
||||
|
||||
len = BN_num_bytes(rsa->e);
|
||||
temp = realloc(temp, len);
|
||||
BN_bn2bin(rsa->e, temp);
|
||||
coded = g_base64_encode(temp, len);
|
||||
g_string_append (buf, coded);
|
||||
g_free(coded);
|
||||
|
||||
free(temp);
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
void
|
||||
public_key_append_to_gstring(const RSA *rsa, GString *buf)
|
||||
{
|
||||
unsigned char *temp;
|
||||
char *coded;
|
||||
|
||||
gsize len = BN_num_bytes(rsa->n);
|
||||
temp = malloc(len);
|
||||
BN_bn2bin(rsa->n, temp);
|
||||
coded = g_base64_encode(temp, len);
|
||||
g_string_append (buf, coded);
|
||||
g_string_append_c (buf, ' ');
|
||||
g_free(coded);
|
||||
|
||||
len = BN_num_bytes(rsa->e);
|
||||
temp = realloc(temp, len);
|
||||
BN_bn2bin(rsa->e, temp);
|
||||
coded = g_base64_encode(temp, len);
|
||||
g_string_append (buf, coded);
|
||||
g_free(coded);
|
||||
|
||||
free(temp);
|
||||
}
|
||||
|
||||
RSA* public_key_from_string(char *str)
|
||||
{
|
||||
char *p;
|
||||
unsigned char *num;
|
||||
gsize len;
|
||||
if (!str)
|
||||
return NULL;
|
||||
|
||||
if ( !(p = strchr(str, ' ')) )
|
||||
return NULL;
|
||||
*p = '\0';
|
||||
|
||||
RSA *key = RSA_new();
|
||||
|
||||
num = g_base64_decode(str, &len);
|
||||
key->n = BN_bin2bn(num, len, NULL);
|
||||
if (!key->n)
|
||||
goto err;
|
||||
g_free(num);
|
||||
|
||||
num = g_base64_decode(p+1, &len);
|
||||
key->e = BN_bin2bn(num, len, NULL);
|
||||
if (!key->e)
|
||||
goto err;
|
||||
g_free(num);
|
||||
|
||||
*p = ' ';
|
||||
return key;
|
||||
err:
|
||||
*p = ' ';
|
||||
RSA_free (key);
|
||||
g_free(num);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
unsigned char *
|
||||
private_key_decrypt(RSA *key, unsigned char *data, int len, int *decrypt_len)
|
||||
{
|
||||
int size;
|
||||
unsigned char *buf;
|
||||
|
||||
size = RSA_size(key);
|
||||
buf = g_malloc(size);
|
||||
*decrypt_len = RSA_private_decrypt(len, data, buf, key, RSA_PKCS1_PADDING);
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
unsigned char *
|
||||
public_key_encrypt(RSA *key, unsigned char *data, int len, int *encrypt_len)
|
||||
{
|
||||
int size;
|
||||
unsigned char *buf;
|
||||
|
||||
size = RSA_size(key);
|
||||
buf = g_malloc(size);
|
||||
*encrypt_len = RSA_public_encrypt(len, data, buf, key, RSA_PKCS1_PADDING);
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
char *
|
||||
id_from_pubkey (RSA *pubkey)
|
||||
{
|
||||
GString *buf;
|
||||
unsigned char sha1[20];
|
||||
char *id = g_malloc(41);
|
||||
|
||||
buf = public_key_to_gstring (pubkey);
|
||||
calculate_sha1 (sha1, buf->str);
|
||||
sha1_to_hex (sha1, id);
|
||||
g_string_free (buf, TRUE);
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
RSA *
|
||||
generate_private_key(u_int bits)
|
||||
{
|
||||
RSA *private = NULL;
|
||||
|
||||
private = RSA_generate_key(bits, 35, NULL, NULL);
|
||||
if (private == NULL)
|
||||
g_error ("rsa_generate_private_key: key generation failed.");
|
||||
return private;
|
||||
}
|
31
lib/rsa.h
Normal file
31
lib/rsa.h
Normal file
@ -0,0 +1,31 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
|
||||
#ifndef CCNET_RSA_H
|
||||
#define CCNET_RSA_H
|
||||
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/rand.h>
|
||||
#include <openssl/rsa.h>
|
||||
#include <openssl/err.h>
|
||||
|
||||
|
||||
RSA* private_key_to_pub(RSA *priv);
|
||||
|
||||
GString* public_key_to_gstring(const RSA *rsa);
|
||||
void public_key_append_to_gstring(const RSA *rsa, GString *buf);
|
||||
|
||||
RSA* public_key_from_string(char *str);
|
||||
|
||||
unsigned char* private_key_decrypt(RSA *key, unsigned char *data,
|
||||
int len, int *decrypt_len);
|
||||
|
||||
unsigned char* public_key_encrypt(RSA *key, unsigned char *data,
|
||||
int len, int *encrypt_len);
|
||||
|
||||
|
||||
char *id_from_pubkey (RSA *pubkey);
|
||||
|
||||
RSA* generate_private_key(u_int bits);
|
||||
|
||||
|
||||
#endif
|
148
lib/threaded-rpcserver-proc.c
Normal file
148
lib/threaded-rpcserver-proc.c
Normal file
@ -0,0 +1,148 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
|
||||
#include "include.h"
|
||||
|
||||
#include <ccnet/ccnet-client.h>
|
||||
#include <ccnet/processor.h>
|
||||
#include <ccnet/job-mgr.h>
|
||||
#include "threaded-rpcserver-proc.h"
|
||||
#include "searpc-server.h"
|
||||
#include "rpc-common.h"
|
||||
|
||||
typedef struct {
|
||||
char *call_buf;
|
||||
gsize call_len;
|
||||
char *buf;
|
||||
gsize len;
|
||||
int off;
|
||||
char *error_message;
|
||||
} CcnetThreadedRpcserverProcPriv;
|
||||
|
||||
#define GET_PRIV(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((o), CCNET_TYPE_THREADED_RPCSERVER_PROC, CcnetThreadedRpcserverProcPriv))
|
||||
|
||||
G_DEFINE_TYPE (CcnetThreadedRpcserverProc, ccnet_threaded_rpcserver_proc, CCNET_TYPE_PROCESSOR)
|
||||
|
||||
static int start (CcnetProcessor *processor, int argc, char **argv);
|
||||
static void handle_update (CcnetProcessor *processor,
|
||||
char *code, char *code_msg,
|
||||
char *content, int clen);
|
||||
|
||||
static void
|
||||
release_resource(CcnetProcessor *processor)
|
||||
{
|
||||
CCNET_PROCESSOR_CLASS (ccnet_threaded_rpcserver_proc_parent_class)->release_resource (processor);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
ccnet_threaded_rpcserver_proc_class_init (CcnetThreadedRpcserverProcClass *klass)
|
||||
{
|
||||
CcnetProcessorClass *proc_class = CCNET_PROCESSOR_CLASS (klass);
|
||||
|
||||
proc_class->start = start;
|
||||
proc_class->handle_update = handle_update;
|
||||
proc_class->release_resource = release_resource;
|
||||
proc_class->name = "threaded-rpcserver-proc";
|
||||
|
||||
g_type_class_add_private (klass, sizeof(CcnetThreadedRpcserverProcPriv));
|
||||
}
|
||||
|
||||
static void
|
||||
ccnet_threaded_rpcserver_proc_init (CcnetThreadedRpcserverProc *processor)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
start (CcnetProcessor *processor, int argc, char **argv)
|
||||
{
|
||||
ccnet_processor_send_response (processor, SC_OK, SS_OK, NULL, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void *
|
||||
call_function_job (void *vprocessor)
|
||||
{
|
||||
CcnetProcessor *processor = vprocessor;
|
||||
CcnetThreadedRpcserverProcPriv *priv = GET_PRIV(processor);
|
||||
char *svc_name = processor->name;
|
||||
|
||||
priv->buf = searpc_server_call_function (svc_name, priv->call_buf, priv->call_len,
|
||||
&priv->len);
|
||||
g_free (priv->call_buf);
|
||||
|
||||
return vprocessor;
|
||||
}
|
||||
|
||||
static void
|
||||
call_function_done (void *vprocessor)
|
||||
{
|
||||
CcnetProcessor *processor = vprocessor;
|
||||
CcnetThreadedRpcserverProcPriv *priv = GET_PRIV(processor);
|
||||
|
||||
if (priv->buf) {
|
||||
if (priv->len < MAX_TRANSFER_LENGTH) {
|
||||
ccnet_processor_send_response (processor, SC_SERVER_RET, SS_SERVER_RET,
|
||||
priv->buf, priv->len + 1);
|
||||
g_free (priv->buf);
|
||||
/* ccnet_processor_done (processor, TRUE); */
|
||||
return;
|
||||
}
|
||||
|
||||
/* we need to split data into multiple segments */
|
||||
ccnet_processor_send_response (processor, SC_SERVER_MORE,
|
||||
SS_SERVER_MORE, priv->buf,
|
||||
MAX_TRANSFER_LENGTH);
|
||||
priv->off = MAX_TRANSFER_LENGTH;
|
||||
} else {
|
||||
char *message = priv->error_message ? priv->error_message : "";
|
||||
ccnet_processor_send_response (processor, SC_SERVER_ERR,
|
||||
message,
|
||||
NULL, 0);
|
||||
g_free (priv->error_message);
|
||||
ccnet_processor_done (processor, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
handle_update (CcnetProcessor *processor,
|
||||
char *code, char *code_msg,
|
||||
char *content, int clen)
|
||||
{
|
||||
CcnetThreadedRpcserverProcPriv *priv = GET_PRIV (processor);
|
||||
|
||||
if (memcmp (code, SC_CLIENT_CALL, 3) == 0) {
|
||||
priv->call_buf = g_memdup (content, clen);
|
||||
priv->call_len = (gsize)clen;
|
||||
ccnet_job_manager_schedule_job (processor->session->job_mgr,
|
||||
call_function_job,
|
||||
call_function_done,
|
||||
processor);
|
||||
return;
|
||||
}
|
||||
|
||||
if (memcmp (code, SC_CLIENT_MORE, 3) == 0) {
|
||||
if (priv->off + MAX_TRANSFER_LENGTH < priv->len) {
|
||||
ccnet_processor_send_response (
|
||||
processor, SC_SERVER_MORE, SS_SERVER_MORE,
|
||||
priv->buf + priv->off, MAX_TRANSFER_LENGTH);
|
||||
priv->off += MAX_TRANSFER_LENGTH;
|
||||
} else {
|
||||
ccnet_processor_send_response (
|
||||
processor, SC_SERVER_RET, SS_SERVER_RET,
|
||||
priv->buf + priv->off, priv->len - priv->off);
|
||||
g_free (priv->buf);
|
||||
/* ccnet_processor_done (processor, TRUE); */
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
ccnet_processor_send_response (processor, SC_BAD_UPDATE_CODE,
|
||||
SS_BAD_UPDATE_CODE, NULL, 0);
|
||||
g_warning ("[rpc-server] Bad update: %s %s.\n", code, code_msg);
|
||||
if (priv->buf)
|
||||
g_free (priv->buf);
|
||||
ccnet_processor_done (processor, FALSE);
|
||||
}
|
30
lib/threaded-rpcserver-proc.h
Normal file
30
lib/threaded-rpcserver-proc.h
Normal file
@ -0,0 +1,30 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
|
||||
#ifndef CCNET_THREADED_RPCSERVER_PROC_H
|
||||
#define CCNET_THREADED_RPCSERVER_PROC_H
|
||||
|
||||
#include <glib-object.h>
|
||||
|
||||
|
||||
#define CCNET_TYPE_THREADED_RPCSERVER_PROC (ccnet_threaded_rpcserver_proc_get_type ())
|
||||
#define CCNET_THREADED_RPCSERVER_PROC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CCNET_TYPE_THREADED_RPCSERVER_PROC, CcnetThreadedRpcserverProc))
|
||||
#define CCNET_IS_THREADED_RPCSERVER_PROC(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CCNET_TYPE_THREADED_RPCSERVER_PROC))
|
||||
#define CCNET_THREADED_RPCSERVER_PROC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CCNET_TYPE_THREADED_RPCSERVER_PROC, CcnetThreadedRpcserverProcClass))
|
||||
#define IS_CCNET_THREADED_RPCSERVER_PROC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CCNET_TYPE_THREADED_RPCSERVER_PROC))
|
||||
#define CCNET_THREADED_RPCSERVER_PROC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CCNET_TYPE_THREADED_RPCSERVER_PROC, CcnetThreadedRpcserverProcClass))
|
||||
|
||||
typedef struct _CcnetThreadedRpcserverProc CcnetThreadedRpcserverProc;
|
||||
typedef struct _CcnetThreadedRpcserverProcClass CcnetThreadedRpcserverProcClass;
|
||||
|
||||
struct _CcnetThreadedRpcserverProc {
|
||||
CcnetProcessor parent_instance;
|
||||
};
|
||||
|
||||
struct _CcnetThreadedRpcserverProcClass {
|
||||
CcnetProcessorClass parent_class;
|
||||
};
|
||||
|
||||
GType ccnet_threaded_rpcserver_proc_get_type ();
|
||||
|
||||
#endif
|
||||
|
1645
lib/utils.c
Normal file
1645
lib/utils.c
Normal file
File diff suppressed because it is too large
Load Diff
327
lib/utils.h
Normal file
327
lib/utils.h
Normal file
@ -0,0 +1,327 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
|
||||
#ifndef CCNET_UTILS_H
|
||||
#define CCNET_UTILS_H
|
||||
|
||||
#if !defined(_)
|
||||
#if defined(HAVE_LIBINTL_H)
|
||||
#include <libintl.h>
|
||||
#define _(a) gettext (a)
|
||||
#else
|
||||
#define _(a) (a)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <sys/time.h>
|
||||
#include <stdint.h>
|
||||
#include <unistd.h>
|
||||
#include <stdarg.h>
|
||||
#include <glib.h>
|
||||
#include <glib-object.h>
|
||||
#include <stdlib.h>
|
||||
#include <evutil.h>
|
||||
|
||||
#ifdef WIN32
|
||||
#include <errno.h>
|
||||
#include <glib/gstdio.h>
|
||||
|
||||
#ifndef WEXITSTATUS
|
||||
#define WEXITSTATUS(status) (((status) & 0xff00) >> 8)
|
||||
#endif
|
||||
|
||||
/* Borrowed from libevent */
|
||||
#define ccnet_pipe_t intptr_t
|
||||
|
||||
int pgpipe (ccnet_pipe_t handles[2]);
|
||||
#define ccnet_mkdir(a,b) g_mkdir((a),(b))
|
||||
#define ccnet_pipe(a) pgpipe((a))
|
||||
#define piperead(a,b,c) recv((a),(b),(c),0)
|
||||
#define pipewrite(a,b,c) send((a),(b),(c),0)
|
||||
#define pipeclose(a) closesocket((a))
|
||||
|
||||
static inline int ccnet_rename(const char *oldfile, const char *newfile)
|
||||
{
|
||||
int ret = g_rename (oldfile, newfile);
|
||||
if (ret < 0) {
|
||||
if (errno != EEXIST)
|
||||
return -1;
|
||||
|
||||
ret = g_unlink(oldfile);
|
||||
|
||||
if (ret < 0) {
|
||||
g_warning("ccnet_rename failed because g_unlink failed\n");
|
||||
return -1;
|
||||
}
|
||||
return g_rename(oldfile, newfile);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
|
||||
#define ccnet_pipe_t int
|
||||
|
||||
#define ccnet_mkdir(a,b) g_mkdir((a),(b))
|
||||
#define ccnet_pipe(a) pipe((a))
|
||||
#define piperead(a,b,c) read((a),(b),(c))
|
||||
#define pipewrite(a,b,c) write((a),(b),(c))
|
||||
#define pipeclose(a) close((a))
|
||||
#define ccnet_rename g_rename
|
||||
#endif
|
||||
|
||||
#define pipereadn(a,b,c) recvn((a),(b),(c))
|
||||
#define pipewriten(a,b,c) sendn((a),(b),(c))
|
||||
|
||||
#ifndef O_BINARY
|
||||
#define O_BINARY 0
|
||||
#endif
|
||||
|
||||
/* for debug */
|
||||
#ifndef ccnet_warning
|
||||
#define ccnet_warning(fmt, ...) g_warning("%s(%d): " fmt, __FILE__, __LINE__, ##__VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#ifndef ccnet_error
|
||||
#define ccnet_error(fmt, ...) g_error("%s(%d): " fmt, __FILE__, __LINE__, ##__VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#ifndef ccnet_message
|
||||
#define ccnet_message(fmt, ...) g_message("%s(%d): " fmt, __FILE__, __LINE__, ##__VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#define CCNET_DOMAIN g_quark_from_string("ccnet")
|
||||
|
||||
|
||||
struct timeval timeval_from_msec (uint64_t milliseconds);
|
||||
|
||||
|
||||
size_t ccnet_strlcpy (char *dst, const char *src, size_t size);
|
||||
|
||||
void rawdata_to_hex (const unsigned char *rawdata, char *hex_str, int n_bytes);
|
||||
int hex_to_rawdata (const char *hex_str, unsigned char *rawdata, int n_bytes);
|
||||
|
||||
#define sha1_to_hex(sha1, hex) rawdata_to_hex((sha1), (hex), 20)
|
||||
#define hex_to_sha1(hex, sha1) hex_to_rawdata((hex), (sha1), 20)
|
||||
|
||||
int calculate_sha1 (unsigned char *sha1, const char *msg);
|
||||
int ccnet_sha1_equal (const void *v1, const void *v2);
|
||||
unsigned int ccnet_sha1_hash (const void *v);
|
||||
|
||||
char* gen_uuid ();
|
||||
void gen_uuid_inplace (char *buf);
|
||||
gboolean is_uuid_valid (const char *uuid_str);
|
||||
|
||||
|
||||
/* dir operations */
|
||||
int checkdir (const char *dir);
|
||||
int checkdir_with_mkdir (const char *path);
|
||||
char* ccnet_expand_path (const char *src);
|
||||
|
||||
/**
|
||||
* Make directory with 256 sub-directories from '00' to 'ff'.
|
||||
* `base` and subdir will be created if they are not existing.
|
||||
*/
|
||||
int objstore_mkdir (const char *base);
|
||||
void objstore_get_path (char *path, const char *base, const char *obj_id);
|
||||
|
||||
|
||||
char** strsplit_by_space (char *string, int *length);
|
||||
|
||||
/* Read "n" bytes from a descriptor. */
|
||||
ssize_t readn(int fd, void *vptr, size_t n);
|
||||
ssize_t writen(int fd, const void *vptr, size_t n);
|
||||
|
||||
/* Read "n" bytes from a socket. */
|
||||
ssize_t recvn(evutil_socket_t fd, void *vptr, size_t n);
|
||||
ssize_t sendn(evutil_socket_t fd, const void *vptr, size_t n);
|
||||
|
||||
int copy_fd (int ifd, int ofd);
|
||||
int copy_file (const char *dst, const char *src, int mode);
|
||||
|
||||
|
||||
/* string utilities */
|
||||
|
||||
char** strsplit_by_char (char *string, int *length, char c);
|
||||
|
||||
char * strjoin_n (const char *seperator, int argc, char **argv);
|
||||
|
||||
int is_ipaddr_valid (const char *ip);
|
||||
|
||||
typedef void (*KeyValueFunc) (void *data, const char *key, char *value);
|
||||
void parse_key_value_pairs (char *string, KeyValueFunc func, void *data);
|
||||
|
||||
typedef gboolean (*KeyValueFunc2) (void *data, const char *key,
|
||||
const char *value);
|
||||
void parse_key_value_pairs2 (char *string, KeyValueFunc2 func, void *data);
|
||||
|
||||
gchar* ccnet_key_file_get_string (GKeyFile *keyf,
|
||||
const char *category,
|
||||
const char *key);
|
||||
|
||||
|
||||
GList *string_list_append (GList *str_list, const char *string);
|
||||
GList *string_list_append_sorted (GList *str_list, const char *string);
|
||||
GList *string_list_remove (GList *str_list, const char *string);
|
||||
void string_list_free (GList *str_list);
|
||||
gboolean string_list_is_exists (GList *str_list, const char *string);
|
||||
void string_list_join (GList *str_list, GString *strbuf, const char *seperator);
|
||||
GList *string_list_parse (const char *list_in_str, const char *seperator);
|
||||
GList *string_list_parse_sorted (const char *list_in_str, const char *seperator);
|
||||
gboolean string_list_sorted_is_equal (GList *list1, GList *list2);
|
||||
|
||||
char** ncopy_string_array (char **orig, int n);
|
||||
void nfree_string_array (char **array, int n);
|
||||
|
||||
|
||||
gchar *
|
||||
key_value_list_to_json(const char *first, ...) G_GNUC_NULL_TERMINATED;
|
||||
|
||||
gchar *
|
||||
key_value_list_to_json_v(const char *first, va_list args);
|
||||
|
||||
/* format char:
|
||||
i integer (gint64)
|
||||
s string (const char *) or NULL
|
||||
*/
|
||||
gchar *
|
||||
json_printf(const char *format, ...);
|
||||
|
||||
gchar *
|
||||
json_vprintf(const char *format, va_list args);
|
||||
|
||||
|
||||
/* 64bit time */
|
||||
gint64 get_current_time();
|
||||
|
||||
int
|
||||
ccnet_encrypt (char **data_out,
|
||||
int *out_len,
|
||||
const char *data_in,
|
||||
const int in_len,
|
||||
const char *code,
|
||||
const int code_len);
|
||||
|
||||
|
||||
int
|
||||
ccnet_decrypt (char **data_out,
|
||||
int *out_len,
|
||||
const char *data_in,
|
||||
const int in_len,
|
||||
const char *code,
|
||||
const int code_len);
|
||||
|
||||
|
||||
/*
|
||||
* Utility functions for converting data to/from network byte order.
|
||||
*/
|
||||
|
||||
static inline uint64_t
|
||||
hton64(uint64_t val)
|
||||
{
|
||||
uint64_t ret;
|
||||
uint8_t *ptr = (uint8_t *)&ret;
|
||||
|
||||
ptr[0]=((val)>>56)&0xFF;
|
||||
ptr[1]=((val)>>48)&0xFF;
|
||||
ptr[2]=((val)>>40)&0xFF;
|
||||
ptr[3]=((val)>>32)&0xFF;
|
||||
ptr[4]=((val)>>24)&0xFF;
|
||||
ptr[5]=((val)>>16)&0xFF;
|
||||
ptr[6]=((val)>>8)&0xFF;
|
||||
ptr[7]=(val)&0xFF;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline uint64_t
|
||||
ntoh64(uint64_t val)
|
||||
{
|
||||
uint64_t t64;
|
||||
uint8_t *ptr = (uint8_t *)&val;
|
||||
|
||||
t64=(ptr[3]+256*(ptr[2]+256*(ptr[1]+256*ptr[0])));
|
||||
t64<<=32;
|
||||
t64|=((ptr[7]+256*(ptr[6]+256*(ptr[5]+256*ptr[4]))))&0xffffffffU;
|
||||
|
||||
return t64;
|
||||
}
|
||||
|
||||
static inline void put64bit(uint8_t **ptr,uint64_t val) {
|
||||
(*ptr)[0]=((val)>>56)&0xFF;
|
||||
(*ptr)[1]=((val)>>48)&0xFF;
|
||||
(*ptr)[2]=((val)>>40)&0xFF;
|
||||
(*ptr)[3]=((val)>>32)&0xFF;
|
||||
(*ptr)[4]=((val)>>24)&0xFF;
|
||||
(*ptr)[5]=((val)>>16)&0xFF;
|
||||
(*ptr)[6]=((val)>>8)&0xFF;
|
||||
(*ptr)[7]=(val)&0xFF;
|
||||
(*ptr)+=8;
|
||||
}
|
||||
|
||||
static inline void put32bit(uint8_t **ptr,uint32_t val) {
|
||||
(*ptr)[0]=((val)>>24)&0xFF;
|
||||
(*ptr)[1]=((val)>>16)&0xFF;
|
||||
(*ptr)[2]=((val)>>8)&0xFF;
|
||||
(*ptr)[3]=(val)&0xFF;
|
||||
(*ptr)+=4;
|
||||
}
|
||||
|
||||
static inline void put16bit(uint8_t **ptr,uint16_t val) {
|
||||
(*ptr)[0]=((val)>>8)&0xFF;
|
||||
(*ptr)[1]=(val)&0xFF;
|
||||
(*ptr)+=2;
|
||||
}
|
||||
|
||||
static inline void put8bit(uint8_t **ptr,uint8_t val) {
|
||||
(*ptr)[0]=(val)&0xFF;
|
||||
(*ptr)++;
|
||||
}
|
||||
|
||||
static inline uint64_t get64bit(const uint8_t **ptr) {
|
||||
uint64_t t64;
|
||||
t64=((*ptr)[3]+256*((*ptr)[2]+256*((*ptr)[1]+256*(*ptr)[0])));
|
||||
t64<<=32;
|
||||
t64|=(((*ptr)[7]+256*((*ptr)[6]+256*((*ptr)[5]+256*(*ptr)[4]))))&0xffffffffU;
|
||||
(*ptr)+=8;
|
||||
return t64;
|
||||
}
|
||||
|
||||
static inline uint32_t get32bit(const uint8_t **ptr) {
|
||||
uint32_t t32;
|
||||
t32=((*ptr)[3]+256*((*ptr)[2]+256*((*ptr)[1]+256*(*ptr)[0])));
|
||||
(*ptr)+=4;
|
||||
return t32;
|
||||
}
|
||||
|
||||
static inline uint16_t get16bit(const uint8_t **ptr) {
|
||||
uint32_t t16;
|
||||
t16=(*ptr)[1]+256*(*ptr)[0];
|
||||
(*ptr)+=2;
|
||||
return t16;
|
||||
}
|
||||
|
||||
static inline uint8_t get8bit(const uint8_t **ptr) {
|
||||
uint32_t t8;
|
||||
t8=(*ptr)[0];
|
||||
(*ptr)++;
|
||||
return t8;
|
||||
}
|
||||
|
||||
/* Convert between local encoding and utf8. Returns the converted
|
||||
* string if success, otherwise return NULL
|
||||
*/
|
||||
char *ccnet_locale_from_utf8 (const gchar *src);
|
||||
char *ccnet_locale_to_utf8 (const gchar *src);
|
||||
|
||||
/* Detect whether a process with the given name is running right now. */
|
||||
gboolean process_is_running(const char *name);
|
||||
|
||||
#ifdef WIN32
|
||||
int win32_kill_process (const char *process_name_in);
|
||||
int win32_spawn_process (char *cmd, char *wd);
|
||||
#endif
|
||||
|
||||
char* ccnet_object_type_from_id (const char *object_id);
|
||||
|
||||
gint64 ccnet_calc_directory_size (const char *path, GError **error);
|
||||
|
||||
#endif
|
237
m4/intltool.m4
237
m4/intltool.m4
@ -1,237 +0,0 @@
|
||||
## intltool.m4 - Configure intltool for the target system. -*-Shell-script-*-
|
||||
## Copyright (C) 2001 Eazel, Inc.
|
||||
## Author: Maciej Stachowiak <mjs@noisehavoc.org>
|
||||
## Kenneth Christiansen <kenneth@gnu.org>
|
||||
##
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; either version 2 of the License, or
|
||||
## (at your option) any later version.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful, but
|
||||
## WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
## General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, write to the Free Software
|
||||
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
##
|
||||
## As a special exception to the GNU General Public License, if you
|
||||
## distribute this file as part of a program that contains a
|
||||
## configuration script generated by Autoconf, you may include it under
|
||||
## the same distribution terms that you use for the rest of that program.
|
||||
|
||||
dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml])
|
||||
# serial 42 IT_PROG_INTLTOOL
|
||||
AC_DEFUN([IT_PROG_INTLTOOL], [
|
||||
AC_PREREQ([2.50])dnl
|
||||
AC_REQUIRE([AM_NLS])dnl
|
||||
|
||||
case "$am__api_version" in
|
||||
1.[01234])
|
||||
AC_MSG_ERROR([Automake 1.5 or newer is required to use intltool])
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
|
||||
INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3`
|
||||
INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
|
||||
if test -n "$1"; then
|
||||
AC_MSG_CHECKING([for intltool >= $1])
|
||||
AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found])
|
||||
test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" ||
|
||||
AC_MSG_ERROR([Your intltool is too old. You need intltool $1 or later.])
|
||||
fi
|
||||
|
||||
AC_PATH_PROG(INTLTOOL_UPDATE, [intltool-update])
|
||||
AC_PATH_PROG(INTLTOOL_MERGE, [intltool-merge])
|
||||
AC_PATH_PROG(INTLTOOL_EXTRACT, [intltool-extract])
|
||||
if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then
|
||||
AC_MSG_ERROR([The intltool scripts were not found. Please install intltool.])
|
||||
fi
|
||||
|
||||
if test -z "$AM_DEFAULT_VERBOSITY"; then
|
||||
AM_DEFAULT_VERBOSITY=1
|
||||
fi
|
||||
AC_SUBST([AM_DEFAULT_VERBOSITY])
|
||||
|
||||
INTLTOOL_V_MERGE='$(INTLTOOL__v_MERGE_$(V))'
|
||||
INTLTOOL__v_MERGE_='$(INTLTOOL__v_MERGE_$(AM_DEFAULT_VERBOSITY))'
|
||||
INTLTOOL__v_MERGE_0='@echo " ITMRG " [$]@;'
|
||||
AC_SUBST(INTLTOOL_V_MERGE)
|
||||
AC_SUBST(INTLTOOL__v_MERGE_)
|
||||
AC_SUBST(INTLTOOL__v_MERGE_0)
|
||||
|
||||
INTLTOOL_V_MERGE_OPTIONS='$(intltool__v_merge_options_$(V))'
|
||||
intltool__v_merge_options_='$(intltool__v_merge_options_$(AM_DEFAULT_VERBOSITY))'
|
||||
intltool__v_merge_options_0='-q'
|
||||
AC_SUBST(INTLTOOL_V_MERGE_OPTIONS)
|
||||
AC_SUBST(intltool__v_merge_options_)
|
||||
AC_SUBST(intltool__v_merge_options_0)
|
||||
|
||||
INTLTOOL_DESKTOP_RULE='%.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
||||
INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
||||
INTLTOOL_KEYS_RULE='%.keys: %.keys.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
||||
INTLTOOL_PROP_RULE='%.prop: %.prop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
||||
INTLTOOL_OAF_RULE='%.oaf: %.oaf.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -o -p $(top_srcdir)/po $< [$]@'
|
||||
INTLTOOL_PONG_RULE='%.pong: %.pong.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
||||
INTLTOOL_SERVER_RULE='%.server: %.server.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -o -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
||||
INTLTOOL_SHEET_RULE='%.sheet: %.sheet.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
||||
INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
||||
INTLTOOL_UI_RULE='%.ui: %.ui.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
||||
INTLTOOL_XML_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
||||
if test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge 5000; then
|
||||
INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u --no-translations $< [$]@'
|
||||
else
|
||||
INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; $(INTLTOOL_V_MERGE)_it_tmp_dir=tmp.intltool.[$][$]RANDOM && mkdir [$][$]_it_tmp_dir && LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u [$][$]_it_tmp_dir $< [$]@ && rmdir [$][$]_it_tmp_dir'
|
||||
fi
|
||||
INTLTOOL_XAM_RULE='%.xam: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
||||
INTLTOOL_KBD_RULE='%.kbd: %.kbd.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -m -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
||||
INTLTOOL_CAVES_RULE='%.caves: %.caves.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
||||
INTLTOOL_SCHEMAS_RULE='%.schemas: %.schemas.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
||||
INTLTOOL_THEME_RULE='%.theme: %.theme.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
||||
INTLTOOL_SERVICE_RULE='%.service: %.service.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
||||
INTLTOOL_POLICY_RULE='%.policy: %.policy.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
||||
|
||||
_IT_SUBST(INTLTOOL_DESKTOP_RULE)
|
||||
_IT_SUBST(INTLTOOL_DIRECTORY_RULE)
|
||||
_IT_SUBST(INTLTOOL_KEYS_RULE)
|
||||
_IT_SUBST(INTLTOOL_PROP_RULE)
|
||||
_IT_SUBST(INTLTOOL_OAF_RULE)
|
||||
_IT_SUBST(INTLTOOL_PONG_RULE)
|
||||
_IT_SUBST(INTLTOOL_SERVER_RULE)
|
||||
_IT_SUBST(INTLTOOL_SHEET_RULE)
|
||||
_IT_SUBST(INTLTOOL_SOUNDLIST_RULE)
|
||||
_IT_SUBST(INTLTOOL_UI_RULE)
|
||||
_IT_SUBST(INTLTOOL_XAM_RULE)
|
||||
_IT_SUBST(INTLTOOL_KBD_RULE)
|
||||
_IT_SUBST(INTLTOOL_XML_RULE)
|
||||
_IT_SUBST(INTLTOOL_XML_NOMERGE_RULE)
|
||||
_IT_SUBST(INTLTOOL_CAVES_RULE)
|
||||
_IT_SUBST(INTLTOOL_SCHEMAS_RULE)
|
||||
_IT_SUBST(INTLTOOL_THEME_RULE)
|
||||
_IT_SUBST(INTLTOOL_SERVICE_RULE)
|
||||
_IT_SUBST(INTLTOOL_POLICY_RULE)
|
||||
|
||||
# Check the gettext tools to make sure they are GNU
|
||||
AC_PATH_PROG(XGETTEXT, xgettext)
|
||||
AC_PATH_PROG(MSGMERGE, msgmerge)
|
||||
AC_PATH_PROG(MSGFMT, msgfmt)
|
||||
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
|
||||
if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then
|
||||
AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
|
||||
fi
|
||||
xgversion="`$XGETTEXT --version|grep '(GNU ' 2> /dev/null`"
|
||||
mmversion="`$MSGMERGE --version|grep '(GNU ' 2> /dev/null`"
|
||||
mfversion="`$MSGFMT --version|grep '(GNU ' 2> /dev/null`"
|
||||
if test -z "$xgversion" -o -z "$mmversion" -o -z "$mfversion"; then
|
||||
AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
|
||||
fi
|
||||
|
||||
AC_PATH_PROG(INTLTOOL_PERL, perl)
|
||||
if test -z "$INTLTOOL_PERL"; then
|
||||
AC_MSG_ERROR([perl not found])
|
||||
fi
|
||||
AC_MSG_CHECKING([for perl >= 5.8.1])
|
||||
$INTLTOOL_PERL -e "use 5.8.1;" > /dev/null 2>&1
|
||||
if test $? -ne 0; then
|
||||
AC_MSG_ERROR([perl 5.8.1 is required for intltool])
|
||||
else
|
||||
IT_PERL_VERSION=`$INTLTOOL_PERL -e "printf '%vd', $^V"`
|
||||
AC_MSG_RESULT([$IT_PERL_VERSION])
|
||||
fi
|
||||
if test "x$2" != "xno-xml"; then
|
||||
AC_MSG_CHECKING([for XML::Parser])
|
||||
if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then
|
||||
AC_MSG_RESULT([ok])
|
||||
else
|
||||
AC_MSG_ERROR([XML::Parser perl module is required for intltool])
|
||||
fi
|
||||
fi
|
||||
|
||||
# Substitute ALL_LINGUAS so we can use it in po/Makefile
|
||||
AC_SUBST(ALL_LINGUAS)
|
||||
|
||||
# Set DATADIRNAME correctly if it is not set yet
|
||||
# (copied from glib-gettext.m4)
|
||||
if test -z "$DATADIRNAME"; then
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM([[]],
|
||||
[[extern int _nl_msg_cat_cntr;
|
||||
return _nl_msg_cat_cntr]])],
|
||||
[DATADIRNAME=share],
|
||||
[case $host in
|
||||
*-*-solaris*)
|
||||
dnl On Solaris, if bind_textdomain_codeset is in libc,
|
||||
dnl GNU format message catalog is always supported,
|
||||
dnl since both are added to the libc all together.
|
||||
dnl Hence, we'd like to go with DATADIRNAME=share
|
||||
dnl in this case.
|
||||
AC_CHECK_FUNC(bind_textdomain_codeset,
|
||||
[DATADIRNAME=share], [DATADIRNAME=lib])
|
||||
;;
|
||||
*)
|
||||
[DATADIRNAME=lib]
|
||||
;;
|
||||
esac])
|
||||
fi
|
||||
AC_SUBST(DATADIRNAME)
|
||||
|
||||
IT_PO_SUBDIR([po])
|
||||
|
||||
])
|
||||
|
||||
|
||||
# IT_PO_SUBDIR(DIRNAME)
|
||||
# ---------------------
|
||||
# All po subdirs have to be declared with this macro; the subdir "po" is
|
||||
# declared by IT_PROG_INTLTOOL.
|
||||
#
|
||||
AC_DEFUN([IT_PO_SUBDIR],
|
||||
[AC_PREREQ([2.53])dnl We use ac_top_srcdir inside AC_CONFIG_COMMANDS.
|
||||
dnl
|
||||
dnl The following CONFIG_COMMANDS should be executed at the very end
|
||||
dnl of config.status.
|
||||
AC_CONFIG_COMMANDS_PRE([
|
||||
AC_CONFIG_COMMANDS([$1/stamp-it], [
|
||||
if [ ! grep "^# INTLTOOL_MAKEFILE$" "$1/Makefile.in" > /dev/null ]; then
|
||||
AC_MSG_ERROR([$1/Makefile.in.in was not created by intltoolize.])
|
||||
fi
|
||||
rm -f "$1/stamp-it" "$1/stamp-it.tmp" "$1/POTFILES" "$1/Makefile.tmp"
|
||||
>"$1/stamp-it.tmp"
|
||||
[sed '/^#/d
|
||||
s/^[[].*] *//
|
||||
/^[ ]*$/d
|
||||
'"s|^| $ac_top_srcdir/|" \
|
||||
"$srcdir/$1/POTFILES.in" | sed '$!s/$/ \\/' >"$1/POTFILES"
|
||||
]
|
||||
[sed '/^POTFILES =/,/[^\\]$/ {
|
||||
/^POTFILES =/!d
|
||||
r $1/POTFILES
|
||||
}
|
||||
' "$1/Makefile.in" >"$1/Makefile"]
|
||||
rm -f "$1/Makefile.tmp"
|
||||
mv "$1/stamp-it.tmp" "$1/stamp-it"
|
||||
])
|
||||
])dnl
|
||||
])
|
||||
|
||||
# _IT_SUBST(VARIABLE)
|
||||
# -------------------
|
||||
# Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST
|
||||
#
|
||||
AC_DEFUN([_IT_SUBST],
|
||||
[
|
||||
AC_SUBST([$1])
|
||||
m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])])
|
||||
]
|
||||
)
|
||||
|
||||
# deprecated macros
|
||||
AU_ALIAS([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL])
|
||||
# A hint is needed for aclocal from Automake <= 1.9.4:
|
||||
# AC_DEFUN([AC_PROG_INTLTOOL], ...)
|
||||
|
8001
m4/libtool.m4
vendored
8001
m4/libtool.m4
vendored
File diff suppressed because it is too large
Load Diff
384
m4/ltoptions.m4
vendored
384
m4/ltoptions.m4
vendored
@ -1,384 +0,0 @@
|
||||
# Helper functions for option handling. -*- Autoconf -*-
|
||||
#
|
||||
# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
|
||||
# Inc.
|
||||
# Written by Gary V. Vaughan, 2004
|
||||
#
|
||||
# This file is free software; the Free Software Foundation gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 7 ltoptions.m4
|
||||
|
||||
# This is to help aclocal find these macros, as it can't see m4_define.
|
||||
AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
|
||||
|
||||
|
||||
# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
|
||||
# ------------------------------------------
|
||||
m4_define([_LT_MANGLE_OPTION],
|
||||
[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
|
||||
|
||||
|
||||
# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
|
||||
# ---------------------------------------
|
||||
# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
|
||||
# matching handler defined, dispatch to it. Other OPTION-NAMEs are
|
||||
# saved as a flag.
|
||||
m4_define([_LT_SET_OPTION],
|
||||
[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
|
||||
m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
|
||||
_LT_MANGLE_DEFUN([$1], [$2]),
|
||||
[m4_warning([Unknown $1 option `$2'])])[]dnl
|
||||
])
|
||||
|
||||
|
||||
# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
|
||||
# ------------------------------------------------------------
|
||||
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
|
||||
m4_define([_LT_IF_OPTION],
|
||||
[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
|
||||
|
||||
|
||||
# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
|
||||
# -------------------------------------------------------
|
||||
# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
|
||||
# are set.
|
||||
m4_define([_LT_UNLESS_OPTIONS],
|
||||
[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
|
||||
[m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
|
||||
[m4_define([$0_found])])])[]dnl
|
||||
m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
|
||||
])[]dnl
|
||||
])
|
||||
|
||||
|
||||
# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
|
||||
# ----------------------------------------
|
||||
# OPTION-LIST is a space-separated list of Libtool options associated
|
||||
# with MACRO-NAME. If any OPTION has a matching handler declared with
|
||||
# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
|
||||
# the unknown option and exit.
|
||||
m4_defun([_LT_SET_OPTIONS],
|
||||
[# Set options
|
||||
m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
|
||||
[_LT_SET_OPTION([$1], _LT_Option)])
|
||||
|
||||
m4_if([$1],[LT_INIT],[
|
||||
dnl
|
||||
dnl Simply set some default values (i.e off) if boolean options were not
|
||||
dnl specified:
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
|
||||
])
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
|
||||
])
|
||||
dnl
|
||||
dnl If no reference was made to various pairs of opposing options, then
|
||||
dnl we run the default mode handler for the pair. For example, if neither
|
||||
dnl `shared' nor `disable-shared' was passed, we enable building of shared
|
||||
dnl archives by default:
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
|
||||
[_LT_ENABLE_FAST_INSTALL])
|
||||
])
|
||||
])# _LT_SET_OPTIONS
|
||||
|
||||
|
||||
## --------------------------------- ##
|
||||
## Macros to handle LT_INIT options. ##
|
||||
## --------------------------------- ##
|
||||
|
||||
# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
|
||||
# -----------------------------------------
|
||||
m4_define([_LT_MANGLE_DEFUN],
|
||||
[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
|
||||
|
||||
|
||||
# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
|
||||
# -----------------------------------------------
|
||||
m4_define([LT_OPTION_DEFINE],
|
||||
[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
|
||||
])# LT_OPTION_DEFINE
|
||||
|
||||
|
||||
# dlopen
|
||||
# ------
|
||||
LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
|
||||
])
|
||||
|
||||
AU_DEFUN([AC_LIBTOOL_DLOPEN],
|
||||
[_LT_SET_OPTION([LT_INIT], [dlopen])
|
||||
AC_DIAGNOSE([obsolete],
|
||||
[$0: Remove this warning and the call to _LT_SET_OPTION when you
|
||||
put the `dlopen' option into LT_INIT's first parameter.])
|
||||
])
|
||||
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
|
||||
|
||||
|
||||
# win32-dll
|
||||
# ---------
|
||||
# Declare package support for building win32 dll's.
|
||||
LT_OPTION_DEFINE([LT_INIT], [win32-dll],
|
||||
[enable_win32_dll=yes
|
||||
|
||||
case $host in
|
||||
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
|
||||
AC_CHECK_TOOL(AS, as, false)
|
||||
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
|
||||
AC_CHECK_TOOL(OBJDUMP, objdump, false)
|
||||
;;
|
||||
esac
|
||||
|
||||
test -z "$AS" && AS=as
|
||||
_LT_DECL([], [AS], [1], [Assembler program])dnl
|
||||
|
||||
test -z "$DLLTOOL" && DLLTOOL=dlltool
|
||||
_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
|
||||
|
||||
test -z "$OBJDUMP" && OBJDUMP=objdump
|
||||
_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
|
||||
])# win32-dll
|
||||
|
||||
AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
|
||||
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
||||
_LT_SET_OPTION([LT_INIT], [win32-dll])
|
||||
AC_DIAGNOSE([obsolete],
|
||||
[$0: Remove this warning and the call to _LT_SET_OPTION when you
|
||||
put the `win32-dll' option into LT_INIT's first parameter.])
|
||||
])
|
||||
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
|
||||
|
||||
|
||||
# _LT_ENABLE_SHARED([DEFAULT])
|
||||
# ----------------------------
|
||||
# implement the --enable-shared flag, and supports the `shared' and
|
||||
# `disable-shared' LT_INIT options.
|
||||
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
|
||||
m4_define([_LT_ENABLE_SHARED],
|
||||
[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
|
||||
AC_ARG_ENABLE([shared],
|
||||
[AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
|
||||
[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
|
||||
[p=${PACKAGE-default}
|
||||
case $enableval in
|
||||
yes) enable_shared=yes ;;
|
||||
no) enable_shared=no ;;
|
||||
*)
|
||||
enable_shared=no
|
||||
# Look at the argument we got. We use all the common list separators.
|
||||
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
|
||||
for pkg in $enableval; do
|
||||
IFS="$lt_save_ifs"
|
||||
if test "X$pkg" = "X$p"; then
|
||||
enable_shared=yes
|
||||
fi
|
||||
done
|
||||
IFS="$lt_save_ifs"
|
||||
;;
|
||||
esac],
|
||||
[enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
|
||||
|
||||
_LT_DECL([build_libtool_libs], [enable_shared], [0],
|
||||
[Whether or not to build shared libraries])
|
||||
])# _LT_ENABLE_SHARED
|
||||
|
||||
LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
|
||||
LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
|
||||
|
||||
# Old names:
|
||||
AC_DEFUN([AC_ENABLE_SHARED],
|
||||
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
|
||||
])
|
||||
|
||||
AC_DEFUN([AC_DISABLE_SHARED],
|
||||
[_LT_SET_OPTION([LT_INIT], [disable-shared])
|
||||
])
|
||||
|
||||
AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
|
||||
AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
|
||||
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
dnl AC_DEFUN([AM_ENABLE_SHARED], [])
|
||||
dnl AC_DEFUN([AM_DISABLE_SHARED], [])
|
||||
|
||||
|
||||
|
||||
# _LT_ENABLE_STATIC([DEFAULT])
|
||||
# ----------------------------
|
||||
# implement the --enable-static flag, and support the `static' and
|
||||
# `disable-static' LT_INIT options.
|
||||
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
|
||||
m4_define([_LT_ENABLE_STATIC],
|
||||
[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
|
||||
AC_ARG_ENABLE([static],
|
||||
[AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
|
||||
[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
|
||||
[p=${PACKAGE-default}
|
||||
case $enableval in
|
||||
yes) enable_static=yes ;;
|
||||
no) enable_static=no ;;
|
||||
*)
|
||||
enable_static=no
|
||||
# Look at the argument we got. We use all the common list separators.
|
||||
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
|
||||
for pkg in $enableval; do
|
||||
IFS="$lt_save_ifs"
|
||||
if test "X$pkg" = "X$p"; then
|
||||
enable_static=yes
|
||||
fi
|
||||
done
|
||||
IFS="$lt_save_ifs"
|
||||
;;
|
||||
esac],
|
||||
[enable_static=]_LT_ENABLE_STATIC_DEFAULT)
|
||||
|
||||
_LT_DECL([build_old_libs], [enable_static], [0],
|
||||
[Whether or not to build static libraries])
|
||||
])# _LT_ENABLE_STATIC
|
||||
|
||||
LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
|
||||
LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
|
||||
|
||||
# Old names:
|
||||
AC_DEFUN([AC_ENABLE_STATIC],
|
||||
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
|
||||
])
|
||||
|
||||
AC_DEFUN([AC_DISABLE_STATIC],
|
||||
[_LT_SET_OPTION([LT_INIT], [disable-static])
|
||||
])
|
||||
|
||||
AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
|
||||
AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
|
||||
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
dnl AC_DEFUN([AM_ENABLE_STATIC], [])
|
||||
dnl AC_DEFUN([AM_DISABLE_STATIC], [])
|
||||
|
||||
|
||||
|
||||
# _LT_ENABLE_FAST_INSTALL([DEFAULT])
|
||||
# ----------------------------------
|
||||
# implement the --enable-fast-install flag, and support the `fast-install'
|
||||
# and `disable-fast-install' LT_INIT options.
|
||||
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
|
||||
m4_define([_LT_ENABLE_FAST_INSTALL],
|
||||
[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
|
||||
AC_ARG_ENABLE([fast-install],
|
||||
[AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
|
||||
[optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
|
||||
[p=${PACKAGE-default}
|
||||
case $enableval in
|
||||
yes) enable_fast_install=yes ;;
|
||||
no) enable_fast_install=no ;;
|
||||
*)
|
||||
enable_fast_install=no
|
||||
# Look at the argument we got. We use all the common list separators.
|
||||
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
|
||||
for pkg in $enableval; do
|
||||
IFS="$lt_save_ifs"
|
||||
if test "X$pkg" = "X$p"; then
|
||||
enable_fast_install=yes
|
||||
fi
|
||||
done
|
||||
IFS="$lt_save_ifs"
|
||||
;;
|
||||
esac],
|
||||
[enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
|
||||
|
||||
_LT_DECL([fast_install], [enable_fast_install], [0],
|
||||
[Whether or not to optimize for fast installation])dnl
|
||||
])# _LT_ENABLE_FAST_INSTALL
|
||||
|
||||
LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
|
||||
LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
|
||||
|
||||
# Old names:
|
||||
AU_DEFUN([AC_ENABLE_FAST_INSTALL],
|
||||
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
|
||||
AC_DIAGNOSE([obsolete],
|
||||
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
|
||||
the `fast-install' option into LT_INIT's first parameter.])
|
||||
])
|
||||
|
||||
AU_DEFUN([AC_DISABLE_FAST_INSTALL],
|
||||
[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
|
||||
AC_DIAGNOSE([obsolete],
|
||||
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
|
||||
the `disable-fast-install' option into LT_INIT's first parameter.])
|
||||
])
|
||||
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
|
||||
dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
|
||||
|
||||
|
||||
# _LT_WITH_PIC([MODE])
|
||||
# --------------------
|
||||
# implement the --with-pic flag, and support the `pic-only' and `no-pic'
|
||||
# LT_INIT options.
|
||||
# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
|
||||
m4_define([_LT_WITH_PIC],
|
||||
[AC_ARG_WITH([pic],
|
||||
[AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
|
||||
[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
|
||||
[lt_p=${PACKAGE-default}
|
||||
case $withval in
|
||||
yes|no) pic_mode=$withval ;;
|
||||
*)
|
||||
pic_mode=default
|
||||
# Look at the argument we got. We use all the common list separators.
|
||||
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
|
||||
for lt_pkg in $withval; do
|
||||
IFS="$lt_save_ifs"
|
||||
if test "X$lt_pkg" = "X$lt_p"; then
|
||||
pic_mode=yes
|
||||
fi
|
||||
done
|
||||
IFS="$lt_save_ifs"
|
||||
;;
|
||||
esac],
|
||||
[pic_mode=default])
|
||||
|
||||
test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
|
||||
|
||||
_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
|
||||
])# _LT_WITH_PIC
|
||||
|
||||
LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
|
||||
LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
|
||||
|
||||
# Old name:
|
||||
AU_DEFUN([AC_LIBTOOL_PICMODE],
|
||||
[_LT_SET_OPTION([LT_INIT], [pic-only])
|
||||
AC_DIAGNOSE([obsolete],
|
||||
[$0: Remove this warning and the call to _LT_SET_OPTION when you
|
||||
put the `pic-only' option into LT_INIT's first parameter.])
|
||||
])
|
||||
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
|
||||
|
||||
## ----------------- ##
|
||||
## LTDL_INIT Options ##
|
||||
## ----------------- ##
|
||||
|
||||
m4_define([_LTDL_MODE], [])
|
||||
LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
|
||||
[m4_define([_LTDL_MODE], [nonrecursive])])
|
||||
LT_OPTION_DEFINE([LTDL_INIT], [recursive],
|
||||
[m4_define([_LTDL_MODE], [recursive])])
|
||||
LT_OPTION_DEFINE([LTDL_INIT], [subproject],
|
||||
[m4_define([_LTDL_MODE], [subproject])])
|
||||
|
||||
m4_define([_LTDL_TYPE], [])
|
||||
LT_OPTION_DEFINE([LTDL_INIT], [installable],
|
||||
[m4_define([_LTDL_TYPE], [installable])])
|
||||
LT_OPTION_DEFINE([LTDL_INIT], [convenience],
|
||||
[m4_define([_LTDL_TYPE], [convenience])])
|
123
m4/ltsugar.m4
vendored
123
m4/ltsugar.m4
vendored
@ -1,123 +0,0 @@
|
||||
# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
|
||||
#
|
||||
# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
|
||||
# Written by Gary V. Vaughan, 2004
|
||||
#
|
||||
# This file is free software; the Free Software Foundation gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 6 ltsugar.m4
|
||||
|
||||
# This is to help aclocal find these macros, as it can't see m4_define.
|
||||
AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
|
||||
|
||||
|
||||
# lt_join(SEP, ARG1, [ARG2...])
|
||||
# -----------------------------
|
||||
# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
|
||||
# associated separator.
|
||||
# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
|
||||
# versions in m4sugar had bugs.
|
||||
m4_define([lt_join],
|
||||
[m4_if([$#], [1], [],
|
||||
[$#], [2], [[$2]],
|
||||
[m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
|
||||
m4_define([_lt_join],
|
||||
[m4_if([$#$2], [2], [],
|
||||
[m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
|
||||
|
||||
|
||||
# lt_car(LIST)
|
||||
# lt_cdr(LIST)
|
||||
# ------------
|
||||
# Manipulate m4 lists.
|
||||
# These macros are necessary as long as will still need to support
|
||||
# Autoconf-2.59 which quotes differently.
|
||||
m4_define([lt_car], [[$1]])
|
||||
m4_define([lt_cdr],
|
||||
[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
|
||||
[$#], 1, [],
|
||||
[m4_dquote(m4_shift($@))])])
|
||||
m4_define([lt_unquote], $1)
|
||||
|
||||
|
||||
# lt_append(MACRO-NAME, STRING, [SEPARATOR])
|
||||
# ------------------------------------------
|
||||
# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
|
||||
# Note that neither SEPARATOR nor STRING are expanded; they are appended
|
||||
# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
|
||||
# No SEPARATOR is output if MACRO-NAME was previously undefined (different
|
||||
# than defined and empty).
|
||||
#
|
||||
# This macro is needed until we can rely on Autoconf 2.62, since earlier
|
||||
# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
|
||||
m4_define([lt_append],
|
||||
[m4_define([$1],
|
||||
m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
|
||||
|
||||
|
||||
|
||||
# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
|
||||
# ----------------------------------------------------------
|
||||
# Produce a SEP delimited list of all paired combinations of elements of
|
||||
# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
|
||||
# has the form PREFIXmINFIXSUFFIXn.
|
||||
# Needed until we can rely on m4_combine added in Autoconf 2.62.
|
||||
m4_define([lt_combine],
|
||||
[m4_if(m4_eval([$# > 3]), [1],
|
||||
[m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
|
||||
[[m4_foreach([_Lt_prefix], [$2],
|
||||
[m4_foreach([_Lt_suffix],
|
||||
]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
|
||||
[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
|
||||
|
||||
|
||||
# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
|
||||
# -----------------------------------------------------------------------
|
||||
# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
|
||||
# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
|
||||
m4_define([lt_if_append_uniq],
|
||||
[m4_ifdef([$1],
|
||||
[m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
|
||||
[lt_append([$1], [$2], [$3])$4],
|
||||
[$5])],
|
||||
[lt_append([$1], [$2], [$3])$4])])
|
||||
|
||||
|
||||
# lt_dict_add(DICT, KEY, VALUE)
|
||||
# -----------------------------
|
||||
m4_define([lt_dict_add],
|
||||
[m4_define([$1($2)], [$3])])
|
||||
|
||||
|
||||
# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
|
||||
# --------------------------------------------
|
||||
m4_define([lt_dict_add_subkey],
|
||||
[m4_define([$1($2:$3)], [$4])])
|
||||
|
||||
|
||||
# lt_dict_fetch(DICT, KEY, [SUBKEY])
|
||||
# ----------------------------------
|
||||
m4_define([lt_dict_fetch],
|
||||
[m4_ifval([$3],
|
||||
m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
|
||||
m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
|
||||
|
||||
|
||||
# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
|
||||
# -----------------------------------------------------------------
|
||||
m4_define([lt_if_dict_fetch],
|
||||
[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
|
||||
[$5],
|
||||
[$6])])
|
||||
|
||||
|
||||
# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
|
||||
# --------------------------------------------------------------
|
||||
m4_define([lt_dict_filter],
|
||||
[m4_if([$5], [], [],
|
||||
[lt_join(m4_quote(m4_default([$4], [[, ]])),
|
||||
lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
|
||||
[lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
|
||||
])
|
23
m4/ltversion.m4
vendored
23
m4/ltversion.m4
vendored
@ -1,23 +0,0 @@
|
||||
# ltversion.m4 -- version numbers -*- Autoconf -*-
|
||||
#
|
||||
# Copyright (C) 2004 Free Software Foundation, Inc.
|
||||
# Written by Scott James Remnant, 2004
|
||||
#
|
||||
# This file is free software; the Free Software Foundation gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
|
||||
# @configure_input@
|
||||
|
||||
# serial 3337 ltversion.m4
|
||||
# This file is part of GNU Libtool
|
||||
|
||||
m4_define([LT_PACKAGE_VERSION], [2.4.2])
|
||||
m4_define([LT_PACKAGE_REVISION], [1.3337])
|
||||
|
||||
AC_DEFUN([LTVERSION_VERSION],
|
||||
[macro_version='2.4.2'
|
||||
macro_revision='1.3337'
|
||||
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
|
||||
_LT_DECL(, macro_revision, 0)
|
||||
])
|
98
m4/lt~obsolete.m4
vendored
98
m4/lt~obsolete.m4
vendored
@ -1,98 +0,0 @@
|
||||
# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
|
||||
#
|
||||
# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
|
||||
# Written by Scott James Remnant, 2004.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 5 lt~obsolete.m4
|
||||
|
||||
# These exist entirely to fool aclocal when bootstrapping libtool.
|
||||
#
|
||||
# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
|
||||
# which have later been changed to m4_define as they aren't part of the
|
||||
# exported API, or moved to Autoconf or Automake where they belong.
|
||||
#
|
||||
# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
|
||||
# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
|
||||
# using a macro with the same name in our local m4/libtool.m4 it'll
|
||||
# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
|
||||
# and doesn't know about Autoconf macros at all.)
|
||||
#
|
||||
# So we provide this file, which has a silly filename so it's always
|
||||
# included after everything else. This provides aclocal with the
|
||||
# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
|
||||
# because those macros already exist, or will be overwritten later.
|
||||
# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
|
||||
#
|
||||
# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
|
||||
# Yes, that means every name once taken will need to remain here until
|
||||
# we give up compatibility with versions before 1.7, at which point
|
||||
# we need to keep only those names which we still refer to.
|
||||
|
||||
# This is to help aclocal find these macros, as it can't see m4_define.
|
||||
AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
|
||||
|
||||
m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
|
||||
m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
|
||||
m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
|
||||
m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
|
||||
m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
|
||||
m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
|
||||
m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
|
||||
m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
|
||||
m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
|
||||
m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
|
||||
m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
|
||||
m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
|
||||
m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
|
||||
m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
|
||||
m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
|
||||
m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
|
||||
m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
|
||||
m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
|
||||
m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
|
||||
m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
|
||||
m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
|
||||
m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
|
||||
m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
|
||||
m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
|
||||
m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
|
||||
m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
|
||||
m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
|
||||
m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
|
||||
m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
|
||||
m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
|
||||
m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
|
||||
m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
|
||||
m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
|
||||
m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
|
||||
m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
|
||||
m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
|
||||
m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
|
||||
m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
|
||||
m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
|
||||
m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
|
||||
m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
|
||||
m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
|
||||
m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
|
||||
m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
|
||||
m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
|
||||
m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
|
||||
m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
|
||||
m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
|
||||
m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
|
||||
m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
|
||||
m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
|
||||
m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
|
||||
m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
|
||||
m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
|
||||
m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
|
||||
m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
|
||||
m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
|
||||
m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
|
||||
m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
|
||||
m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
|
||||
m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
|
@ -5,12 +5,12 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <ccnet.h>
|
||||
#include "ccnet-object.h"
|
||||
#include <ccnet/job-mgr.h>
|
||||
#include <ccnet/ccnet-object.h>
|
||||
|
||||
#include "common.h"
|
||||
#include "seafile-session.h"
|
||||
#include "check-tx-slave-proc.h"
|
||||
#include "job-mgr.h"
|
||||
|
||||
#define SC_GET_TOKEN "301"
|
||||
#define SS_GET_TOKEN "Get token"
|
||||
|
@ -5,11 +5,11 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <ccnet.h>
|
||||
#include "ccnet-object.h"
|
||||
#include <ccnet/job-mgr.h>
|
||||
#include <ccnet/ccnet-object.h>
|
||||
|
||||
#include "common.h"
|
||||
#include "seafile-session.h"
|
||||
#include "job-mgr.h"
|
||||
#include "log.h"
|
||||
#include "utils.h"
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include <ccnet.h>
|
||||
#include <string.h>
|
||||
#include "ccnet-object.h"
|
||||
#include <ccnet/ccnet-object.h>
|
||||
|
||||
#include "seafile-session.h"
|
||||
#include "recvbranch-proc.h"
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
#include <ccnet.h>
|
||||
#include <ccnet/cevent.h>
|
||||
#include <job-mgr.h>
|
||||
#include <ccnet/job-mgr.h>
|
||||
|
||||
#include "block-mgr.h"
|
||||
#include "fs-mgr.h"
|
||||
|
Loading…
Reference in New Issue
Block a user