diff options
Diffstat (limited to 'utils')
-rw-r--r-- | utils/Makefile | 52 | ||||
-rw-r--r-- | utils/ael_main.c | 10 | ||||
-rw-r--r-- | utils/astman.c | 2 | ||||
-rw-r--r-- | utils/extconf.c | 73 |
4 files changed, 30 insertions, 107 deletions
diff --git a/utils/Makefile b/utils/Makefile index ee8572a29..e7a8a0188 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -16,8 +16,9 @@ ASTTOPDIR?=.. .PHONY: clean all uninstall -# to get check_expr, add it to the ALL_UTILS list -ALL_UTILS:=astman smsq stereorize streamplayer aelparse muted check_expr conf2ael hashtest2 hashtest astcanary refcounter +ALL_UTILS:=astman smsq stereorize streamplayer muted check_expr hashtest2 hashtest astcanary refcounter +# aelparse and conf2ael currently not being built because they rely on extconf, which is horribly broken +# ALL_UTILS:=aelparse conf2ael UTILS:=$(ALL_UTILS) LIBS += $(BKTR_LIB) # astobj2 with devmode uses backtrace @@ -80,89 +81,86 @@ clean: md5.c: $(ASTTOPDIR)/main/md5.c @cp $< $@ +md5.o: ASTCFLAGS+=-DSTANDALONE + astman: astman.o md5.o astman: LIBS+=$(NEWT_LIB) +astman.o: ASTCFLAGS+=-DSTANDALONE stereorize: stereorize.o frame.o stereorize: LIBS+=-lm hashtab.c: $(ASTTOPDIR)/main/hashtab.c @cp $< $@ +hashtab.o: ASTCFLAGS+=-DSTANDALONE strcompat.c: $(ASTTOPDIR)/main/strcompat.c @cp $< $@ - -$(ASTTOPDIR)/main/ast_expr2.c: - @echo " [BISON] $(ASTTOPDIR)/main/ast_expr2.y -> $@" - @bison -o $@ -d --name-prefix=ast_yy $(ASTTOPDIR)/main/ast_expr2.y - -$(ASTTOPDIR)/main/ast_expr2f.c: - @echo " [FLEX] $(ASTTOPDIR)/main/ast_expr2.fl -> $@" - @flex -o $@ --full $(ASTTOPDIR)/main/ast_expr2.fl +strcompat.o: ASTCFLAGS+=-DSTANDALONE pval.c: $(ASTTOPDIR)/res/ael/pval.c @cp $< $@ +pval.o : ASTCFLAGS+=-DSTANDALONE ast_expr2.c: $(ASTTOPDIR)/main/ast_expr2.c @cp $< $@ +ast_expr2.o: ASTCFLAGS+=-DSTANDALONE ast_expr2f.c: $(ASTTOPDIR)/main/ast_expr2f.c @cp $< $@ - -ast_expr2f.o: ASTCFLAGS+=-DSTANDALONE_AEL -I$(ASTTOPDIR)/main -Wno-unused - -pval.o : ASTCFLAGS+=-DSTANDALONE +ast_expr2f.o: ASTCFLAGS+=-DSTANDALONE -I$(ASTTOPDIR)/main -Wno-unused check_expr: check_expr.o ast_expr2.o ast_expr2f.o strcompat.o threadstorage.o clicompat.o +check_expr.o: ASTCFLAGS+=-DSTANDALONE aelbison.c: $(ASTTOPDIR)/res/ael/ael.tab.c @cp $< $@ - -aelbison.o: ASTCFLAGS+=-I$(ASTTOPDIR)/res/ael -DYYENABLE_NLS=0 +aelbison.o: ASTCFLAGS+=-I$(ASTTOPDIR)/res/ael -DYYENABLE_NLS=0 -DSTANDALONE pbx_ael.c: $(ASTTOPDIR)/pbx/pbx_ael.c @cp $< $@ - -pbx_ael.o: ASTCFLAGS+=-DSTANDALONE_AEL +pbx_ael.o: ASTCFLAGS+=-DSTANDALONE aelparse.c: $(ASTTOPDIR)/res/ael/ael_lex.c @cp $< $@ -aelparse.o: ASTCFLAGS+=-I$(ASTTOPDIR)/res -DSTANDALONE_AEL -Wno-unused +ael_main.o: ASTCFLAGS+=-DSTANDALONE +aelparse.o: ASTCFLAGS+=-I$(ASTTOPDIR)/res -DSTANDALONE -Wno-unused aelparse: aelparse.o aelbison.o pbx_ael.o hashtab.o ael_main.o ast_expr2f.o ast_expr2.o strcompat.o pval.o extconf.o astobj2.c: $(ASTTOPDIR)/main/astobj2.c @cp $< $@ +astobj2.o: ASTCFLAGS+=-DSTANDALONE utils.c: $(ASTTOPDIR)/main/utils.c @cp $< $@ +utils.o: ASTCFLAGS+=-DSTANDALONE sha1.c: $(ASTTOPDIR)/main/sha1.c @cp $< $@ +sha1.o: ASTCFLAGS+=-DSTANDALONE threadstorage.c: $(ASTTOPDIR)/main/threadstorage.c @cp $< $@ +threadstorage.o: ASTCFLAGS+=-DSTANDALONE -hashtest2.o: ASTCFLAGS+=-O0 - +hashtest2.o: ASTCFLAGS+=-O0 -DSTANDALONE hashtest2: hashtest2.o md5.o utils.o astobj2.o sha1.o strcompat.o threadstorage.o clicompat.o hashtest: hashtest.o md5.o hashtab.o utils.o sha1.o strcompat.o threadstorage.o clicompat.o - -hashtest.o: ASTCFLAGS+=-O0 +hashtest.o: ASTCFLAGS+=-O0 -DSTANDALONE refcounter: refcounter.o md5.o hashtab.o utils.o sha1.o strcompat.o threadstorage.o clicompat.o - -refcounter.o: ASTCFLAGS+=-O0 +refcounter.o: ASTCFLAGS+=-O0 -DSTANDALONE extconf.o: extconf.c conf2ael: conf2ael.o ast_expr2f.o ast_expr2.o hashtab.o aelbison.o aelparse.o pbx_ael.o pval.o extconf.o strcompat.o testexpr2s: $(ASTTOPDIR)/main/ast_expr2f.c $(ASTTOPDIR)/main/ast_expr2.c $(ASTTOPDIR)/main/ast_expr2.h - $(CC) -g -c -I$(ASTTOPDIR)/include -DSTANDALONE_AEL $(ASTTOPDIR)/main/ast_expr2f.c -o ast_expr2f.o - $(CC) -g -c -I$(ASTTOPDIR)/include -DSTANDALONE_AEL $(ASTTOPDIR)/main/ast_expr2.c -o ast_expr2.o + $(CC) -g -c -I$(ASTTOPDIR)/include -DSTANDALONE $(ASTTOPDIR)/main/ast_expr2f.c -o ast_expr2f.o + $(CC) -g -c -I$(ASTTOPDIR)/include -DSTANDALONE $(ASTTOPDIR)/main/ast_expr2.c -o ast_expr2.o $(CC) -g -o testexpr2s ast_expr2f.o ast_expr2.o rm ast_expr2.o ast_expr2f.o ./testexpr2s expr2.testinput diff --git a/utils/ael_main.c b/utils/ael_main.c index 6ef84cbcf..2178525a4 100644 --- a/utils/ael_main.c +++ b/utils/ael_main.c @@ -169,16 +169,6 @@ struct ast_custom_function *ast_custom_function_find(const char *name) return 0; /* in "standalone" mode, functions are just not avail */ } -void ast_register_file_version(const char *file, const char *version); -void ast_register_file_version(const char *file, const char *version) -{ -} - -void ast_unregister_file_version(const char *file); -void ast_unregister_file_version(const char *file) -{ -} - #if !defined(LOW_MEMORY) int ast_add_profile(const char *x, uint64_t scale) { diff --git a/utils/astman.c b/utils/astman.c index a8b8e597a..e8d3c4d9e 100644 --- a/utils/astman.c +++ b/utils/astman.c @@ -24,6 +24,8 @@ #include "asterisk.h" ASTERISK_FILE_VERSION(__FILE__, "$Revision$") +#include "asterisk.h" + #include <newt.h> #include <stdio.h> #include <sys/time.h> diff --git a/utils/extconf.c b/utils/extconf.c index 2a492d778..4353ba7be 100644 --- a/utils/extconf.c +++ b/utils/extconf.c @@ -23,6 +23,8 @@ * for operations outside of asterisk. A huge, awful hack. * */ +#include "asterisk.h" + #undef DEBUG_THREADS #include "asterisk/compat.h" @@ -81,12 +83,6 @@ struct ast_channel #define VERBOSE_PREFIX_3 " -- " #define VERBOSE_PREFIX_4 " > " -/* IN CONFLICT: void ast_log(int level, const char *file, int line, const char *function, const char *fmt, ...) - __attribute__ ((format (printf, 5, 6))); */ - -static void ast_log(int level, const char *file, int line, const char *function, const char *fmt, ...) __attribute__ ((format (printf,5,6))); - - void ast_backtrace(void); void ast_queue_log(const char *queuename, const char *callid, const char *agent, const char *event, const char *fmt, ...) @@ -100,9 +96,6 @@ int ast_unregister_verbose(void (*verboser)(const char *string)); void ast_console_puts(const char *string); -void ast_console_puts_mutable(const char *string); -void ast_console_toggle_mute(int fd); - #define _A_ __FILE__, __LINE__, __PRETTY_FUNCTION__ #ifdef LOG_DEBUG @@ -1767,56 +1760,6 @@ static void ast_config_destroy(struct ast_config *cfg) #define AST_CACHE_DIR_LEN 512 #define AST_FILENAME_MAX 80 -/*! \ingroup main_options */ -enum ast_option_flags { - /*! Allow \#exec in config files */ - AST_OPT_FLAG_EXEC_INCLUDES = (1 << 0), - /*! Do not fork() */ - AST_OPT_FLAG_NO_FORK = (1 << 1), - /*! Keep quiet */ - AST_OPT_FLAG_QUIET = (1 << 2), - /*! Console mode */ - AST_OPT_FLAG_CONSOLE = (1 << 3), - /*! Run in realtime Linux priority */ - AST_OPT_FLAG_HIGH_PRIORITY = (1 << 4), - /*! Initialize keys for RSA authentication */ - AST_OPT_FLAG_INIT_KEYS = (1 << 5), - /*! Remote console */ - AST_OPT_FLAG_REMOTE = (1 << 6), - /*! Execute an asterisk CLI command upon startup */ - AST_OPT_FLAG_EXEC = (1 << 7), - /*! Don't use termcap colors */ - AST_OPT_FLAG_NO_COLOR = (1 << 8), - /*! Are we fully started yet? */ - AST_OPT_FLAG_FULLY_BOOTED = (1 << 9), - /*! Trascode via signed linear */ - AST_OPT_FLAG_TRANSCODE_VIA_SLIN = (1 << 10), - /*! Enable priority jumping in applications */ - AST_OPT_FLAG_PRIORITY_JUMPING = (1 << 11), - /*! Dump core on a seg fault */ - AST_OPT_FLAG_DUMP_CORE = (1 << 12), - /*! Cache sound files */ - AST_OPT_FLAG_CACHE_RECORD_FILES = (1 << 13), - /*! Display timestamp in CLI verbose output */ - AST_OPT_FLAG_TIMESTAMP = (1 << 14), - /*! Override config */ - AST_OPT_FLAG_OVERRIDE_CONFIG = (1 << 15), - /*! Reconnect */ - AST_OPT_FLAG_RECONNECT = (1 << 16), - /*! Transmit Silence during Record() */ - AST_OPT_FLAG_TRANSMIT_SILENCE = (1 << 17), - /*! Suppress some warnings */ - AST_OPT_FLAG_DONT_WARN = (1 << 18), - /*! End CDRs before the 'h' extension */ - AST_OPT_FLAG_END_CDR_BEFORE_H_EXTEN = (1 << 19), - /*! Use DAHDI Timing for generators if available */ - AST_OPT_FLAG_INTERNAL_TIMING = (1 << 20), - /*! Always fork, even if verbose or debug settings are non-zero */ - AST_OPT_FLAG_ALWAYS_FORK = (1 << 21), - /*! Disable log/verbose output to remote consoles */ - AST_OPT_FLAG_MUTE = (1 << 22) -}; - /*! These are the options that set by default when Asterisk starts */ #define AST_DEFAULT_OPTIONS AST_OPT_FLAG_TRANSCODE_VIA_SLIN @@ -1850,8 +1793,6 @@ extern int option_maxcalls; /*!< Maximum number of simultaneous channels */ extern double option_maxload; extern char defaultlanguage[]; -extern time_t ast_startuptime; -extern time_t ast_lastreloadtime; extern pid_t ast_mainpid; extern char record_cache_dir[AST_CACHE_DIR_LEN]; @@ -2706,14 +2647,6 @@ static const char *ast_var_name(const struct ast_var_t *var) return name; } - -/* stolen from asterisk.c */ - -static struct ast_flags ast_options = { AST_DEFAULT_OPTIONS }; -static int option_verbose = 0; /*!< Verbosity level */ -static int option_debug = 0; /*!< Debug level */ - - /* experiment 1: see if it's easier just to use existing config code * to read in the extensions.conf file. In this scenario, I have to rip/copy code from other modules, because they @@ -2735,7 +2668,7 @@ static void ast_log(int level, const char *file, int line, const char *function, va_end(vars); } -static void __attribute__((format (printf, 1, 2))) ast_verbose(const char *fmt, ...) +void __attribute__((format (printf, 1, 2))) ast_verbose(const char *fmt, ...) { va_list vars; va_start(vars,fmt); |