Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
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
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
Main
Synchronet
Commits
76f93c4f
Commit
76f93c4f
authored
5 months ago
by
Rob Swindell
Browse files
Options
Downloads
Patches
Plain Diff
Add strListFastDeleteAll()
To quickly free and remove all list entries (without realloc).
parent
4143d73f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/xpdev/str_list.c
+9
-0
9 additions, 0 deletions
src/xpdev/str_list.c
src/xpdev/str_list.h
+1
-0
1 addition, 0 deletions
src/xpdev/str_list.h
with
10 additions
and
0 deletions
src/xpdev/str_list.c
+
9
−
0
View file @
76f93c4f
...
@@ -197,6 +197,15 @@ bool strListFastDelete(str_list_t list, size_t index, size_t count)
...
@@ -197,6 +197,15 @@ bool strListFastDelete(str_list_t list, size_t index, size_t count)
return
strListFastRemove
(
list
,
index
,
count
);
return
strListFastRemove
(
list
,
index
,
count
);
}
}
void
strListFastDeleteAll
(
str_list_t
list
)
{
size_t
i
;
for
(
i
=
0
;
list
[
i
]
!=
NULL
;
++
i
)
free
(
list
[
i
]);
list
[
0
]
=
NULL
;
}
char
*
strListReplace
(
const
str_list_t
list
,
size_t
index
,
const
char
*
str
)
char
*
strListReplace
(
const
str_list_t
list
,
size_t
index
,
const
char
*
str
)
{
{
char
*
buf
;
char
*
buf
;
...
...
This diff is collapsed.
Click to expand it.
src/xpdev/str_list.h
+
1
−
0
View file @
76f93c4f
...
@@ -78,6 +78,7 @@ DLLEXPORT bool strListFastRemove(str_list_t, size_t index, size_t count);
...
@@ -78,6 +78,7 @@ DLLEXPORT bool strListFastRemove(str_list_t, size_t index, size_t count);
/* Remove and free a string at a specific index */
/* Remove and free a string at a specific index */
DLLEXPORT
bool
strListDelete
(
str_list_t
*
,
size_t
index
);
DLLEXPORT
bool
strListDelete
(
str_list_t
*
,
size_t
index
);
DLLEXPORT
bool
strListFastDelete
(
str_list_t
,
size_t
index
,
size_t
count
);
DLLEXPORT
bool
strListFastDelete
(
str_list_t
,
size_t
index
,
size_t
count
);
DLLEXPORT
void
strListFastDeleteAll
(
str_list_t
);
/* Replace a string at a specific index */
/* Replace a string at a specific index */
DLLEXPORT
char
*
strListReplace
(
const
str_list_t
,
size_t
index
,
const
char
*
str
);
DLLEXPORT
char
*
strListReplace
(
const
str_list_t
,
size_t
index
,
const
char
*
str
);
...
...
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