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
92dd34ed
Commit
92dd34ed
authored
20 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
Created strListPush and strListPop convenience macros.
Removed pad argument from strListReadFile().
parent
c2440435
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/xpdev/ini_file.c
+1
-1
1 addition, 1 deletion
src/xpdev/ini_file.c
src/xpdev/str_list.c
+2
-6
2 additions, 6 deletions
src/xpdev/str_list.c
src/xpdev/str_list.h
+5
-1
5 additions, 1 deletion
src/xpdev/str_list.h
with
8 additions
and
8 deletions
src/xpdev/ini_file.c
+
1
−
1
View file @
92dd34ed
...
...
@@ -583,7 +583,7 @@ str_list_t iniReadFile(FILE* fp)
rewind
(
fp
);
list
=
strListReadFile
(
fp
,
NULL
,
INI_MAX_LINE_LEN
,
FALSE
/* pad */
);
list
=
strListReadFile
(
fp
,
NULL
,
INI_MAX_LINE_LEN
);
if
(
list
!=
NULL
)
{
/* truncate the white-space off end of strings */
for
(
i
=
0
;
list
[
i
]
!=
NULL
;
i
++
)
...
...
This diff is collapsed.
Click to expand it.
src/xpdev/str_list.c
+
2
−
6
View file @
92dd34ed
...
...
@@ -321,7 +321,7 @@ void strListFree(str_list_t* list)
}
}
str_list_t
strListReadFile
(
FILE
*
fp
,
str_list_t
*
lp
,
size_t
max_line_len
,
BOOL
pad
)
str_list_t
strListReadFile
(
FILE
*
fp
,
str_list_t
*
lp
,
size_t
max_line_len
)
{
char
*
buf
=
NULL
;
size_t
count
;
...
...
@@ -343,11 +343,7 @@ str_list_t strListReadFile(FILE* fp, str_list_t* lp, size_t max_line_len, BOOL p
if
(
fgets
(
buf
,
max_line_len
+
1
,
fp
)
==
NULL
)
break
;
if
(
pad
)
{
str_list_append
(
lp
,
buf
,
count
++
);
buf
=
NULL
;
}
else
strListAppend
(
lp
,
buf
,
count
++
);
strListAppend
(
lp
,
buf
,
count
++
);
}
if
(
buf
!=
NULL
)
...
...
This diff is collapsed.
Click to expand it.
src/xpdev/str_list.h
+
5
−
1
View file @
92dd34ed
...
...
@@ -80,6 +80,10 @@ BOOL strListDelete(str_list_t* list, size_t index);
/* Replace a string at a specific index */
char
*
strListReplace
(
const
str_list_t
list
,
size_t
index
,
const
char
*
str
);
/* Convenience macros for pushing, popping strings (LIFO stack) */
#define strListPush(list, str) strListAppend(list, str, STR_LIST_LAST_INDEX)
#define strListPop(list) strListRemove(list, STR_LIST_LAST_INDEX)
/* Add to an exiting or new string list by splitting specified string (str) */
/* into multiple strings, separated by one of the delimit characters */
str_list_t
strListSplit
(
str_list_t
*
list
,
char
*
str
,
const
char
*
delimit
);
...
...
@@ -107,7 +111,7 @@ void strListSortAlphaCaseReverse(str_list_t list);
/* Read lines from file appending each line to string list */
/* Pass NULL list to have list allocated for you */
str_list_t
strListReadFile
(
FILE
*
fp
,
str_list_t
*
list
,
size_t
max_line_len
,
BOOL
pad
);
str_list_t
strListReadFile
(
FILE
*
fp
,
str_list_t
*
list
,
size_t
max_line_len
);
/* Write to file (fp) each string in the list, optionally separated by separator (e.g. "\n") */
size_t
strListWriteFile
(
FILE
*
fp
,
const
str_list_t
list
,
const
char
*
separator
);
...
...
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