2014-09-15 20:22:02 +02:00
|
|
|
/*
|
|
|
|
|
* Copyright (C) 2013 Bryan Christ <bryan.christ@mediafire.com>
|
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
|
* under the terms of the GNU General Public License version 2, as published by
|
|
|
|
|
* the Free Software Foundation.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the 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, write to the Free Software Foundation, Inc., 51
|
|
|
|
|
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2014-09-15 20:00:05 +02:00
|
|
|
#ifndef _STRING_V_H_
|
|
|
|
|
#define _STRING_V_H_
|
|
|
|
|
|
2014-09-20 09:40:59 +02:00
|
|
|
#include <stddef.h>
|
2014-09-15 20:00:05 +02:00
|
|
|
|
|
|
|
|
#define STRINGV_FREE_ALL 1
|
|
|
|
|
|
|
|
|
|
// count number of strings in a NULL in a string vector
|
2014-09-20 10:59:54 +02:00
|
|
|
size_t stringv_len(char **array);
|
2014-09-15 20:00:05 +02:00
|
|
|
|
|
|
|
|
// free all of the strings in a vector and optionally the vector pointer
|
2014-09-20 10:59:54 +02:00
|
|
|
void stringv_free(char **array, int b_free);
|
2014-09-15 20:00:05 +02:00
|
|
|
|
|
|
|
|
// deep copy of string vector. returns a new vector pointer
|
2014-09-20 10:59:54 +02:00
|
|
|
char **stringv_copy(char **array);
|
2014-09-15 20:00:05 +02:00
|
|
|
|
|
|
|
|
// returns a NULL terminated vector array to every location 'token' is found
|
2014-09-20 10:59:54 +02:00
|
|
|
char **stringv_find(char *string, char *token, int limit);
|
2014-09-15 20:00:05 +02:00
|
|
|
|
|
|
|
|
// returns a NULL terminated vector array of items delimited by 'token'
|
2014-09-20 10:59:54 +02:00
|
|
|
char **stringv_split(char *string, char *token, int limit);
|
2014-09-15 20:00:05 +02:00
|
|
|
|
|
|
|
|
#endif
|