95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore/*
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore * Copyright (c) 1994 Christos Zoulas
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore * All rights reserved.
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore *
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore * Redistribution and use in source and binary forms, with or without
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore * modification, are permitted provided that the following conditions
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore * are met:
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore * 1. Redistributions of source code must retain the above copyright
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore * notice, this list of conditions and the following disclaimer.
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore * 2. Redistributions in binary form must reproduce the above copyright
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore * notice, this list of conditions and the following disclaimer in the
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore * documentation and/or other materials provided with the distribution.
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore * 3. All advertising materials mentioning features or use of this software
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore * must display the following acknowledgement:
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore * This product includes software developed by Christos Zoulas.
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore * 4. The name of the author may not be used to endorse or promote products
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore * derived from this software without specific prior written permission.
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore *
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore * SUCH DAMAGE.
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore */
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore/*
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore */
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore#ifndef _STRINGLIST_H_
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore#define _STRINGLIST_H_
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore#include <sys/types.h>
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amoretypedef struct _stringlist {
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore char **sl_str;
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore size_t sl_max;
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore size_t sl_cur;
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore} stringlist;
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amorestringlist *sl_init(void);
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amoreint sl_add(stringlist *, char *);
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amorevoid sl_free(stringlist *, int);
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amorechar *sl_find(stringlist *, char *);
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore#endif /* _STRINGLIST_H_ */