Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libconfig
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
libconfig
Commits
60d27aba
Commit
60d27aba
authored
Dec 17, 2019
by
Mark Lindner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prefix more internal functions with 'libconfig_'
parent
18193744
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
37 additions
and
35 deletions
+37
-35
examples/c++/example1.cpp
examples/c++/example1.cpp
+0
-4
lib/libconfig.c
lib/libconfig.c
+4
-4
lib/scanctx.c
lib/scanctx.c
+2
-2
lib/scanner.c
lib/scanner.c
+15
-12
lib/scanner.h
lib/scanner.h
+1
-1
lib/scanner.l
lib/scanner.l
+5
-2
lib/util.c
lib/util.c
+5
-5
lib/util.h
lib/util.h
+5
-5
No files found.
examples/c++/example1.cpp
View file @
60d27aba
...
...
@@ -52,10 +52,6 @@ int main(int argc, char **argv)
return
(
EXIT_FAILURE
);
}
string
tmp
;
cfg
.
lookupValue
(
"name"
,
tmp
);
std
::
cout
<<
"name: "
<<
tmp
<<
std
::
endl
;
// Get the store name.
try
{
...
...
lib/libconfig.c
View file @
60d27aba
...
...
@@ -212,8 +212,8 @@ static void __config_write_value(const config_t *config,
{
const
int
sci_ok
=
config_get_option
(
config
,
CONFIG_OPTION_ALLOW_SCIENTIFIC_NOTATION
);
format_double
(
value
->
fval
,
config
->
float_precision
,
sci_ok
,
fbuf
,
sizeof
(
fbuf
));
__libconfig_format_double
(
value
->
fval
,
config
->
float_precision
,
sci_ok
,
fbuf
,
sizeof
(
fbuf
));
fputs
(
fbuf
,
stream
);
break
;
}
...
...
@@ -719,7 +719,7 @@ int config_write_file(config_t *config, const char *filename)
void
config_destroy
(
config_t
*
config
)
{
__config_setting_destroy
(
config
->
root
);
__delete_vec
(
config
->
filenames
);
__
libconfig_
delete_vec
(
config
->
filenames
);
__delete
(
config
->
include_dir
);
__zero
(
config
);
}
...
...
@@ -730,7 +730,7 @@ void config_clear(config_t *config)
{
/* Destroy the root setting (recursively) and then create a new one. */
__config_setting_destroy
(
config
->
root
);
__delete_vec
(
config
->
filenames
);
__
libconfig_
delete_vec
(
config
->
filenames
);
config
->
root
=
__new
(
config_setting_t
);
config
->
root
->
type
=
CONFIG_TYPE_GROUP
;
...
...
lib/scanctx.c
View file @
60d27aba
...
...
@@ -89,13 +89,13 @@ FILE *libconfig_scanctx_push_include(struct scan_context *ctx, void *prev_buffer
if
(
*
error
||
!
files
)
{
__delete_vec
(
files
);
__
libconfig_
delete_vec
(
files
);
return
(
NULL
);
}
if
(
!*
files
)
{
__delete_vec
(
files
);
__
libconfig_
delete_vec
(
files
);
return
(
NULL
);
}
...
...
lib/scanner.c
View file @
60d27aba
...
...
@@ -1351,7 +1351,7 @@ YY_RULE_SETUP
#line 138 "scanner.l"
{
int
ok
;
long
long
llval
=
parse_integer
(
yytext
,
&
ok
);
long
long
llval
=
__libconfig_
parse_integer
(
yytext
,
&
ok
);
if
(
!
ok
)
return
(
TOK_ERROR
);
...
...
@@ -1383,36 +1383,39 @@ YY_RULE_SETUP
case
37
:
YY_RULE_SETUP
#line 160 "scanner.l"
{
yylval
->
llval
=
parse_hex64
(
yytext
);
return
(
TOK_HEX64
);
}
{
yylval
->
llval
=
__libconfig_parse_hex64
(
yytext
);
return
(
TOK_HEX64
);
}
YY_BREAK
case
38
:
YY_RULE_SETUP
#line 16
1
"scanner.l"
#line 16
4
"scanner.l"
{
return
(
TOK_ARRAY_START
);
}
YY_BREAK
case
39
:
YY_RULE_SETUP
#line 16
2
"scanner.l"
#line 16
5
"scanner.l"
{
return
(
TOK_ARRAY_END
);
}
YY_BREAK
case
40
:
YY_RULE_SETUP
#line 16
3
"scanner.l"
#line 16
6
"scanner.l"
{
return
(
TOK_LIST_START
);
}
YY_BREAK
case
41
:
YY_RULE_SETUP
#line 16
4
"scanner.l"
#line 16
7
"scanner.l"
{
return
(
TOK_LIST_END
);
}
YY_BREAK
case
42
:
YY_RULE_SETUP
#line 16
5
"scanner.l"
#line 16
8
"scanner.l"
{
return
(
TOK_SEMICOLON
);
}
YY_BREAK
case
43
:
YY_RULE_SETUP
#line 16
6
"scanner.l"
#line 16
9
"scanner.l"
{
return
(
TOK_GARBAGE
);
}
YY_BREAK
case
YY_STATE_EOF
(
INITIAL
):
...
...
@@ -1420,7 +1423,7 @@ case YY_STATE_EOF(SINGLE_LINE_COMMENT):
case
YY_STATE_EOF
(
MULTI_LINE_COMMENT
):
case
YY_STATE_EOF
(
STRING
):
case
YY_STATE_EOF
(
INCLUDE
):
#line 1
68
"scanner.l"
#line 1
71
"scanner.l"
{
const
char
*
error
=
NULL
;
FILE
*
fp
;
...
...
@@ -1456,10 +1459,10 @@ case YY_STATE_EOF(INCLUDE):
YY_BREAK
case
44
:
YY_RULE_SETUP
#line 20
0
"scanner.l"
#line 20
3
"scanner.l"
ECHO
;
YY_BREAK
#line 146
2
"scanner.c"
#line 146
5
"scanner.c"
case
YY_END_OF_BUFFER
:
{
...
...
@@ -2610,4 +2613,4 @@ void yyfree (void * ptr , yyscan_t yyscanner)
#define YYTABLES_NAME "yytables"
#line 20
0
"scanner.l"
#line 20
3
"scanner.l"
lib/scanner.h
View file @
60d27aba
...
...
@@ -712,7 +712,7 @@ extern int yylex \
#undef yyTABLES_NAME
#endif
#line 20
0
"scanner.l"
#line 20
3
"scanner.l"
#line 717 "scanner.h"
#undef libconfig_yyIN_HEADER
...
...
lib/scanner.l
View file @
60d27aba
...
...
@@ -137,7 +137,7 @@ include_open ^[ \t]*@include[ \t]+\"
{float} { yylval->fval = atof(yytext); return(TOK_FLOAT); }
{integer} {
int ok;
long long llval = parse_integer(yytext, &ok);
long long llval =
__libconfig_
parse_integer(yytext, &ok);
if(!ok)
return(TOK_ERROR);
...
...
@@ -157,7 +157,10 @@ include_open ^[ \t]*@include[ \t]+\"
yylval->ival = strtoul(yytext, NULL, 16);
return(TOK_HEX);
}
{hex64} { yylval->llval = parse_hex64(yytext); return(TOK_HEX64); }
{hex64} {
yylval->llval = __libconfig_parse_hex64(yytext);
return(TOK_HEX64);
}
\[ { return(TOK_ARRAY_START); }
\] { return(TOK_ARRAY_END); }
\( { return(TOK_LIST_START); }
...
...
lib/util.c
View file @
60d27aba
...
...
@@ -30,7 +30,7 @@
/* ------------------------------------------------------------------------- */
void
__delete_vec
(
const
char
*
const
*
v
)
void
__
libconfig_
delete_vec
(
const
char
*
const
*
v
)
{
const
char
*
const
*
p
;
...
...
@@ -44,7 +44,7 @@ void __delete_vec(const char *const *v)
/* ------------------------------------------------------------------------- */
long
long
parse_integer
(
const
char
*
s
,
int
*
ok
)
long
long
__libconfig_
parse_integer
(
const
char
*
s
,
int
*
ok
)
{
long
long
llval
;
char
*
endptr
;
...
...
@@ -65,7 +65,7 @@ long long parse_integer(const char *s, int *ok)
/* ------------------------------------------------------------------------- */
unsigned
long
long
parse_hex64
(
const
char
*
s
)
unsigned
long
long
__libconfig_
parse_hex64
(
const
char
*
s
)
{
#ifdef __MINGW32__
...
...
@@ -101,8 +101,8 @@ unsigned long long parse_hex64(const char *s)
/* ------------------------------------------------------------------------- */
void
format_double
(
double
val
,
int
precision
,
int
sci_ok
,
char
*
buf
,
size_t
buflen
)
void
__libconfig_
format_double
(
double
val
,
int
precision
,
int
sci_ok
,
char
*
buf
,
size_t
buflen
)
{
const
char
*
fmt
=
sci_ok
?
"%.*g"
:
"%.*f"
;
char
*
p
,
*
q
;
...
...
lib/util.h
View file @
60d27aba
...
...
@@ -27,11 +27,11 @@
#define __delete(P) free((void *)(P))
#define __zero(P) memset((void *)(P), 0, sizeof(*P))
extern
void
__delete_vec
(
const
char
*
const
*
v
);
extern
void
__
libconfig_
delete_vec
(
const
char
*
const
*
v
);
extern
long
long
parse_integer
(
const
char
*
s
,
int
*
ok
);
extern
unsigned
long
long
parse_hex64
(
const
char
*
s
);
extern
long
long
__libconfig_
parse_integer
(
const
char
*
s
,
int
*
ok
);
extern
unsigned
long
long
__libconfig_
parse_hex64
(
const
char
*
s
);
extern
void
format_double
(
double
val
,
int
precision
,
int
sci_ok
,
char
*
buf
,
size_t
buflen
);
extern
void
__libconfig_format_double
(
double
val
,
int
precision
,
int
sci_ok
,
char
*
buf
,
size_t
buflen
);
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