strv: Add l_strv_eq
Andrew Zaborowski
PATCH 1/1 strv: Add l_strv_eq
--- ell/ell.sym | 1 + ell/strv.c | 20 ++++++++++++++++++++ ell/strv.h | 1 + 3 files changed, 22 insertions(+)
ell/ell.sym +1 -0
@@ -40,6 +40,7 @@ global: l_strv_append_printf; l_strv_append_vprintf; l_strv_copy; + l_strv_eq; /* utf8 */ l_ascii_table; l_utf8_get_codepoint;
ell/strv.c +20 -0
@@ -359,3 +359,23 @@ LIB_EXPORT char **l_strv_copy(char **str_array)return copy; } + +/** +* l_strv_eq: +* @a: a %NULL terminated array of strings or %NULL +* @b: another %NULL terminated array of strings or %NULL +* +* Returns: Whether @a and @b's contents are identical, including the +* order, or @a and @b are both %NULL. +*/ +LIB_EXPORT bool l_strv_eq(char **a, char **b) +{ +if (!a || !b) +return a == b; + +for (; *a; a++, b++) +if (!*b ||strcmp (*a, *b)) +return false; + +return !*b; +}
ell/strv.h +1 -0
@@ -46,6 +46,7 @@ char **l_strv_append_vprintf(char **str_array, const char *format, va_list args) __attribute__((format(printf, 2, 0)));char **l_strv_copy (char **str_array); +bool l_strv_eq (char **a,char **b); #ifdef __cplusplus }
Signature · 1 line
2.30.2
Denis Kenzior
AppliedHi Andrew,
Quoted 6 lines · Andrew Zaborowski
--- ell/ell.sym | 1 + ell/strv.c | 20 ++++++++++++++++++++ ell/strv.h | 1 + 3 files changed, 22 insertions(+)
Applied, thanks.
Regards,
-Denis
udayfield04 at gmail.com
Tamilyogi Proxy Unblock Tamilyogi proxy site List
https://lifetrixcorner.com/tamilyogi-proxy/
ExtraTorrent Proxy Unblock Extratorrent Proxy List of all Sites
https://lifetrixcorner.com/extratorrent-proxy/
ETTV Proxy Unblockit ETTV Proxy & latest Sites
https://lifetrixcorner.com/ettv-proxy/
Torrentz2 Proxy Unblock access Torrentz2 Proxy List
https://lifetrixcorner.com/torrentz2/
isoHunt Proxy Unblock isoHunt Proxy list sites
https://lifetrixcorner.com/isohunt/
MagnetDL Proxy Unblock & MagnetDL Proxy List sites
https://lifetrixcorner.com/magnetdl-proxy/
Demonoid Proxy Unblock Demonoid Proxy Site List
https://lifetrixcorner.com/demonoid/
Write For Us – Submit Guest Post on Lifestyle, Beauty, Travel, Health, Fitness
https://lifetrixcorner.com/write-for-us-guest-post/