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
16
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
a0d70f42
Commit
a0d70f42
authored
4 years ago
by
dmitriy.gerasimov
Browse files
Options
Downloads
Plain Diff
Merge branch 'feature-4142' into 'master'
Feature 4142 See merge request
!264
parents
f3e9ffdb
979e1634
No related branches found
No related tags found
1 merge request
!264
Feature 4142
Pipeline
#6664
passed with stage
Stage: analyze
in 15 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dap-sdk/core/include/dap_file_utils.h
+1
-0
1 addition, 0 deletions
dap-sdk/core/include/dap_file_utils.h
dap-sdk/core/src/dap_file_utils.c
+28
-0
28 additions, 0 deletions
dap-sdk/core/src/dap_file_utils.c
with
29 additions
and
0 deletions
dap-sdk/core/include/dap_file_utils.h
+
1
−
0
View file @
a0d70f42
...
@@ -100,6 +100,7 @@ int dap_mkdir_with_parents(const char *a_dir_path);
...
@@ -100,6 +100,7 @@ int dap_mkdir_with_parents(const char *a_dir_path);
char
*
dap_path_get_basename
(
const
char
*
a_file_name
);
char
*
dap_path_get_basename
(
const
char
*
a_file_name
);
bool
dap_path_is_absolute
(
const
char
*
a_file_name
);
bool
dap_path_is_absolute
(
const
char
*
a_file_name
);
char
*
dap_path_get_dirname
(
const
char
*
a_file_name
);
char
*
dap_path_get_dirname
(
const
char
*
a_file_name
);
const
char
*
dap_path_get_ext
(
const
char
*
a_filename
);
/**
/**
* Get list of subdirectories
* Get list of subdirectories
...
...
This diff is collapsed.
Click to expand it.
dap-sdk/core/src/dap_file_utils.c
+
28
−
0
View file @
a0d70f42
...
@@ -409,6 +409,34 @@ dap_list_name_directories_t *dap_get_subs(const char *a_path_dir){
...
@@ -409,6 +409,34 @@ dap_list_name_directories_t *dap_get_subs(const char *a_path_dir){
return
list
;
return
list
;
}
}
/**
* dap_path_get_ext:
* @a_file_name: the name of the file
*
* Gets the extension components of a file name.
*
* Returns: the extension components of the file
*/
const
char
*
dap_path_get_ext
(
const
char
*
a_filename
)
{
size_t
l_len
=
dap_strlen
(
a_filename
);
const
char
*
l_p
=
a_filename
+
l_len
-
1
;
if
(
l_len
<
2
)
return
NULL
;
while
(
l_p
>
a_filename
)
{
if
(
*
l_p
==
'.'
)
{
return
++
l_p
;
}
l_p
--
;
}
return
NULL
;
}
static
bool
get_contents_stdio
(
const
char
*
filename
,
FILE
*
f
,
char
**
contents
,
size_t
*
length
)
static
bool
get_contents_stdio
(
const
char
*
filename
,
FILE
*
f
,
char
**
contents
,
size_t
*
length
)
{
{
char
buf
[
4096
];
char
buf
[
4096
];
...
...
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