mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 20:45:18 +00:00
virStringListGetFirstWithPrefix: Remove unused helper
This is a uncommon and trivial operation, so having an utility function for it is pointless. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
7cc3418915
commit
e6c9c44e9a
@ -3241,7 +3241,6 @@ virStringHasSuffix;
|
|||||||
virStringIsEmpty;
|
virStringIsEmpty;
|
||||||
virStringIsPrintable;
|
virStringIsPrintable;
|
||||||
virStringListFreeCount;
|
virStringListFreeCount;
|
||||||
virStringListGetFirstWithPrefix;
|
|
||||||
virStringListHasString;
|
virStringListHasString;
|
||||||
virStringListJoin;
|
virStringListJoin;
|
||||||
virStringListLength;
|
virStringListLength;
|
||||||
|
@ -238,24 +238,6 @@ virStringListHasString(const char **strings,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
|
||||||
virStringListGetFirstWithPrefix(char **strings,
|
|
||||||
const char *prefix)
|
|
||||||
{
|
|
||||||
size_t i = 0;
|
|
||||||
|
|
||||||
if (!strings)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
while (strings[i]) {
|
|
||||||
if (STRPREFIX(strings[i], prefix))
|
|
||||||
return strings[i] + strlen(prefix);
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Like strtol, but produce an "int" result, and check more carefully.
|
/* Like strtol, but produce an "int" result, and check more carefully.
|
||||||
Return 0 upon success; return -1 to indicate failure.
|
Return 0 upon success; return -1 to indicate failure.
|
||||||
When END_PTR is NULL, the byte after the final valid digit must be NUL.
|
When END_PTR is NULL, the byte after the final valid digit must be NUL.
|
||||||
|
@ -45,9 +45,6 @@ void virStringListFreeCount(char **strings,
|
|||||||
|
|
||||||
bool virStringListHasString(const char **strings,
|
bool virStringListHasString(const char **strings,
|
||||||
const char *needle);
|
const char *needle);
|
||||||
char *virStringListGetFirstWithPrefix(char **strings,
|
|
||||||
const char *prefix)
|
|
||||||
ATTRIBUTE_NONNULL(2);
|
|
||||||
|
|
||||||
int virStrToLong_i(char const *s,
|
int virStrToLong_i(char const *s,
|
||||||
char **end_ptr,
|
char **end_ptr,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user