X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=lib%2Fstring-list.c;h=f3dac6755b2957694d8cd04aa04ebd785395e53f;hp=d92a0bab5a77feb4b9cc967a208e5f66c36b886b;hb=HEAD;hpb=f3c1eebfaf8526129ae6946cbcd44a3c602563d6 diff --git a/lib/string-list.c b/lib/string-list.c index d92a0bab..f3dac675 100644 --- a/lib/string-list.c +++ b/lib/string-list.c @@ -13,9 +13,10 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ . + * along with this program. If not, see https://www.gnu.org/licenses/ . * * Author: Carl Worth + * Austin Clements */ #include "notmuch-private.h" @@ -41,6 +42,12 @@ _notmuch_string_list_create (const void *ctx) return list; } +int +_notmuch_string_list_length (notmuch_string_list_t *list) +{ + return list->length; +} + void _notmuch_string_list_append (notmuch_string_list_t *list, const char *string) @@ -60,8 +67,8 @@ _notmuch_string_list_append (notmuch_string_list_t *list, static int cmpnode (const void *pa, const void *pb) { - notmuch_string_node_t *a = *(notmuch_string_node_t * const *)pa; - notmuch_string_node_t *b = *(notmuch_string_node_t * const *)pb; + notmuch_string_node_t *a = *(notmuch_string_node_t *const *) pa; + notmuch_string_node_t *b = *(notmuch_string_node_t *const *) pb; return strcmp (a->string, b->string); } @@ -85,7 +92,7 @@ _notmuch_string_list_sort (notmuch_string_list_t *list) qsort (nodes, list->length, sizeof (*nodes), cmpnode); for (i = 0; i < list->length - 1; ++i) - nodes[i]->next = nodes[i+1]; + nodes[i]->next = nodes[i + 1]; nodes[i]->next = NULL; list->head = nodes[0]; list->tail = &nodes[i]->next;