Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
6
66
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package 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
Eric Vidal
66
Commits
71bcc91b
Commit
71bcc91b
authored
2 years ago
by
Eric Vidal
Browse files
Options
Downloads
Patches
Plain Diff
add resolve_read_g() function
parent
e8bfda67
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/include/66/resolve.h
+3
-1
3 additions, 1 deletion
src/include/66/resolve.h
src/lib66/resolve/resolve_read_g.c
+40
-0
40 additions, 0 deletions
src/lib66/resolve/resolve_read_g.c
with
43 additions
and
1 deletion
src/include/66/resolve.h
+
3
−
1
View file @
71bcc91b
...
...
@@ -64,9 +64,11 @@ struct resolve_field_table_s
extern
resolve_wrapper_t
*
resolve_set_struct
(
uint8_t
type
,
void
*
s
)
;
extern
int
resolve_init
(
resolve_wrapper_t
*
wres
)
;
extern
int
resolve_check
(
char
const
*
src
,
char
const
*
name
)
;
extern
int
resolve_read
(
resolve_wrapper_t
*
wres
,
char
const
*
src
,
char
const
*
name
)
;
/* convenient API: do a resolve_check then a resolve_read */
extern
int
resolve_read_g
(
resolve_wrapper_t
*
wres
,
char
const
*
src
,
char
const
*
name
)
;
extern
int
resolve_write
(
resolve_wrapper_t
*
wres
,
char
const
*
dst
,
char
const
*
name
)
;
extern
int
resolve_check
(
char
const
*
src
,
char
const
*
name
)
;
extern
int
resolve_append
(
genalloc
*
ga
,
resolve_wrapper_t
*
wres
)
;
extern
int
resolve_search
(
genalloc
*
ga
,
char
const
*
name
,
uint8_t
type
)
;
extern
int
resolve_cmp
(
genalloc
*
ga
,
char
const
*
name
,
uint8_t
type
)
;
...
...
This diff is collapsed.
Click to expand it.
src/lib66/resolve/resolve_read_g.c
0 → 100644
+
40
−
0
View file @
71bcc91b
/*
* resolve_read_g.c
*
* Copyright (c) 2018-2021 Eric Vidal <eric@obarun.org>
*
* All rights reserved.
*
* This file is part of Obarun. It is subject to the license terms in
* the LICENSE file found in the top-level directory of this
* distribution.
* This file may not be copied, modified, propagated, or distributed
* except according to the terms contained in the LICENSE file./
*/
#include
<string.h>
#include
<oblibs/log.h>
#include
<oblibs/string.h>
#include
<66/resolve.h>
int
resolve_read_g
(
resolve_wrapper_t
*
wres
,
char
const
*
src
,
char
const
*
name
)
{
log_flow
()
;
size_t
srclen
=
strlen
(
src
)
;
size_t
namelen
=
strlen
(
name
)
;
char
tmp
[
srclen
+
SS_RESOLVE_LEN
+
1
+
namelen
+
1
]
;
auto_strings
(
tmp
,
src
,
SS_RESOLVE
,
"/"
,
name
)
;
r
=
scan_mode
(
tmp
,
S_IFREG
)
;
if
(
r
<=
0
)
log_warnusys_return
(
LOG_EXIT_ZERO
,
"found resolve file: "
,
tmp
)
;
if
(
!
resolve_read_cdb
(
wres
,
tmp
))
return
0
;
return
1
;
}
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