Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
trackrdrd
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
trackrdrd
Commits
98612336
Commit
98612336
authored
Jun 19, 2014
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test_config: clarify some details about the CONF interface
parent
7941fbe6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
4 deletions
+14
-4
config_common.h
trackrdrd/include/config_common.h
+6
-3
test_config.c
trackrdrd/src/test/test_config.c
+1
-1
trackrdrd.h
trackrdrd/src/trackrdrd.h
+7
-0
No files found.
trackrdrd/include/config_common.h
View file @
98612336
...
@@ -34,8 +34,11 @@
...
@@ -34,8 +34,11 @@
* \brief Config handling interface
* \brief Config handling interface
* \details Common functions to get configuration data
* \details Common functions to get configuration data
*
*
* This header defines the functions the plugin uses to get its
* This header defines the functions used to get configuration data.
* configuration data.
*
* If the conf_add() callback returns non-zero, CONF_ReadFile() prints
* an error message to `stderr` assuming that the return value is an
* errno value.
*/
*/
...
@@ -44,7 +47,7 @@
...
@@ -44,7 +47,7 @@
*
*
* @param lval key
* @param lval key
* @param rval value
* @param rval value
* @return 0 on success, an err
or
value on failure
* @return 0 on success, an err
no
value on failure
*/
*/
typedef
int
conf_add_f
(
const
char
*
lval
,
const
char
*
rval
);
typedef
int
conf_add_f
(
const
char
*
lval
,
const
char
*
rval
);
...
...
trackrdrd/src/test/test_config.c
View file @
98612336
...
@@ -183,7 +183,7 @@ static char
...
@@ -183,7 +183,7 @@ static char
TEST_catchStderrStart
();
TEST_catchStderrStart
();
err
=
CONF_ReadFile
(
confName
,
CONF_Add
);
err
=
CONF_ReadFile
(
confName
,
CONF_Add
);
TEST_catchStderrEnd
();
TEST_catchStderrEnd
();
VMASSERT
(
err
==
-
1
,
"Wrong error code during reading config
\"
%s
\"
: %i"
,
VMASSERT
(
err
<
0
,
"Wrong error code during reading config
\"
%s
\"
: %i"
,
confName
,
err
);
confName
,
err
);
err
=
TEST_stderrEquals
(
errmsg
);
err
=
TEST_stderrEquals
(
errmsg
);
VMASSERT
(
err
==
0
,
VMASSERT
(
err
==
0
,
...
...
trackrdrd/src/trackrdrd.h
View file @
98612336
...
@@ -331,6 +331,13 @@ struct config {
...
@@ -331,6 +331,13 @@ struct config {
void
CONF_Init
(
void
);
void
CONF_Init
(
void
);
int
CONF_Add
(
const
char
*
lval
,
const
char
*
rval
);
int
CONF_Add
(
const
char
*
lval
,
const
char
*
rval
);
/**
* Reads the default config file `/etc/trackrdrd.conf`, if present
*
* @returns 0 if the file does not exist or was successfully read,
* >0 (errno) if the file exists but cannot be read,
* <0 if the file was read but the contents could not be processed
*/
int
CONF_ReadDefault
(
void
);
int
CONF_ReadDefault
(
void
);
void
CONF_Dump
(
void
);
void
CONF_Dump
(
void
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment