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
7fa95f07
Commit
7fa95f07
authored
1 year ago
by
Eric Vidal
Browse files
Options
Downloads
Patches
Plain Diff
add service_switch_tree function
parent
73614ba8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/include/66/service.h
+1
-0
1 addition, 0 deletions
src/include/66/service.h
src/lib66/service/deps-lib/deps
+1
-0
1 addition, 0 deletions
src/lib66/service/deps-lib/deps
src/lib66/service/service_switch_tree.c
+40
-0
40 additions, 0 deletions
src/lib66/service/service_switch_tree.c
with
42 additions
and
0 deletions
src/include/66/service.h
+
1
−
0
View file @
7fa95f07
...
...
@@ -316,6 +316,7 @@ extern void service_resolve_write(resolve_service_t *res) ;
extern
void
service_resolve_write_tmp
(
resolve_service_t
*
res
,
char
const
*
dst
,
uint8_t
force
)
;
extern
int
service_resolve_write_cdb
(
cdbmaker
*
c
,
resolve_service_t
*
sres
)
;
extern
void
service_enable_disable
(
graph_t
*
g
,
unsigned
int
idx
,
resolve_service_t
*
ares
,
unsigned
int
areslen
,
uint8_t
action
,
visit_t
*
visit
,
uint8_t
propagate
)
;
extern
void
service_switch_tree
(
resolve_service_t
*
res
,
char
const
*
base
,
char
const
*
totreename
)
;
/* avoid circular dependencies by prototyping the ss_state_t instead
* of calling the state.h header file*/
typedef
struct
ss_state_s
ss_state_t
,
*
ss_state_t_ref
;
...
...
This diff is collapsed.
Click to expand it.
src/lib66/service/deps-lib/deps
+
1
−
0
View file @
7fa95f07
...
...
@@ -16,6 +16,7 @@ service_resolve_write.o
service_resolve_read_cdb.o
service_resolve_write_cdb.o
service_resolve_write_tmp.o
service_switch_tree.o
-loblibs
-lskarnet
This diff is collapsed.
Click to expand it.
src/lib66/service/service_switch_tree.c
0 → 100644
+
40
−
0
View file @
7fa95f07
/*
* service_switch_tree.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
<stdlib.h>
#include
<oblibs/log.h>
#include
<66/service.h>
#include
<66/resolve.h>
#include
<66/tree.h>
void
service_switch_tree
(
resolve_service_t
*
res
,
char
const
*
base
,
char
const
*
totreename
)
{
log_flow
()
;
resolve_wrapper_t_ref
wres
=
resolve_set_struct
(
DATA_SERVICE
,
res
)
;
tree_service_remove
(
base
,
res
->
sa
.
s
+
res
->
treename
,
res
->
sa
.
s
+
res
->
name
)
;
tree_service_add
(
base
,
totreename
,
res
->
sa
.
s
+
res
->
name
)
;
if
(
!
service_resolve_modify_field
(
res
,
E_RESOLVE_SERVICE_TREENAME
,
totreename
))
log_dieu
(
LOG_EXIT_SYS
,
"modify resolve file of: "
,
res
->
sa
.
s
+
res
->
name
)
;
if
(
!
resolve_write_g
(
wres
,
base
,
res
->
sa
.
s
+
res
->
name
))
log_dieu
(
LOG_EXIT_SYS
,
"write resolve file of: "
,
res
->
sa
.
s
+
res
->
name
)
;
free
(
wres
)
;
}
\ No newline at end of file
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