Code Review
/
src
/
app-framework-binder.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
sig-monitor: Add compiling switches
[src/app-framework-binder.git]
/
src
/
afb-config.c
diff --git
a/src/afb-config.c
b/src/afb-config.c
index
669bbc5
..
87fad97
100644
(file)
--- a/
src/afb-config.c
+++ b/
src/afb-config.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (C) 2015-201
8
"IoT.bzh"
+ * Copyright (C) 2015-201
9
"IoT.bzh"
* Author José Bollo <jose.bollo@iot.bzh>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Author José Bollo <jose.bollo@iot.bzh>
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@
-107,9
+107,8
@@
#define SET_TRACEDITF 25
#define SET_TRACESVC 26
#endif
#define SET_TRACEDITF 25
#define SET_TRACESVC 26
#endif
-
-#define SET_TRAP_FAULTS 27
-
+#define SET_TRAP_FAULTS 27
+#define ADD_CALL 28
#if defined(WITH_DBUS_TRANSPARENCY)
# define ADD_DBUS_CLIENT 30
# define ADD_DBUS_SERVICE 31
#if defined(WITH_DBUS_TRANSPARENCY)
# define ADD_DBUS_CLIENT 30
# define ADD_DBUS_SERVICE 31
@@
-118,7
+117,7
@@
#define ADD_AUTO_API 'A'
#define ADD_BINDING 'b'
#define SET_CONFIG 'C'
#define ADD_AUTO_API 'A'
#define ADD_BINDING 'b'
#define SET_CONFIG 'C'
-#define
ADD_CALL
'c'
+#define
SET_COLOR
'c'
#define SET_DAEMON 'D'
#define SET_EXEC 'e'
#define GET_HELP 'h'
#define SET_DAEMON 'D'
#define SET_EXEC 'e'
#define GET_HELP 'h'
@@
-151,6
+150,7
@@
struct option_desc {
static struct option_desc optdefs[] = {
/* *INDENT-OFF* */
{SET_VERBOSE, 0, "verbose", "Verbose Mode, repeat to increase verbosity"},
static struct option_desc optdefs[] = {
/* *INDENT-OFF* */
{SET_VERBOSE, 0, "verbose", "Verbose Mode, repeat to increase verbosity"},
+ {SET_COLOR, 0, "color", "Colorize the ouput"},
{SET_QUIET, 0, "quiet", "Quiet Mode, repeat to decrease verbosity"},
{SET_LOG, 1, "log", "Tune log level"},
{SET_QUIET, 0, "quiet", "Quiet Mode, repeat to decrease verbosity"},
{SET_LOG, 1, "log", "Tune log level"},
@@
-366,7
+366,7
@@
static void printVersion(FILE * file)
AFB_VERSION
);
fprintf(file,
AFB_VERSION
);
fprintf(file,
- " Copyright (C) 2015-201
8
\"IoT.bzh\"\n"
+ " Copyright (C) 2015-201
9
\"IoT.bzh\"\n"
" AFB comes with ABSOLUTELY NO WARRANTY.\n"
" Licence Apache 2\n"
"\n");
" AFB comes with ABSOLUTELY NO WARRANTY.\n"
" Licence Apache 2\n"
"\n");
@@
-756,6
+756,10
@@
static void parse_arguments_inner(int argc, char **argv, struct json_object *con
verbose_inc();
break;
verbose_inc();
break;
+ case SET_COLOR:
+ verbose_colorize();
+ break;
+
case SET_QUIET:
verbose_dec();
break;
case SET_QUIET:
verbose_dec();
break;
@@
-965,7
+969,7
@@
void afb_config_dump(struct json_object *config)
static void on_environment(struct json_object *config, int optid, const char *name, void (*func)(struct json_object*, int, const char*))
{
static void on_environment(struct json_object *config, int optid, const char *name, void (*func)(struct json_object*, int, const char*))
{
- char *value = getenv(name);
+ char *value =
secure_
getenv(name);
if (value && *value)
func(config, optid, value);
if (value && *value)
func(config, optid, value);
@@
-973,7
+977,7
@@
static void on_environment(struct json_object *config, int optid, const char *na
static void on_environment_enum(struct json_object *config, int optid, const char *name, int (*func)(const char*))
{
static void on_environment_enum(struct json_object *config, int optid, const char *name, int (*func)(const char*))
{
- char *value = getenv(name);
+ char *value =
secure_
getenv(name);
if (value) {
if (func(value) == -1)
if (value) {
if (func(value) == -1)
@@
-985,7
+989,7
@@
static void on_environment_enum(struct json_object *config, int optid, const cha
static void on_environment_bool(struct json_object *config, int optid, const char *name)
{
static void on_environment_bool(struct json_object *config, int optid, const char *name)
{
- char *value = getenv(name);
+ char *value =
secure_
getenv(name);
int asbool;
if (value) {
int asbool;
if (value) {