Add support for tab-completion when selecting by rule
[alpine.git] / pith / strlst.c
blobb56b150c353680738dbb62fb527171379c0a9953
1 /*
2 * ========================================================================
3 * Copyright 2013-2022 Eduardo Chappa
4 * Copyright 2006 University of Washington
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * ========================================================================
15 /*======================================================================
17 strlst.c
18 Implements STRINGLIST creation destruction routines
20 ====*/
23 #include "../pith/headers.h"
24 #include "../pith/strlst.h"
27 STRINGLIST *
28 new_strlst(char **l)
30 STRINGLIST *sl = mail_newstringlist();
32 sl->text.data = (unsigned char *) (*l);
33 sl->text.size = strlen(*l);
34 sl->next = (*++l) ? new_strlst(l) : NULL;
35 return(sl);
39 void
40 free_strlst(struct string_list **sl)
42 if(*sl){
43 if((*sl)->next)
44 free_strlst(&(*sl)->next);
46 fs_give((void **) sl);