Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Sunxi Tools
Commits
bae6b6a9
Commit
bae6b6a9
authored
Sep 29, 2012
by
Alejandro Mery
Browse files
script: add script_find_section() helper
parent
1f505627
Changes
2
Hide whitespace changes
Inline
Side-by-side
script.c
View file @
bae6b6a9
...
...
@@ -90,6 +90,26 @@ void script_section_delete(struct script_section *section)
list_remove
(
&
section
->
sections
);
}
struct
script_section
*
script_find_section
(
struct
script
*
script
,
const
char
*
name
)
{
struct
list_entry
*
o
;
struct
script_section
*
section
;
assert
(
script
);
assert
(
name
);
for
(
o
=
list_first
(
&
script
->
sections
);
o
;
o
=
list_next
(
&
script
->
sections
,
o
))
{
section
=
container_of
(
o
,
struct
script_section
,
sections
);
if
(
strcmp
(
section
->
name
,
name
)
==
0
)
return
section
;
}
return
NULL
;
}
/*
*/
static
inline
void
script_entry_append
(
struct
script_section
*
section
,
...
...
script.h
View file @
bae6b6a9
...
...
@@ -86,6 +86,10 @@ struct script_section *script_section_new(struct script *script,
/** deletes a section recursvely and removes it from the script */
void
script_section_delete
(
struct
script_section
*
section
);
/** find existing section */
struct
script_section
*
script_find_section
(
struct
script
*
section
,
const
char
*
name
);
/** deletes an entry and removes it from the section */
void
script_entry_delete
(
struct
script_entry
*
entry
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment