Skip to content
Snippets Groups Projects
Commit 96c030ff authored by Konstantin Osipov's avatar Konstantin Osipov
Browse files

[gh-138] Remove confetti, cfg/ and all mentions of the configuration file.

parent 7c76ad19
No related branches found
No related tags found
No related merge requests found
Showing
with 0 additions and 6853 deletions
......@@ -26,7 +26,6 @@ find_program(LYNX lynx)
find_program(CAT cat)
find_program(GIT git)
find_program(RAGEL ragel)
find_program(CONFETTI confetti)
find_program(LD ld)
find_program(POD2MAN pod2man)
......@@ -340,7 +339,6 @@ include (cmake/package.cmake)
#
include (cmake/rpm.cmake)
add_subdirectory(cfg)
# Disable connector_c for 1.6
add_subdirectory(connector)
add_subdirectory(src)
......
# Do not clean the generated configuration files in "make clean"
#
set_property(DIRECTORY PROPERTY CLEAN_NO_CUSTOM 1)
execute_process(COMMAND ${CMAKE_COMMAND} -E touch_nocreate
${CMAKE_SOURCE_DIR}/cfg/prscfg.h
${CMAKE_SOURCE_DIR}/cfg/prscfg.c)
add_custom_command(
OUTPUT ${CMAKE_SOURCE_DIR}/cfg/prscfg.h
${CMAKE_SOURCE_DIR}/cfg/prscfg.c
COMMAND ${ECHO} '%{' > tmp.cfg
COMMAND ${ECHO} '\#include \"cfg/warning.h\"' >> tmp.cfg
COMMAND ${ECHO} '%}' >> tmp.cfg
COMMAND ${CAT} ${CMAKE_SOURCE_DIR}/cfg/core_cfg.cfg_tmpl >> tmp.cfg
COMMAND ${CONFETTI} -i tmp.cfg -n tarantool_cfg
-H ${CMAKE_SOURCE_DIR}/cfg/prscfg.h
-p ${CMAKE_SOURCE_DIR}/cfg/prscfg.c
COMMAND ${CMAKE_COMMAND} -E remove tmp.cfg
DEPENDS ${CMAKE_SOURCE_DIR}/cfg/warning.h)
#
# Optionally rebuild the configuration file parsing code from
# templates.
#
macro(generate_mod_config mod)
# Gracefully handle out-of-source builds with missing
# 'confetti'. Make sure that generated files are older than
# their sources when configuring the project.
execute_process(COMMAND ${CMAKE_COMMAND} -E touch_nocreate
${CMAKE_SOURCE_DIR}/cfg/tarantool_${mod}_cfg.h
${CMAKE_SOURCE_DIR}/cfg/tarantool_${mod}_cfg.c)
add_custom_command(
OUTPUT ${CMAKE_SOURCE_DIR}/cfg/tarantool_${mod}_cfg.h
${CMAKE_SOURCE_DIR}/cfg/tarantool_${mod}_cfg.c
COMMAND ${ECHO} '%{' > ${mod}_tmp.cfg
COMMAND ${ECHO} '\#include \"cfg/warning.h\"' >> ${mod}_tmp.cfg
COMMAND ${ECHO} '\#include \"cfg/tarantool_${mod}_cfg.h\"' >> ${mod}_tmp.cfg
COMMAND ${ECHO} '%}' >> ${mod}_tmp.cfg
COMMAND ${CAT} ${CMAKE_SOURCE_DIR}/cfg/core_cfg.cfg_tmpl >> ${mod}_tmp.cfg
COMMAND ${CONFETTI} -i ${mod}_tmp.cfg -n tarantool_cfg
-c ${CMAKE_SOURCE_DIR}/cfg/tarantool_${mod}_cfg.c
-h ${CMAKE_SOURCE_DIR}/cfg/tarantool_${mod}_cfg.h
COMMAND ${CMAKE_COMMAND} -E remove ${mod}_tmp.cfg
DEPENDS ${CMAKE_SOURCE_DIR}/cfg/core_cfg.cfg_tmpl
${CMAKE_SOURCE_DIR}/cfg/warning.h
)
endmacro()
foreach (mod ${TARANTOOL_MODULES})
generate_mod_config(${mod})
set (generated_headers ${generated_headers}
${CMAKE_SOURCE_DIR}/cfg/tarantool_${mod}_cfg.h)
endforeach()
set_source_files_properties(${CMAKE_SOURCE_DIR}/cfg/prscfg.c
PROPERTIES COMPILE_FLAGS "-Wno-unused")
add_library(cfg prscfg.c warning.c)
#
# Make sure all generated headers are built before they are used.
# This is also necessary to avoid races in parallel make,
# when tmp.cfg is corrupted by two paralled targets.
# See http://www.cmake.org/Bug/view.php?id=10082 for details.
#
add_custom_target(config
DEPENDS ${CMAKE_SOURCE_DIR}/cfg/prscfg.h ${generated_headers})
# username to switch to
username=NULL, ro
# Local hot standby (if enabled, the server will run in hot
# standby mode, continuously fetching WAL records from wal_dir,
# until it is able to bind to the primary port.
# In local hot standby mode the server only accepts reads.
local_hot_standby=false, ro
# tarantool bind ip address, applies to primary port.
# INADDR_ANY is the default value.
bind_ipaddr="INADDR_ANY", ro
# save core on abort/assert
# deprecated; use ulimit instead
coredump=false, ro
# admin port
# used for admin's connections
admin_port=0, ro
# Log verbosity, possible values: SYS_ERROR = 1, ERROR=2, CRIT=3, WARN=4, INFO=5(default), DEBUG=6
log_level=5
# Size of slab arena in GB
slab_alloc_arena=1.0, ro
# Size of minimal allocation unit
slab_alloc_minimal=64, ro
# Growth factor, each subsequent unit size is factor * prev unit size
slab_alloc_factor=2.0, ro
# working directory (daemon will chdir(2) to it)
work_dir=NULL, ro
# Snapshot directory (where snapshots get saved/read)
snap_dir=".", ro
# WAL directory (where WALs get saved/read)
wal_dir=".", ro
# name of pid file
pid_file="tarantool.pid", ro
# logger command will be executed via /bin/sh -c {}
# example: 'exec cronolog /var/log/tarantool/%Y-%m/%Y-%m-%d/tarantool.log'
# example: 'exec extra/logger.pl /var/log/tarantool/tarantool.log'
# when logger is not configured all logging going to STDERR
logger=NULL, ro
#daemonize or not
background=false, ro
# make logging nonblocking, this potentially can lose some logging data
logger_nonblock=true, ro
# delay between loop iterations
io_collect_interval=0.0
# network io readahead
readahead=16320
# Do not write into snapshot faster than snap_io_rate_limit MB/sec
snap_io_rate_limit=0.0
# Write no more rows in WAL
rows_per_wal=500000, ro
# Defines fiber/data synchronization fsync(2) policy:
# "none": does not write to WAL
# "write": fibers wait for their data to be written to the log.
# "fsync": fibers wait for their data, fsync(2) follows each write(2)
# "fsync_delay": fibers wait for their data, fsync every N=wal_fsync_delay seconds,
# N=0.0 means no fsync (equivalent to wal_mode = "write");
wal_mode="fsync_delay"
# Fsync WAL delay, only issue fsync if last fsync was wal_fsync_delay
# seconds ago.
# WARNING: actually, several last requests may stall fsync for much longer
wal_fsync_delay=0.0
# Delay, in seconds, between successive re-readings of wal_dir.
# The re-scan is necessary to discover new WAL files or snapshots.
wal_dir_rescan_delay=0.1, ro
# Panic if there is an error reading a snapshot or WAL.
# By default, panic on any snapshot reading error and ignore errors
# when reading WALs.
panic_on_snap_error=true, ro
panic_on_wal_error=false, ro
## BOX
# Primary port (where updates are accepted)
primary_port=0, ro
# Warn about requests which take longer to process, in seconds.
too_long_threshold=0.5
# A custom process list (ps) title string, appended after the standard
# program title.
custom_proc_title=NULL, ro
# Replication mode (if enabled, the server, once
# bound to the primary port, will connect to
# replication_source (ipaddr:port) and run continously
# fetching records from it.. In replication mode the server
# only accepts reads.
replication_source=NULL
This diff is collapsed.
#ifndef PRSCFG_H
#define PRSCFG_H
#include <stdio.h>
typedef struct NameAtom {
char *name;
int index;
struct NameAtom *next;
} NameAtom;
typedef struct OptDef {
enum {
scalarType = 0,
structType = 1,
arrayType = 2
} paramType;
int optional;
union {
char *scalarval;
struct OptDef *structval;
struct OptDef *arrayval;
} paramValue;
NameAtom *name;
struct OptDef *parent;
struct OptDef *next;
} OptDef;
OptDef* parseCfgDef(FILE *fh, int *error);
OptDef* parseCfgDefBuffer(char *buffer, int *error);
void freeCfgDef(OptDef *def);
typedef enum ConfettyError {
CNF_OK = 0,
CNF_MISSED,
CNF_WRONGTYPE,
CNF_WRONGINDEX,
CNF_RDONLY,
CNF_WRONGINT,
CNF_WRONGRANGE,
CNF_NOMEMORY,
CNF_SYNTAXERROR,
CNF_NOTSET,
CNF_OPTIONAL,
CNF_INTERNALERROR
} ConfettyError;
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#ifndef TARANTOOL_WARNING_H
#define TARANTOOL_WARNING_H
#include "prscfg.h"
/** Begin logging - must be called before load_cfg() . */
extern FILE *cfg_out;
extern char *cfg_log;
extern size_t cfg_logsize;
void out_warning(ConfettyError r, const char *format, ...);
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment