add compiling macro option ACL_CLIENT_ONLY to decrease the library's size for

client software.
This commit is contained in:
zsxxsz 2019-05-18 21:19:21 +08:00
parent 064a4c325c
commit 53583d8a9d
189 changed files with 758 additions and 44 deletions

View File

@ -1,5 +1,9 @@
修改历史列表:
650) 2019.5.18
650.1) compile: 增加宏编译选项 ACL_CLIENT_ONLY当将 acl 库用于客户端模式时可以有效地
减少编译库的大小
649) 2019.5.6
649.1) bugfix: acl_vstream_fflush() 当调用 loop_writen() 时其返回值 < 0应该
将 fp->wbuf_dlen 值置 0以防止在调用 acl_vstream_close() 时报错

View File

@ -1,6 +1,8 @@
#ifndef ACL_GBCODE_INCLUDE_H
#define ACL_GBCODE_INCLUDE_H
#ifndef ACL_CLIENT_ONLY
#ifdef __cplusplus
extern "C" {
#endif
@ -29,4 +31,6 @@ ACL_API void acl_gbft2jt(const char *data, size_t dlen, char *buf, size_t size);
}
#endif
#endif /* ACL_CLIENT_ONLY */
#endif

View File

@ -1,6 +1,8 @@
#ifndef ACL_HTMLCODE_INCLUDE_H
#define ACL_HTMLCODE_INCLUDE_H
#ifndef ACL_CLIENT_ONLY
#ifdef __cplusplus
extern "C" {
#endif
@ -15,4 +17,5 @@ ACL_API int acl_html_decode(const char *in, ACL_VSTRING *out);
}
#endif
#endif /* ACL_CLIENT_ONLY */
#endif

View File

@ -1,16 +1,18 @@
#ifndef __ACL_XMLCODE_INCLUDE_H__
#define __ACL_XMLCODE_INCLUDE_H__
#include "../stdlib/acl_define.h"
#include "../stdlib/acl_vstring.h"
#ifdef __cplusplus
extern "C" {
#endif
#include "../stdlib/acl_define.h"
#include "../stdlib/acl_vstring.h"
ACL_API int acl_xml_encode(const char *in, ACL_VSTRING *out);
ACL_API int acl_xml_decode(const char *in, ACL_VSTRING *out);
#ifndef ACL_CLIENT_ONLY
/**
* xml
* @param in {const char**}
@ -35,6 +37,8 @@ ACL_API size_t acl_xml_encode2(const char** in, size_t ilen,
ACL_API const char *acl_xml_decode2(const char *in, char **out, size_t *size);
#endif /* ACL_CLIENT_ONLY */
#ifdef __cplusplus
}
#endif

View File

@ -1,6 +1,8 @@
#ifndef ACL_DBPOOL_INCLUDE_H
#define ACL_DBPOOL_INCLUDE_H
#ifndef ACL_CLIENT_ONLY
#ifdef __cplusplus
extern "C" {
#endif
@ -150,4 +152,5 @@ ACL_API void acl_dbpool_set_ping(ACL_DB_POOL *db_pool, int (*ping_fn)(ACL_DB_HAN
}
#endif
#endif /* ACL_CLIENT_ONLY */
#endif

View File

@ -1,6 +1,8 @@
#ifndef ACL_DBSQL_INCLUDE_H
#define ACL_DBSQL_INCLUDE_H
#ifndef ACL_CLIENT_ONLY
#ifdef __cplusplus
extern "C" {
#endif
@ -102,5 +104,6 @@ ACL_API int acl_dbsql_update(ACL_DB_HANDLE *handle, const char *sql, int *error)
}
#endif
#endif /* ACL_CLIENT_ONLY */
#endif

View File

@ -5,6 +5,8 @@
#include "../stdlib/acl_vstring.h"
#include "../stdlib/acl_fhandle.h"
#ifndef ACL_CLIENT_ONLY
typedef struct ZDB ZDB;
typedef struct ZDB_KEY_HDR ZDB_KEY_HDR;
typedef struct ZDB_BLK ZDB_BLK;
@ -505,4 +507,5 @@ ACL_API void zdb_dat_iter_set(ZDB_DAT_STORE *store, int read_data);
}
#endif
#endif /* ACL_CLIENT_ONLY */
#endif

View File

@ -1,12 +1,14 @@
#ifndef ACL_AIO_PARAMS_INCLUDE_H
#define ACL_AIO_PARAMS_INCLUDE_H
#include "../stdlib/acl_define.h"
#ifndef ACL_CLIENT_ONLY
#ifdef __cplusplus
extern "C" {
#endif
#include "../stdlib/acl_define.h"
#ifdef ACL_UNIX
extern int acl_var_aio_pid;
@ -139,5 +141,6 @@ extern char *acl_var_aio_deny_info;
}
#endif
#endif /* ACL_CLIENT_ONLY */
#endif

View File

@ -1,13 +1,15 @@
#ifndef ACL_MASTER_CONF_INCLUDE_H
#define ACL_MASTER_CONF_INCLUDE_H
#include "../stdlib/acl_define.h"
#include "../master/acl_master_type.h"
#ifndef ACL_CLIENT_ONLY
#ifdef __cplusplus
extern "C" {
#endif
#include "../stdlib/acl_define.h"
#include "../master/acl_master_type.h"
ACL_API void acl_app_conf_load(const char *pathname);
ACL_API void acl_app_conf_unload(void);
ACL_API void acl_get_app_conf_int_table(ACL_CONFIG_INT_TABLE *table);
@ -20,4 +22,5 @@ ACL_API void acl_free_app_conf_str_table(ACL_CONFIG_STR_TABLE *table);
}
#endif
#endif /* ACL_CLIENT_ONLY */
#endif

View File

@ -1,12 +1,14 @@
#ifndef __ACL_MASTER_FLOW_INCLUDED_H__
#define __ACL_MASTER_FLOW_INCLUDED_H__
#include "../stdlib/acl_define.h"
#ifndef ACL_CLIENT_ONLY
#ifdef __cplusplus
extern "C" {
#endif
#include "../stdlib/acl_define.h"
#ifdef ACL_UNIX
/*
@ -23,6 +25,8 @@ extern int acl_master_flow_count(void);
#ifdef __cplusplus
}
#endif /* ACL_CLIENT_ONLY */
#endif
#endif

View File

@ -1,12 +1,14 @@
#ifndef __ACL_MASTER_PROTO_INCLUDE_H__
#define __ACL_MASTER_PROTO_INCLUDE_H__
#include "../stdlib/acl_define.h"
#ifndef ACL_CLIENT_ONLY
#ifdef __cplusplus
extern "C" {
#endif
#include "../stdlib/acl_define.h"
#ifdef ACL_UNIX
/*
@ -81,4 +83,5 @@ int acl_master_notify(int, unsigned, int); /* encapsulate status msg */
}
#endif
#endif /* ACL_CLIENT_ONLY */
#endif

View File

@ -1,12 +1,14 @@
#ifndef ACL_MASTER_TYPE_INCLUDE_H
#define ACL_MASTER_TYPE_INCLUDE_H
#include "../stdlib/acl_xinetd_cfg.h"
#ifndef ACL_CLIENT_ONLY
#ifdef __cplusplus
extern "C" {
#endif
#include "../stdlib/acl_xinetd_cfg.h"
#define ACL_CONFIG_INT_TABLE ACL_CFG_INT_TABLE
#define ACL_CONFIG_INT64_TABLE ACL_CFG_INT64_TABLE
#define ACL_CONFIG_STR_TABLE ACL_CFG_STR_TABLE
@ -16,4 +18,5 @@ extern "C" {
}
#endif
#endif /* ACL_CLIENT_ONLY */
#endif

View File

@ -1,10 +1,6 @@
#ifndef ACL_MASTER_SERVER_API_INCLUDE_H
#define ACL_MASTER_SERVER_API_INCLUDE_H
#ifdef __cplusplus
extern "C" {
#endif
#include "../stdlib/acl_define.h"
/*
@ -15,6 +11,12 @@ extern "C" {
#include "../aio/acl_aio.h"
#include "../event/acl_events.h"
#ifndef ACL_CLIENT_ONLY
#ifdef __cplusplus
extern "C" {
#endif
#define ACL_MASTER_SERVER_END 0
#define ACL_MASTER_SERVER_INT_TABLE 1
#define ACL_MASTER_SERVER_STR_TABLE 2
@ -189,4 +191,5 @@ ACL_API void acl_server_sigterm_setup(void);
}
#endif
#endif /* ACL_CLIENT_ONLY */
#endif

View File

@ -1,12 +1,14 @@
#ifndef ACL_SINGLE_PARAMS_INCLUDE_H
#define ACL_SINGLE_PARAMS_INCLUDE_H
#include "../stdlib/acl_define.h"
#ifndef ACL_CLIENT_ONLY
#ifdef __cplusplus
extern "C" {
#endif
#include "../stdlib/acl_define.h"
#ifdef ACL_UNIX
extern int acl_var_single_pid; /* get by call getpid() */
@ -95,5 +97,6 @@ extern int acl_var_single_max_debug;
}
#endif
#endif /* ACL_CLIENT_ONLY */
#endif

View File

@ -1,12 +1,14 @@
#ifndef ACL_THREADS_PARAMS_INCLUDE_H
#define ACL_THREADS_PARAMS_INCLUDE_H
#include "../stdlib/acl_define.h"
#ifndef ACL_CLIENT_ONLY
#ifdef __cplusplus
extern "C" {
#endif
#include "../stdlib/acl_define.h"
extern char *acl_var_threads_procname;
extern char *acl_var_threads_log_file;
@ -150,4 +152,5 @@ extern char *acl_var_threads_dispatch_type;
}
#endif
#endif /* ACL_CLIENT_ONLY */
#endif

View File

@ -1,12 +1,14 @@
#ifndef ACL_TRIGGER_PARAMS_INCLUDE_H
#define ACL_TRIGGER_PARAMS_INCLUDE_H
#include "../stdlib/acl_define.h"
#ifndef ACL_CLIENT_ONLY
#ifdef __cplusplus
extern "C" {
#endif
#include "../stdlib/acl_define.h"
#ifdef ACL_UNIX
extern int acl_var_trigger_pid; /* get by call getpid() */
@ -83,5 +85,6 @@ extern int acl_var_trigger_max_debug;
}
#endif
#endif /* ACL_CLIENT_ONLY */
#endif

View File

@ -1,13 +1,14 @@
#ifndef __ACL_UDP_PARAMS_INCLUDE_H_
#define __ACL_UDP_PARAMS_INCLUDE_H_
#include "../stdlib/acl_define.h"
#ifndef ACL_CLIENT_ONLY
#ifdef __cplusplus
extern "C" {
#endif
#include "../stdlib/acl_define.h"
extern int acl_var_udp_pid;
extern char *acl_var_udp_procname;
extern char *acl_var_udp_log_file;
@ -112,4 +113,5 @@ extern char *acl_var_udp_private;
}
#endif
#endif /* ACL_CLIENT_ONLY */
#endif

View File

@ -1,11 +1,12 @@
#ifndef ACL_AQUEUE_INCLUDE_H
#define ACL_AQUEUE_INCLUDE_H
#include "../stdlib/acl_define.h"
#include "../thread/acl_thread.h"
#ifdef __cplusplus
extern "C" {
#endif
#include "../stdlib/acl_define.h"
#include "../thread/acl_thread.h"
#define ACL_AQUEUE_ERR_UNKNOWN -1
#define ACL_AQUEUE_OK 0

View File

@ -8,6 +8,8 @@
#endif
#ifndef ACL_CLIENT_ONLY
#include "gb_jt2ft.h"
#include "gb_ft2jt.h"
@ -57,3 +59,5 @@ void acl_gbft2jt(const char *data, size_t dlen, char *buf, size_t size)
{
gbtransfer(__ft2jt_tab, data, dlen, buf, size);
}
#endif /* ACL_CLIENT_ONLY */

View File

@ -14,6 +14,8 @@
#endif
#ifndef ACL_CLIENT_ONLY
#include "uni2utf8.h"
#include "html_charset.h"
@ -144,3 +146,5 @@ int acl_html_decode(const char *in, ACL_VSTRING *out)
ACL_VSTRING_TERMINATE(out);
return (n);
}
#endif /* ACL_CLIENT_ONLY */

View File

@ -190,6 +190,8 @@ int acl_xml_decode(const char *in, ACL_VSTRING *out)
/*--------------------------------------------------------------------------*/
#ifndef ACL_CLIENT_ONLY
size_t acl_xml_encode2(const char **in, size_t ilen, char *out, size_t olen)
{
size_t olen_saved = olen;
@ -352,3 +354,5 @@ const char *acl_xml_decode2(const char *in, char **out, size_t *size)
*out += 1;
return ptr;
}
#endif /* ACL_CLIENT_ONLY */

View File

@ -1,3 +1,6 @@
#ifndef ACL_CLIENT_ONLY
static const unsigned short __ft2jt_tab[] = {
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
@ -8192,3 +8195,5 @@ static const unsigned short __ft2jt_tab[] = {
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
};
#endif /* ACL_CLIENT_ONLY */

View File

@ -1,3 +1,6 @@
#ifndef ACL_CLIENT_ONLY
static const unsigned short __jt2ft_tab[] = {
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
@ -8192,3 +8195,5 @@ static const unsigned short __jt2ft_tab[] = {
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
};
#endif /* ACL_CLIENT_ONLY */

View File

@ -1,6 +1,8 @@
#ifndef __HTML_CHARSET_INCLUDE_H__
#define __HTML_CHARSET_INCLUDE_H__
#ifndef ACL_CLIENT_ONLY
static const char *html_charmap[] = {
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
@ -8458,4 +8460,5 @@ static const HTML_SPEC html_tab[] = {
{ 9830, "&diams;", sizeof("&diams;") - 1 },
};
#endif /* ACL_CLIENT_ONLY */
#endif

View File

@ -15,6 +15,8 @@
#endif
#ifndef ACL_CLIENT_ONLY
#include "mysql/acl_dbpool_mysql.h"
#include "null/acl_dbpool_null.h"
@ -135,4 +137,4 @@ void acl_dbpool_set_ping(ACL_DB_POOL *db_pool, int (*ping_fn)(ACL_DB_HANDLE*))
db_pool->dbh_ping = ping_fn;
}
/*----------------------------------------------------------------------------*/
#endif /* ACL_CLIENT_ONLY */

View File

@ -16,6 +16,8 @@
#endif
#ifndef ACL_CLIENT_ONLY
ACL_SQL_RES *acl_dbsql_select(ACL_DB_HANDLE *handle, const char *sql, int *error)
{
const char *myname = "acl_dbsql_select";
@ -102,3 +104,4 @@ int acl_dbsql_update(ACL_DB_HANDLE *handle, const char *sql, int *error)
return (n);
}
#endif /* ACL_CLIENT_ONLY */

View File

@ -12,6 +12,8 @@
#endif
#ifndef ACL_CLIENT_ONLY
#ifdef HAS_MYSQL
#include "mysql.h"
@ -327,4 +329,5 @@ int acl_dbmysql_update(ACL_DB_HANDLE *handle, const char *sql, int *error)
}
#endif /* HAS_MYSQL */
#endif /* ACL_CLIENT_ONLY */

View File

@ -1,13 +1,15 @@
#ifndef __ACL_DBMYSQL_INCLUDE_H__
#define __ACL_DBMYSQL_INCLUDE_H__
#include "stdlib/acl_define.h"
#include "db/acl_dbpool.h"
#ifndef ACL_CLIENT_ONLY
#ifdef __cplusplus
extern "C" {
#endif
#include "stdlib/acl_define.h"
#include "db/acl_dbpool.h"
#ifdef HAS_MYSQL
ACL_SQL_RES *acl_dbmysql_select(ACL_DB_HANDLE *handle, const char *sql, int *error);
@ -24,5 +26,6 @@ int acl_dbmysql_update(ACL_DB_HANDLE *handle, const char *sql, int *error);
}
#endif
#endif /* ACL_CLIENT_ONLY */
#endif

View File

@ -16,6 +16,7 @@
#endif
#ifndef ACL_CLIENT_ONLY
#ifdef HAS_MYSQL
#include "mysql.h"
@ -491,5 +492,5 @@ void _dosmaperr(unsigned long error)
#endif /* ACL_WINDOWS */
#endif
#endif /* HAS_MYSQL */
#endif /* HAS_MYSQL */
#endif /* ACL_CLIENT_ONLY */

View File

@ -2,13 +2,15 @@
#ifndef __ACL_DBPOOL_MYSQL_INCLUDE_H__
#define __ACL_DBPOOL_MYSQL_INCLUDE_H__
#include "stdlib/acl_define.h"
#include "db/acl_dbpool.h"
#ifndef ACL_CLIENT_ONLY
#ifdef __cplusplus
extern "C" {
#endif
#include "stdlib/acl_define.h"
#include "db/acl_dbpool.h"
#ifdef HAS_MYSQL
/* in acl_dbpool_mysql.c */
@ -34,4 +36,5 @@ int sane_mysql_reopen(ACL_DB_HANDLE *handle);
}
#endif
#endif /* ACL_CLIENT_ONLY */
#endif

View File

@ -15,6 +15,8 @@
#endif
#ifndef ACL_CLIENT_ONLY
#include "acl_dbnull.h"
int acl_dbnull_results(ACL_DB_HANDLE *handle acl_unused,
@ -47,3 +49,5 @@ int acl_dbnull_update(ACL_DB_HANDLE *handle acl_unused,
acl_msg_fatal("%s, %s(%d): not supported!", __FILE__, myname, __LINE__);
return (-1);
}
#endif /* ACL_CLIENT_ONLY */

View File

@ -1,13 +1,14 @@
#ifndef __ACL_DB_NULL_INCLUDE_H__
#define __ACL_DB_NULL_INCLUDE_H__
#include "stdlib/acl_define.h"
#include "db/acl_dbpool.h"
#ifndef ACL_CLIENT_ONLY
#ifdef __cplusplus
extern "C" {
#endif
#include "stdlib/acl_define.h"
#include "db/acl_dbpool.h"
int acl_dbnull_results(ACL_DB_HANDLE *handle, const char *sql, int *error,
int (*walk_fn)(const void** my_row, void *arg), void *arg);
int acl_dbnull_result(ACL_DB_HANDLE *handle, const char *sql, int *error,
@ -18,5 +19,6 @@ int acl_dbnull_update(ACL_DB_HANDLE *handle, const char *sql, int *error);
}
#endif
#endif /* ACL_CLIENT_ONLY */
#endif

View File

@ -17,6 +17,8 @@
#endif
#ifndef ACL_CLIENT_ONLY
#include "acl_dbnull.h"
#include "acl_dbpool_null.h"
@ -354,3 +356,5 @@ ACL_DB_POOL *acl_dbpool_null_create(const ACL_DB_INFO *db_info)
return ((ACL_DB_POOL *) null_pool);
}
/*----------------------------------------------------------------------------*/
#endif /* ACL_CLIENT_ONLY */

View File

@ -16,6 +16,8 @@
#endif
#ifndef ACL_CLIENT_ONLY
#include "zdb_private.h"
/*----------------------------------------------------------------------------*/
@ -394,3 +396,4 @@ int zdb_update(ZDB *db, zdb_key_t key, const ZDB_BLK_OFF *blk_off_saved,
}
/*----------------------------------------------------------------------------*/
#endif /* ACL_CLIENT_ONLY */

View File

@ -13,6 +13,8 @@
#endif
#ifndef ACL_CLIENT_ONLY
#include "zdb_private.h"
int dat_store_header_sync(ZDB_DAT_STORE *store)
@ -1309,3 +1311,5 @@ int zdb_dat_check3(ZDB *db, const char *filepath, ZDB_DAT_HDR *dat_hdr)
zdb_dat_store_close(store);
return (ret);
}
#endif /* ACL_CLIENT_ONLY */

View File

@ -8,6 +8,8 @@
#endif
#ifndef ACL_CLIENT_ONLY
#include "zdb_private.h"
typedef struct {
@ -382,3 +384,5 @@ void zdb_dat_iter_set(ZDB_DAT_STORE *store, int read_data)
((ZDB_STORE*) store)->iter_next = (STORE_ITER) hdr_iter_next;
}
}
#endif /* ACL_CLIENT_ONLY */

View File

@ -10,6 +10,8 @@
#endif
#ifndef ACL_CLIENT_ONLY
#include "zdb_private.h"
static int zdb_dat_scan_path(ZDB *db, const char *path,
@ -81,3 +83,5 @@ int zdb_dat_walk(ZDB *db, int (*walk_fn)(ZDB_DAT_STORE *store))
return (ret);
}
#endif /* ACL_CLIENT_ONLY */

View File

@ -28,6 +28,8 @@
#endif
#endif
#ifndef ACL_CLIENT_ONLY
#include "zdb_private.h"
#define KEY_LEN 21
@ -433,3 +435,5 @@ int zdb_read(ZDB_STORE *store, void *buf, size_t size, zdb_off_t off)
}
/*----------------------------------------------------------------------------*/
#endif /* ACL_CLIENT_ONLY */

View File

@ -11,6 +11,8 @@
#endif
#ifndef ACL_CLIENT_ONLY
#include "zdb_private.h"
int key_store_header_sync(ZDB_KEY_STORE *store)
@ -639,3 +641,5 @@ int zdb_key_init(ZDB *db, zdb_key_t key_begin, zdb_key_t key_end)
return (0);
}
#endif /* ACL_CLIENT_ONLY */

View File

@ -11,6 +11,8 @@
#endif
#ifndef ACL_CLIENT_ONLY
#include "zdb_private.h"
int zdb_key_walk(ZDB *db, int (*walk_fn)(ZDB_KEY_STORE*))
@ -60,3 +62,5 @@ int zdb_key_walk(ZDB *db, int (*walk_fn)(ZDB_KEY_STORE*))
acl_scan_dir_close(scan);
return (ret);
}
#endif /* ACL_CLIENT_ONLY */

View File

@ -1,6 +1,8 @@
#ifndef __ZDB_PRIVATE_INCLUDE_H__
#define __ZDB_PRIVATE_INCLUDE_H__
#ifndef ACL_CLIENT_ONLY
#include "db/zdb.h"
#define ZDB_DBG_BASE 500
@ -195,4 +197,5 @@ int zdb_read(ZDB_STORE *store, void *buf, size_t size, zdb_off_t off);
}
#endif
#endif /* ACL_CLIENT_ONLY */
#endif

View File

@ -10,6 +10,7 @@
#endif
#ifndef ACL_CLIENT_ONLY
#ifdef ACL_UNIX
#include <sys/stat.h>
@ -131,3 +132,4 @@ int acl_master_flow_count(void)
}
#endif /* ACL_UNIX */
#endif /* ACL_CLIENT_ONLY */

View File

@ -17,6 +17,8 @@
#include "master/acl_master_conf.h"
#ifndef ACL_CLIENT_ONLY
/*-------------- global static inition and update functions ----------------*/
static void init_conf_int_vars(ACL_CONFIG_INT_TABLE cit[])
@ -246,3 +248,5 @@ void acl_get_app_conf_bool_table(ACL_CONFIG_BOOL_TABLE *table)
update_conf_bool_vars(table, name, value);
}
}
#endif /* ACL_CLIENT_ONLY */

View File

@ -10,6 +10,7 @@
#endif
#ifndef ACL_CLIENT_ONLY
#ifdef ACL_UNIX
#include <unistd.h>
@ -53,3 +54,5 @@ int acl_master_notify(int pid, unsigned generation, int status)
}
#endif /* ACL_UNIX */
#endif /* ACL_CLIENT_ONLY */

View File

@ -16,6 +16,8 @@
#endif
#ifndef ACL_CLIENT_ONLY
#ifdef ACL_WINDOWS
#include <signal.h>
#endif
@ -96,3 +98,5 @@ void acl_server_sigterm_setup(void)
__FUNCTION__, SIGTERM, strerror(errno));
#endif
}
#endif /* ACL_CLIENT_ONLY */

View File

@ -10,6 +10,7 @@
#endif
#ifndef ACL_CLIENT_ONLY
#ifdef ACL_UNIX
#include <sys/socket.h>
@ -1596,3 +1597,4 @@ void acl_aio_app2_main(int argc, char *argv[], ACL_AIO_RUN2_FN run2_fn,
}
#endif /* ACL_UNIX */
#endif /* ACL_CLIENT_ONLY */

View File

@ -10,6 +10,7 @@
#endif
#ifndef ACL_CLIENT_ONLY
#ifdef ACL_UNIX
#include <sys/socket.h>
@ -750,3 +751,4 @@ void acl_single_server_main(int argc, char **argv, ACL_SINGLE_SERVER_FN service,
}
#endif /* ACL_UNIX */
#endif /* ACL_CLIENT_ONLY */

View File

@ -10,6 +10,7 @@
#endif
#ifndef ACL_CLIENT_ONLY
#ifdef ACL_UNIX
#include <sys/socket.h>
@ -1601,3 +1602,5 @@ void acl_threads_server_main(int argc, char * argv[],
/* not reached here */
/* acl_vstring_free(buf); */
}
#endif /* ACL_CLIENT_ONLY */

View File

@ -10,6 +10,7 @@
#endif
#ifndef ACL_CLIENT_ONLY
#ifdef ACL_UNIX
#include <sys/socket.h>
@ -756,3 +757,4 @@ void acl_trigger_server_main(int argc, char **argv, ACL_TRIGGER_SERVER_FN servic
}
#endif /* ACL_UNIX */
#endif /* ACL_CLIENT_ONLY */

View File

@ -10,6 +10,7 @@
#endif
#ifndef ACL_CLIENT_ONLY
#ifdef ACL_UNIX
#include <sys/socket.h>
@ -1246,3 +1247,6 @@ void acl_udp_server_main(int argc, char **argv, ACL_UDP_SERVER_FN service, ...)
servers_start(__servers, acl_var_udp_threads);
}
#endif /* ACL_CLIENT_ONLY */

View File

@ -8,6 +8,8 @@
#include "stdlib/acl_env.h"
#include "master_log.h"
#ifndef ACL_CLIENT_ONLY
static int var_master_log_opened = 0;
void master_log_open(const char *procname)
@ -35,3 +37,5 @@ void master_log_close()
var_master_log_opened = 0;
}
}
#endif /* ACL_CLIENT_ONLY */

View File

@ -1,12 +1,13 @@
#ifndef __MASTER_LOG_INCLUDE_H__
#define __MASTER_LOG_INCLUDE_H__
#include "stdlib/acl_define.h"
#ifndef ACL_CLIENT_ONLY
#ifdef __cplusplus
extern "C" {
#endif
#include "stdlib/acl_define.h"
void master_log_open(const char *procname);
void master_log_close(void);
@ -14,4 +15,5 @@ void master_log_close(void);
}
#endif
#endif /* ACL_CLIENT_ONLY */
#endif

View File

@ -1,5 +1,9 @@
修改历史列表:
569) 2019.5.18
569.1) compile: 增加宏编译选项 ACL_CLIENT_ONLY当将 acl 库用于客户端模式时可以有效地
减少编译库的大小
568) 2019.5.14
568.1) bugfix: redis_stream.cpp 中针对 XREADGROUP/XREAD 命令,当 block 为 0 时,
应该采用阻塞模式等待消息到达

View File

@ -6,6 +6,8 @@
#include "../stdlib/noncopyable.hpp"
#include "../stream/socket_stream.hpp"
#ifndef ACL_CLIENT_ONLY
struct ACL_ARGV;
namespace acl {
@ -308,3 +310,5 @@ private:
};
} // namespace acl
#endif // ACL_CLIENT_ONLY

View File

@ -3,6 +3,8 @@
#include "../stdlib/noncopyable.hpp"
#include <map>
#ifndef ACL_CLIENT_ONLY
namespace acl {
class beanstalk;
@ -50,3 +52,5 @@ private:
};
} // namespace acl
#endif // ACL_CLIENT_ONLY

View File

@ -3,6 +3,8 @@
#include "../stdlib/string.hpp"
#include "../db/db_handle.hpp"
#ifndef ACL_CLIENT_ONLY
typedef struct st_mysql MYSQL;
namespace acl {
@ -161,3 +163,5 @@ private:
};
} // namespace acl
#endif // ACL_CLIENT_ONLY

View File

@ -3,6 +3,8 @@
#include "../stdlib/string.hpp"
#include "../db/db_handle.hpp"
#ifndef ACL_CLIENT_ONLY
typedef struct pg_conn PGconn;
namespace acl {
@ -103,3 +105,5 @@ private:
};
} // namespace acl
#endif // ACL_CLIENT_ONLY

View File

@ -3,6 +3,8 @@
#include "../stdlib/string.hpp"
#include "../db/db_service.hpp"
#ifndef ACL_CLIENT_ONLY
namespace acl {
class ACL_CPP_API db_service_mysql : public db_service
@ -54,3 +56,5 @@ private:
};
}
#endif // ACL_CLIENT_ONLY

View File

@ -1,6 +1,8 @@
#pragma once
#include "../acl_cpp_define.hpp"
#ifndef ACL_CLIENT_ONLY
namespace acl {
class ACL_CPP_API mysql_conf
@ -149,3 +151,5 @@ private:
};
} // namespace acl
#endif // ACL_CLIENT_ONLY

View File

@ -4,6 +4,8 @@
#include "../stdlib/string.hpp"
#include "../connpool/connect_manager.hpp"
#ifndef ACL_CLIENT_ONLY
namespace acl {
class mysql_conf;
@ -58,3 +60,5 @@ private:
};
} // namespace acl
#endif // ACL_CLIENT_ONLY

View File

@ -2,6 +2,8 @@
#include "../acl_cpp_define.hpp"
#include "../db/db_pool.hpp"
#ifndef ACL_CLIENT_ONLY
namespace acl {
class db_handle;
@ -46,3 +48,5 @@ private:
};
} // namespace acl
#endif // ACL_CLIENT_ONLY

View File

@ -1,6 +1,8 @@
#pragma once
#include "../acl_cpp_define.hpp"
#ifndef ACL_CLIENT_ONLY
namespace acl {
class ACL_CPP_API pgsql_conf
@ -127,3 +129,5 @@ private:
};
} // namespace acl
#endif // ACL_CLIENT_ONLY

View File

@ -4,6 +4,8 @@
#include "../stdlib/string.hpp"
#include "../connpool/connect_manager.hpp"
#ifndef ACL_CLIENT_ONLY
namespace acl {
class pgsql_conf;
@ -37,3 +39,5 @@ private:
};
} // namespace acl
#endif // ACL_CLIENT_ONLY

View File

@ -2,6 +2,8 @@
#include "../acl_cpp_define.hpp"
#include "../db/db_pool.hpp"
#ifndef ACL_CLIENT_ONLY
namespace acl {
class db_handle;
@ -22,3 +24,5 @@ private:
};
} // namespace acl
#endif // ACL_CLIENT_ONLY

View File

@ -5,6 +5,8 @@
#include "../stdlib/string.hpp"
#include "../redis/redis_command.hpp"
#ifndef ACL_CLIENT_ONLY
namespace acl
{
@ -252,3 +254,5 @@ private:
};
} // namespace acl
#endif // ACL_CLIENT_ONLY

View File

@ -2,6 +2,8 @@
#include "../acl_cpp_define.hpp"
#include "../stdlib/noncopyable.hpp"
#ifndef ACL_CLIENT_ONLY
namespace acl
{
@ -61,3 +63,5 @@ private:
};
} // namespace acl
#endif // ACL_CLIENT_ONLY

View File

@ -4,6 +4,8 @@
#include "../stdlib/noncopyable.hpp"
#include "../stdlib/string.hpp"
#ifndef ACL_CLIENT_ONLY
namespace acl
{
@ -127,3 +129,5 @@ private:
};
} // namespace acl
#endif // ACL_CLIENT_ONLY

View File

@ -2,6 +2,8 @@
#include "../acl_cpp_define.hpp"
#include "../stdlib/string.hpp"
#ifndef ACL_CLIENT_ONLY
namespace acl
{
@ -59,3 +61,5 @@ private:
};
} // namespace acl
#endif // ACL_CLIENT_ONLY

View File

@ -7,6 +7,8 @@
#include "../stream/socket_stream.hpp"
#include "../hsocket/hsproto.hpp"
#ifndef ACL_CLIENT_ONLY
struct ACL_ARGV;
namespace acl {
@ -199,3 +201,5 @@ private:
};
} // namespace acl
#endif // ACL_CLIENT_ONLY

View File

@ -1,6 +1,8 @@
#pragma once
#include "../acl_cpp_define.hpp"
#ifndef ACL_CLIENT_ONLY
#define HS_ERR_INVALID_REPLY -7 // 服务器返回数据错误
#define HS_ERR_EMPTY -6 // 服务器返回数据为空
#define HS_ERR_PARAMS -5 // 输入参数错误
@ -22,3 +24,5 @@ public:
};
} // namespace acl
#endif // ACL_CLIENT_ONLY

View File

@ -3,6 +3,8 @@
#include "../stdlib/noncopyable.hpp"
#include <list>
#ifndef ACL_CLIENT_ONLY
struct ACL_HTABLE;
namespace acl {
@ -54,3 +56,5 @@ private:
};
} // namespace acl
#endif // ACL_CLIENT_ONLY

View File

@ -3,6 +3,8 @@
#include "../stdlib/noncopyable.hpp"
#include <vector>
#ifndef ACL_CLIENT_ONLY
namespace acl {
class string;
@ -196,3 +198,5 @@ private:
};
} // namespace acl
#endif // ACL_CLIENT_ONLY

View File

@ -3,6 +3,8 @@
#include "../stdlib/noncopyable.hpp"
#include <vector>
#ifndef ACL_CLIENT_ONLY
namespace acl {
class string;
@ -43,3 +45,5 @@ private:
};
} // namespace acl
#endif // ACL_CLIENT_ONLY

View File

@ -2,6 +2,8 @@
#include "../acl_cpp_define.hpp"
#include "../stdlib/noncopyable.hpp"
#ifndef ACL_CLIENT_ONLY
namespace acl {
class ACL_CPP_API hstable : public noncopyable
@ -23,3 +25,5 @@ private:
};
} // namespace acl
#endif // ACL_CLIENT_ONLY

View File

@ -4,6 +4,8 @@
#include "../stdlib/noncopyable.hpp"
#include "http_header.hpp"
#ifndef ACL_CLIENT_ONLY
namespace acl {
class session;
@ -262,3 +264,5 @@ private:
};
} // namespace acl
#endif // ACL_CLIENT_ONLY

View File

@ -7,6 +7,8 @@
#include "http_ctype.hpp"
#include "http_type.hpp"
#ifndef ACL_CLIENT_ONLY
namespace acl {
class dbuf_guard;
@ -372,3 +374,5 @@ private:
};
} // namespace acl
#endif // ACL_CLIENT_ONLY

View File

@ -2,6 +2,8 @@
#include "../acl_cpp_define.hpp"
#include "../stdlib/noncopyable.hpp"
#ifndef ACL_CLIENT_ONLY
namespace acl {
class dbuf_guard;
@ -262,3 +264,5 @@ private:
};
} // namespace acl
#endif // ACL_CLIENT_ONLY

View File

@ -4,6 +4,8 @@
#include "../session/session.hpp"
#include <map>
#ifndef ACL_CLIENT_ONLY
namespace acl {
class session;
@ -115,3 +117,5 @@ protected:
};
} // namespace acl
#endif // ACL_CLIENT_ONLY

View File

@ -2,6 +2,8 @@
#include "../acl_cpp_define.hpp"
#include "HttpServlet.hpp"
#ifndef ACL_CLIENT_ONLY
namespace acl
{
@ -146,3 +148,5 @@ private:
};
} // namespace acl
#endif // ACL_CLIENT_ONLY

View File

@ -4,6 +4,8 @@
#include "../stream/aio_listen_stream.hpp"
#include "master_base.hpp"
#ifndef ACL_CLIENT_ONLY
struct ACL_VSTREAM;
struct ACL_VSTRING;
@ -103,3 +105,5 @@ private:
};
} // namespace acl
#endif // ACL_CLIENT_ONLY

View File

@ -4,6 +4,8 @@
#include "master_conf.hpp"
#include <vector>
#ifndef ACL_CLIENT_ONLY
struct ACL_EVENT;
namespace acl
@ -120,3 +122,6 @@ private:
};
} // namespace acl
#endif // ACL_CLIENT_ONLY

View File

@ -2,6 +2,8 @@
#include "../acl_cpp_define.hpp"
#include "../stdlib/noncopyable.hpp"
#ifndef ACL_CLIENT_ONLY
struct ACL_XINETD_CFG_PARSER;
struct ACL_CFG_INT_TABLE;
struct ACL_CFG_INT64_TABLE;
@ -128,3 +130,5 @@ private:
};
} // namespace acl
#endif // ACL_CLIENT_ONLY

View File

@ -1,6 +1,8 @@
#pragma once
#include "master_base.hpp"
#ifndef ACL_CLIENT_ONLY
struct ACL_VSTREAM;
struct ACL_EVENT;
struct ACL_VSTRING;
@ -81,3 +83,5 @@ private:
};
} // namespace acl
#endif // ACL_CLIENT_ONLY

View File

@ -2,6 +2,8 @@
#include "master_base.hpp"
#include "../stdlib/thread_mutex.hpp"
#ifndef ACL_CLIENT_ONLY
struct ACL_VSTREAM;
struct ACL_EVENT;
struct ACL_VSTRING;
@ -223,3 +225,5 @@ private:
};
} // namespace acl
#endif // ACL_CLIENT_ONLY

View File

@ -1,6 +1,8 @@
#pragma once
#include "master_base.hpp"
#ifndef ACL_CLIENT_ONLY
struct ACL_VSTRING;
namespace acl {
@ -61,3 +63,5 @@ private:
};
} // namespace acl
#endif // ACL_CLIENT_ONLY

View File

@ -3,6 +3,8 @@
#include "master_base.hpp"
#include "../stdlib/thread_mutex.hpp"
#ifndef ACL_CLIENT_ONLY
struct ACL_VSTRING;
namespace acl {
@ -109,3 +111,5 @@ private:
};
} // namespace acl
#endif // ACL_CLIENT_ONLY

View File

@ -5,6 +5,8 @@
#include "../stdlib/string.hpp"
#include "../mime/rfc2047.hpp"
#ifndef ACL_CLIENT_ONLY
namespace acl {
class socket_stream;
@ -250,3 +252,5 @@ private:
};
} // namespace acl
#endif // ACL_CLIENT_ONLY

View File

@ -2,6 +2,8 @@
#include "../acl_cpp_define.hpp"
#include "../connpool/connect_manager.hpp"
#ifndef ACL_CLIENT_ONLY
namespace acl
{
@ -25,3 +27,5 @@ protected:
};
} // namespace acl
#endif // ACL_CLIENT_ONLY

View File

@ -2,6 +2,8 @@
#include "../acl_cpp_define.hpp"
#include "../connpool/connect_pool.hpp"
#ifndef ACL_CLIENT_ONLY
namespace acl
{
@ -31,3 +33,5 @@ protected:
};
} // namespace acl
#endif // ACL_CLIENT_ONLY

View File

@ -16,6 +16,8 @@
#include "redis_geo.hpp"
#include "redis_stream.hpp"
#ifndef ACL_CLIENT_ONLY
namespace acl
{
@ -68,3 +70,5 @@ public:
};
} // namespace acl
#endif // ACL_CLIENT_ONLY

View File

@ -5,6 +5,8 @@
#include "../stdlib/string.hpp"
#include "../connpool/connect_client.hpp"
#ifndef ACL_CLIENT_ONLY
namespace acl
{
@ -185,3 +187,5 @@ private:
};
} // end namespace acl
#endif // ACL_CLIENT_ONLY

View File

@ -5,6 +5,8 @@
#include "../stdlib/string.hpp"
#include "../connpool/connect_manager.hpp"
#ifndef ACL_CLIENT_ONLY
namespace acl
{
@ -190,3 +192,5 @@ private:
};
} // namespace acl
#endif // ACL_CLIENT_ONLY

View File

@ -2,6 +2,8 @@
#include "../acl_cpp_define.hpp"
#include "../connpool/connect_pool.hpp"
#ifndef ACL_CLIENT_ONLY
namespace acl
{
@ -70,3 +72,5 @@ private:
};
} // namespace acl
#endif // ACL_CLIENT_ONLY

View File

@ -6,6 +6,8 @@
#include "../stdlib/string.hpp"
#include "redis_command.hpp"
#ifndef ACL_CLIENT_ONLY
namespace acl
{
@ -312,3 +314,6 @@ private:
};
} // namespace acl
#endif // ACL_CLIENT_ONLY

View File

@ -6,6 +6,8 @@
#include <vector>
#include "redis_result.hpp"
#ifndef ACL_CLIENT_ONLY
namespace acl
{
@ -440,3 +442,5 @@ protected:
};
} // namespace acl
#endif // ACL_CLIENT_ONLY

View File

@ -2,6 +2,8 @@
#include "../acl_cpp_define.hpp"
#include "redis_command.hpp"
#ifndef ACL_CLIENT_ONLY
namespace acl
{
@ -81,3 +83,5 @@ public:
};
} // namespace acl
#endif // ACL_CLIENT_ONLY

View File

@ -5,6 +5,8 @@
#include "../stdlib/string.hpp"
#include "redis_command.hpp"
#ifndef ACL_CLIENT_ONLY
namespace acl
{
@ -328,3 +330,5 @@ private:
};
} // namespace acl
#endif // ACL_CLIENT_ONLY

View File

@ -5,6 +5,8 @@
#include "../stdlib/string.hpp"
#include "redis_command.hpp"
#ifndef ACL_CLIENT_ONLY
namespace acl
{
@ -359,3 +361,5 @@ public:
};
} // namespace acl
#endif // ACL_CLIENT_ONLY

View File

@ -4,6 +4,8 @@
#include "../stdlib/string.hpp"
#include "redis_command.hpp"
#ifndef ACL_CLIENT_ONLY
namespace acl
{
@ -84,3 +86,5 @@ public:
};
} // namespace acl
#endif // ACL_CLIENT_ONLY

View File

@ -4,6 +4,8 @@
#include "../stdlib/string.hpp"
#include "redis_command.hpp"
#ifndef ACL_CLIENT_ONLY
namespace acl {
class redis_client;
@ -404,3 +406,5 @@ public:
};
} // namespace acl
#endif // ACL_CLIENT_ONLY

Some files were not shown because too many files have changed in this diff Show More