xref: /openbsd-src/usr.bin/ftp/stringlist.h (revision ce7279d89b71439c96c854f612f4ac93a461fdc4)
1*ce7279d8Sjsg /*	$OpenBSD: stringlist.h,v 1.9 2024/05/21 05:00:48 jsg Exp $	*/
2bfd817adSflorian /*	$NetBSD: stringlist.h,v 1.2 1997/01/17 06:11:36 lukem Exp $	*/
3bfd817adSflorian 
4bfd817adSflorian /*
5bfd817adSflorian  * Copyright (c) 1994 Christos Zoulas
6bfd817adSflorian  * All rights reserved.
7bfd817adSflorian  *
8bfd817adSflorian  * Redistribution and use in source and binary forms, with or without
9bfd817adSflorian  * modification, are permitted provided that the following conditions
10bfd817adSflorian  * are met:
11bfd817adSflorian  * 1. Redistributions of source code must retain the above copyright
12bfd817adSflorian  *    notice, this list of conditions and the following disclaimer.
13bfd817adSflorian  * 2. Redistributions in binary form must reproduce the above copyright
14bfd817adSflorian  *    notice, this list of conditions and the following disclaimer in the
15bfd817adSflorian  *    documentation and/or other materials provided with the distribution.
16bfd817adSflorian  *
17bfd817adSflorian  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
18bfd817adSflorian  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19bfd817adSflorian  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20bfd817adSflorian  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
21bfd817adSflorian  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22bfd817adSflorian  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23bfd817adSflorian  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24bfd817adSflorian  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25bfd817adSflorian  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26bfd817adSflorian  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27bfd817adSflorian  * SUCH DAMAGE.
28bfd817adSflorian  */
29bfd817adSflorian 
30bfd817adSflorian #ifndef SMALL
31bfd817adSflorian 
32bfd817adSflorian #ifndef _STRINGLIST_H
33bfd817adSflorian #define _STRINGLIST_H
34bfd817adSflorian 
35bfd817adSflorian #include <sys/types.h>
36bfd817adSflorian 
37bfd817adSflorian /*
38bfd817adSflorian  * Simple string list
39bfd817adSflorian  */
40bfd817adSflorian typedef struct _stringlist {
41bfd817adSflorian 	char	**sl_str;
42bfd817adSflorian 	size_t	  sl_max;
43bfd817adSflorian 	size_t	  sl_cur;
44bfd817adSflorian } StringList;
45bfd817adSflorian 
46bfd817adSflorian __BEGIN_DECLS
47bfd817adSflorian StringList	*sl_init(void);
48bfd817adSflorian void		 sl_add(StringList *, char *);
49bfd817adSflorian void		 sl_free(StringList *, int);
50bfd817adSflorian __END_DECLS
51bfd817adSflorian 
52bfd817adSflorian #endif /* _STRINGLIST_H */
53bfd817adSflorian 
54bfd817adSflorian #endif /* !SMALL */
55bfd817adSflorian 
56