Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cellframe-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
20
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cellframe
cellframe-sdk
Commits
d4e5af06
Commit
d4e5af06
authored
7 years ago
by
Dmitriy Gerasimov
Browse files
Options
Downloads
Patches
Plain Diff
[+] default value for string fetch function
parent
4c4c0039
No related branches found
No related tags found
1 merge request
!24
Support 3689
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/dap_config.c
+15
-1
15 additions, 1 deletion
core/dap_config.c
core/dap_config.h
+2
-0
2 additions, 0 deletions
core/dap_config.h
with
17 additions
and
1 deletion
core/dap_config.c
+
15
−
1
View file @
d4e5af06
...
@@ -252,6 +252,7 @@ int32_t dap_config_get_item_int32(dap_config_t * a_config, const char * a_sectio
...
@@ -252,6 +252,7 @@ int32_t dap_config_get_item_int32(dap_config_t * a_config, const char * a_sectio
return
0
;
return
0
;
}
}
/**
/**
* @brief dap_config_get_item_str
* @brief dap_config_get_item_str
* @param a_config
* @param a_config
...
@@ -260,6 +261,19 @@ int32_t dap_config_get_item_int32(dap_config_t * a_config, const char * a_sectio
...
@@ -260,6 +261,19 @@ int32_t dap_config_get_item_int32(dap_config_t * a_config, const char * a_sectio
* @return
* @return
*/
*/
const
char
*
dap_config_get_item_str
(
dap_config_t
*
a_config
,
const
char
*
a_section_path
,
const
char
*
a_item_name
)
const
char
*
dap_config_get_item_str
(
dap_config_t
*
a_config
,
const
char
*
a_section_path
,
const
char
*
a_item_name
)
{
return
dap_config_get_item_str_default
(
a_config
,
a_section_path
,
a_item_name
,
NULL
);
}
/**
* @brief dap_config_get_item_str_default
* @param a_config
* @param a_section_path
* @param a_item_name
* @param a_value_default
* @return
*/
const
char
*
dap_config_get_item_str_default
(
dap_config_t
*
a_config
,
const
char
*
a_section_path
,
const
char
*
a_item_name
,
const
char
*
a_value_default
)
{
{
dap_config_item_t
*
l_item_section
=
DAP_CONFIG_INTERNAL
(
a_config
)
->
item_root
;
dap_config_item_t
*
l_item_section
=
DAP_CONFIG_INTERNAL
(
a_config
)
->
item_root
;
while
(
l_item_section
){
while
(
l_item_section
){
...
@@ -274,7 +288,7 @@ const char * dap_config_get_item_str(dap_config_t * a_config, const char * a_sec
...
@@ -274,7 +288,7 @@ const char * dap_config_get_item_str(dap_config_t * a_config, const char * a_sec
}
}
l_item_section
=
l_item_section
->
item_next
;
l_item_section
=
l_item_section
->
item_next
;
}
}
return
NULL
;
return
a_value_default
;
}
}
/**
/**
...
...
This diff is collapsed.
Click to expand it.
core/dap_config.h
+
2
−
0
View file @
d4e5af06
...
@@ -15,6 +15,8 @@ void dap_config_close(dap_config_t * a_config);
...
@@ -15,6 +15,8 @@ void dap_config_close(dap_config_t * a_config);
int32_t
dap_config_get_item_int32
(
dap_config_t
*
a_config
,
const
char
*
a_section_path
,
const
char
*
a_item_name
);
int32_t
dap_config_get_item_int32
(
dap_config_t
*
a_config
,
const
char
*
a_section_path
,
const
char
*
a_item_name
);
const
char
*
dap_config_get_item_str
(
dap_config_t
*
a_config
,
const
char
*
a_section_path
,
const
char
*
a_item_name
);
const
char
*
dap_config_get_item_str
(
dap_config_t
*
a_config
,
const
char
*
a_section_path
,
const
char
*
a_item_name
);
const
char
*
dap_config_get_item_str_default
(
dap_config_t
*
a_config
,
const
char
*
a_section_path
,
const
char
*
a_item_name
,
const
char
*
a_value_default
);
bool
dap_config_get_item_bool
(
dap_config_t
*
a_config
,
const
char
*
a_section_path
,
const
char
*
a_item_name
);
bool
dap_config_get_item_bool
(
dap_config_t
*
a_config
,
const
char
*
a_section_path
,
const
char
*
a_item_name
);
double
dap_config_get_item_double
(
dap_config_t
*
a_config
,
const
char
*
a_section_path
,
const
char
*
a_item_name
);
double
dap_config_get_item_double
(
dap_config_t
*
a_config
,
const
char
*
a_section_path
,
const
char
*
a_item_name
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment