* New version 2.21.999
[alpine.git] / pith / strlst.c
blobb2ebe07c7da0651ed352c5ebc5b1c0b4dd60a2c4
1 #if !defined(lint) && !defined(DOS)
2 static char rcsid[] = "$Id: strlst.c 761 2007-10-23 22:35:18Z hubert@u.washington.edu $";
3 #endif
5 /*
6 * ========================================================================
7 * Copyright 2013-2018 Eduardo Chappa
8 * Copyright 2006 University of Washington
10 * Licensed under the Apache License, Version 2.0 (the "License");
11 * you may not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
14 * http://www.apache.org/licenses/LICENSE-2.0
16 * ========================================================================
19 /*======================================================================
21 strlst.c
22 Implements STRINGLIST creation destruction routines
24 ====*/
27 #include "../pith/headers.h"
28 #include "../pith/strlst.h"
31 STRINGLIST *
32 new_strlst(char **l)
34 STRINGLIST *sl = mail_newstringlist();
36 sl->text.data = (unsigned char *) (*l);
37 sl->text.size = strlen(*l);
38 sl->next = (*++l) ? new_strlst(l) : NULL;
39 return(sl);
43 void
44 free_strlst(struct string_list **sl)
46 if(*sl){
47 if((*sl)->next)
48 free_strlst(&(*sl)->next);
50 fs_give((void **) sl);