Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libdap
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
cellframe
libdap
Commits
fadec6d1
Commit
fadec6d1
authored
5 years ago
by
dmitriy.gerasimov
Browse files
Options
Downloads
Patches
Plain Diff
[+] Global config variable
[+] int128_t and uint128_t
parent
ecb057b2
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
core/dap_config.c
+28
-0
28 additions, 0 deletions
core/dap_config.c
core/dap_config.h
+7
-0
7 additions, 0 deletions
core/dap_config.h
core/dap_math_ops.h
+6
-0
6 additions, 0 deletions
core/dap_math_ops.h
with
41 additions
and
0 deletions
core/dap_config.c
+
28
−
0
View file @
fadec6d1
...
...
@@ -9,6 +9,8 @@
#define LOG_TAG "dap_config"
dap_config_t
*
g_config
=
NULL
;
/**
* @brief The dap_config_item struct
*/
...
...
@@ -336,6 +338,18 @@ int32_t dap_config_get_item_int32(dap_config_t * a_config, const char * a_sectio
return
atoi
(
dap_config_get_item_str
(
a_config
,
a_section_path
,
a_item_name
));
}
/**
* @brief dap_config_get_item_int64
* @param a_config
* @param a_section_path
* @param a_item_name
* @return
*/
int64_t
dap_config_get_item_int64
(
dap_config_t
*
a_config
,
const
char
*
a_section_path
,
const
char
*
a_item_name
)
{
return
atoll
(
dap_config_get_item_str
(
a_config
,
a_section_path
,
a_item_name
));
}
/**
* @brief dap_config_get_item_uint16
* @param a_config
...
...
@@ -377,6 +391,20 @@ uint16_t dap_config_get_item_uint16_default(dap_config_t * a_config, const char
return
l_str_ret
?
(
uint16_t
)
atoi
(
l_str_ret
)
:
a_default
;
}
/**
* @brief dap_config_get_item_int64_default
* @param a_config
* @param a_section_path
* @param a_item_name
* @param a_default
* @return
*/
int64_t
dap_config_get_item_int64_default
(
dap_config_t
*
a_config
,
const
char
*
a_section_path
,
const
char
*
a_item_name
,
int64_t
a_default
)
{
const
char
*
l_str_ret
=
dap_config_get_item_str
(
a_config
,
a_section_path
,
a_item_name
);
return
l_str_ret
?
(
int64_t
)
atoll
(
l_str_ret
)
:
a_default
;
}
/**
* @brief dap_config_get_item Get the configuration as a item
...
...
This diff is collapsed.
Click to expand it.
core/dap_config.h
+
7
−
0
View file @
fadec6d1
...
...
@@ -50,6 +50,10 @@ uint16_t dap_config_get_item_uint16_default(dap_config_t * a_config, const char
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_default
(
dap_config_t
*
a_config
,
const
char
*
a_section_path
,
const
char
*
a_item_name
,
int32_t
a_default
);
int64_t
dap_config_get_item_int64
(
dap_config_t
*
a_config
,
const
char
*
a_section_path
,
const
char
*
a_item_name
);
int64_t
dap_config_get_item_int64_default
(
dap_config_t
*
a_config
,
const
char
*
a_section_path
,
const
char
*
a_item_name
,
int64_t
a_default
);
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
);
char
**
dap_config_get_array_str
(
dap_config_t
*
a_config
,
const
char
*
a_section_path
,
...
...
@@ -61,6 +65,9 @@ bool dap_config_get_item_bool_default(dap_config_t * a_config, const char * a_se
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_default
(
dap_config_t
*
a_config
,
const
char
*
a_section_path
,
const
char
*
a_item_name
,
double
a_default
);
extern
dap_config_t
*
g_config
;
#ifdef __cplusplus
}
#endif
...
...
This diff is collapsed.
Click to expand it.
core/dap_math_ops.h
+
6
−
0
View file @
fadec6d1
...
...
@@ -9,6 +9,12 @@
#define DAP_GLOBAL_IS_INT128
typedef
__int128
_dap_int128_t
;
#if !defined (int128_t)
typedef
__int128
int128_t
;
#endif
#if !defined (uint128_t)
typedef
unsigned
__int128
uint128_t
;
#endif
#endif
#endif
...
...
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