use gnu indent to enforce coding style and adapt source

- indent options are listed in ./.indent.pro
 - use test case to run indent
This commit is contained in:
josch
2014-09-20 10:59:54 +02:00
parent d8e00119b4
commit 097a855751
43 changed files with 1325 additions and 1278 deletions

View File

@@ -24,23 +24,26 @@
#include "http.h"
static int http_progress_cb(void *user_ptr, double dltotal, double dlnow, double ultotal, double ulnow);
static size_t http_read_buf_cb(char *data, size_t size, size_t nmemb, void *user_ptr);
static size_t http_write_buf_cb(char *data, size_t size, size_t nmemb, void *user_ptr);
static size_t http_write_file_cb(char *data, size_t size, size_t nmemb, void *user_ptr);
static int http_progress_cb(void *user_ptr, double dltotal, double dlnow,
double ultotal, double ulnow);
static size_t http_read_buf_cb(char *data, size_t size, size_t nmemb,
void *user_ptr);
static size_t http_write_buf_cb(char *data, size_t size, size_t nmemb,
void *user_ptr);
static size_t http_write_file_cb(char *data, size_t size, size_t nmemb,
void *user_ptr);
struct mfhttp
{
CURL *curl_handle;
char *write_buf;
size_t write_buf_len;
double ul_len;
double ul_now;
double dl_len;
double dl_now;
bool show_progress;
char error_buf[CURL_ERROR_SIZE];
FILE *stream;
struct mfhttp {
CURL *curl_handle;
char *write_buf;
size_t write_buf_len;
double ul_len;
double ul_now;
double dl_len;
double dl_now;
bool show_progress;
char error_buf[CURL_ERROR_SIZE];
FILE *stream;
};
/*
@@ -51,20 +54,22 @@ struct mfhttp
* keep-alive anyways.
*/
mfhttp*
http_create(void)
mfhttp *http_create(void)
{
mfhttp *conn;
CURL *curl_handle;
curl_handle = curl_easy_init();
if(curl_handle == NULL) return NULL;
mfhttp *conn;
CURL *curl_handle;
conn = (mfhttp*)calloc(1,sizeof(mfhttp));
curl_handle = curl_easy_init();
if (curl_handle == NULL)
return NULL;
conn = (mfhttp *) calloc(1, sizeof(mfhttp));
conn->curl_handle = curl_handle;
conn->show_progress = false;
curl_easy_setopt(conn->curl_handle, CURLOPT_NOPROGRESS,0);
curl_easy_setopt(conn->curl_handle, CURLOPT_PROGRESSFUNCTION, http_progress_cb);
curl_easy_setopt(conn->curl_handle, CURLOPT_NOPROGRESS, 0);
curl_easy_setopt(conn->curl_handle, CURLOPT_PROGRESSFUNCTION,
http_progress_cb);
curl_easy_setopt(conn->curl_handle, CURLOPT_PROGRESSDATA, (void *)conn);
curl_easy_setopt(conn->curl_handle, CURLOPT_FOLLOWLOCATION, 1);
@@ -77,28 +82,29 @@ http_create(void)
return conn;
}
json_t *
http_parse_buf_json(mfhttp* conn, size_t flags, json_error_t *error)
json_t *http_parse_buf_json(mfhttp * conn, size_t flags,
json_error_t * error)
{
return json_loadb(conn->write_buf, conn->write_buf_len, flags, error);
}
void
http_destroy(mfhttp* conn)
void http_destroy(mfhttp * conn)
{
curl_easy_cleanup(conn->curl_handle);
free(conn->write_buf);
free(conn);
}
static int http_progress_cb(void *user_ptr, double dltotal, double dlnow,
double ultotal, double ulnow)
static int
http_progress_cb(void *user_ptr, double dltotal, double dlnow,
double ultotal, double ulnow)
{
mfhttp *conn;
mfhttp *conn;
if (user_ptr == NULL) return 0;
if (user_ptr == NULL)
return 0;
conn = (mfhttp *)user_ptr;
conn = (mfhttp *) user_ptr;
conn->ul_len = ultotal;
conn->ul_now = ulnow;
@@ -110,18 +116,21 @@ static int http_progress_cb(void *user_ptr, double dltotal, double dlnow,
}
int
http_get_buf(mfhttp *conn, const char *url, int (*data_handler)(mfhttp *conn, void *data), void *data)
http_get_buf(mfhttp * conn, const char *url,
int (*data_handler) (mfhttp * conn, void *data), void *data)
{
int retval;
int retval;
curl_easy_reset(conn->curl_handle);
curl_easy_setopt(conn->curl_handle, CURLOPT_URL, url);
curl_easy_setopt(conn->curl_handle, CURLOPT_READFUNCTION, http_read_buf_cb);
curl_easy_setopt(conn->curl_handle, CURLOPT_READDATA, (void*)conn);
curl_easy_setopt(conn->curl_handle, CURLOPT_WRITEFUNCTION, http_write_buf_cb);
curl_easy_setopt(conn->curl_handle, CURLOPT_WRITEDATA, (void*)conn);
curl_easy_setopt(conn->curl_handle, CURLOPT_READDATA, (void *)conn);
curl_easy_setopt(conn->curl_handle, CURLOPT_WRITEFUNCTION,
http_write_buf_cb);
curl_easy_setopt(conn->curl_handle, CURLOPT_WRITEDATA, (void *)conn);
//fprintf(stderr, "GET: %s\n", url);
retval = curl_easy_perform(conn->curl_handle);
if(retval != CURLE_OK) {
if (retval != CURLE_OK) {
fprintf(stderr, "error curl_easy_perform %s\n\r", conn->error_buf);
return retval;
}
@@ -131,14 +140,15 @@ http_get_buf(mfhttp *conn, const char *url, int (*data_handler)(mfhttp *conn, vo
return retval;
}
static size_t
static size_t
http_read_buf_cb(char *data, size_t size, size_t nmemb, void *user_ptr)
{
size_t data_len;
size_t data_len;
if (user_ptr == NULL) return 0;
if (user_ptr == NULL)
return 0;
data_len = size*nmemb;
data_len = size * nmemb;
if (data_len > 0) {
fwrite(data, size, nmemb, stderr);
@@ -149,21 +159,22 @@ http_read_buf_cb(char *data, size_t size, size_t nmemb, void *user_ptr)
return 0;
}
static size_t
static size_t
http_write_buf_cb(char *data, size_t size, size_t nmemb, void *user_ptr)
{
mfhttp *conn;
size_t data_len;
mfhttp *conn;
size_t data_len;
if (user_ptr == NULL) return 0;
if (user_ptr == NULL)
return 0;
conn = (mfhttp*)user_ptr;
data_len = size*nmemb;
conn = (mfhttp *) user_ptr;
data_len = size * nmemb;
if (data_len > 0) {
//fwrite(data, size, nmemb, stderr);
conn->write_buf = (char *)realloc(conn->write_buf,
conn->write_buf_len + data_len);
conn->write_buf_len + data_len);
memcpy(conn->write_buf + conn->write_buf_len, data, data_len);
conn->write_buf_len += data_len;
}
@@ -172,18 +183,21 @@ http_write_buf_cb(char *data, size_t size, size_t nmemb, void *user_ptr)
}
int
http_post_buf(mfhttp *conn, const char *url, const char *post_args, int (*data_handler)(mfhttp *conn, void *data), void *data)
http_post_buf(mfhttp * conn, const char *url, const char *post_args,
int (*data_handler) (mfhttp * conn, void *data), void *data)
{
int retval;
int retval;
curl_easy_reset(conn->curl_handle);
curl_easy_setopt(conn->curl_handle, CURLOPT_URL, url);
curl_easy_setopt(conn->curl_handle, CURLOPT_READFUNCTION, http_read_buf_cb);
curl_easy_setopt(conn->curl_handle, CURLOPT_READDATA, (void*)conn);
curl_easy_setopt(conn->curl_handle, CURLOPT_WRITEFUNCTION, http_write_buf_cb);
curl_easy_setopt(conn->curl_handle, CURLOPT_WRITEDATA, (void*)conn);
curl_easy_setopt(conn->curl_handle, CURLOPT_READDATA, (void *)conn);
curl_easy_setopt(conn->curl_handle, CURLOPT_WRITEFUNCTION,
http_write_buf_cb);
curl_easy_setopt(conn->curl_handle, CURLOPT_WRITEDATA, (void *)conn);
curl_easy_setopt(conn->curl_handle, CURLOPT_POSTFIELDS, post_args);
retval = curl_easy_perform(conn->curl_handle);
if(retval != CURLE_OK) {
if (retval != CURLE_OK) {
fprintf(stderr, "error curl_easy_perform %s\n\r", conn->error_buf);
return retval;
}
@@ -193,40 +207,42 @@ http_post_buf(mfhttp *conn, const char *url, const char *post_args, int (*data_h
return retval;
}
int
http_get_file(mfhttp *conn, const char *url, const char *path)
int http_get_file(mfhttp * conn, const char *url, const char *path)
{
int retval;
int retval;
curl_easy_reset(conn->curl_handle);
curl_easy_setopt(conn->curl_handle, CURLOPT_URL, url);
curl_easy_setopt(conn->curl_handle, CURLOPT_READFUNCTION, http_read_buf_cb);
curl_easy_setopt(conn->curl_handle, CURLOPT_READDATA, (void*)conn);
curl_easy_setopt(conn->curl_handle, CURLOPT_WRITEFUNCTION, http_write_file_cb);
curl_easy_setopt(conn->curl_handle, CURLOPT_WRITEDATA, (void*)conn);
curl_easy_setopt(conn->curl_handle, CURLOPT_READDATA, (void *)conn);
curl_easy_setopt(conn->curl_handle, CURLOPT_WRITEFUNCTION,
http_write_file_cb);
curl_easy_setopt(conn->curl_handle, CURLOPT_WRITEDATA, (void *)conn);
// FIXME: handle fopen() return value
conn->stream = fopen(path, "w+");
retval = curl_easy_perform(conn->curl_handle);
fclose(conn->stream);
if(retval != CURLE_OK) {
if (retval != CURLE_OK) {
fprintf(stderr, "error curl_easy_perform %s\n\r", conn->error_buf);
return retval;
}
return retval;
}
static size_t
static size_t
http_write_file_cb(char *data, size_t size, size_t nmemb, void *user_ptr)
{
mfhttp *conn;
mfhttp *conn;
if (user_ptr == NULL) return 0;
conn = (mfhttp*)user_ptr;
if (user_ptr == NULL)
return 0;
conn = (mfhttp *) user_ptr;
fwrite(data, size, nmemb, conn->stream);
fprintf(stderr, "\r %.0f / %.0f", conn->dl_now, conn->dl_len);
return size*nmemb;
return size * nmemb;
}
/*int

View File

@@ -25,13 +25,19 @@
typedef struct mfhttp mfhttp;
mfhttp* http_create(void);
void http_destroy(mfhttp* conn);
int http_get_buf(mfhttp *conn, const char *url, int (*data_handler)(mfhttp *conn, void *data), void *data);
int http_post_buf(mfhttp *conn, const char *url, const char *post_args, int (*data_handler)(mfhttp *conn, void *data), void *data);
int http_get_file(mfhttp *conn, const char *url, const char *path);
int http_post_file(mfhttp *conn, const char *url, const char *post_args, FILE *fd);
json_t *http_parse_buf_json(mfhttp* conn, size_t flags, json_error_t *error);
mfhttp *http_create(void);
void http_destroy(mfhttp * conn);
int http_get_buf(mfhttp * conn, const char *url,
int (*data_handler) (mfhttp * conn, void *data),
void *data);
int http_post_buf(mfhttp * conn, const char *url,
const char *post_args,
int (*data_handler) (mfhttp * conn, void *data),
void *data);
int http_get_file(mfhttp * conn, const char *url, const char *path);
int http_post_file(mfhttp * conn, const char *url,
const char *post_args, FILE * fd);
json_t *http_parse_buf_json(mfhttp * conn, size_t flags,
json_error_t * error);
#endif

View File

@@ -16,39 +16,40 @@
*
*/
#include <stdlib.h>
#include "json.h"
#include "stringv.h"
json_t*
json_object_by_path(json_t *start,const char *path)
json_t *json_object_by_path(json_t * start, const char *path)
{
char **path_nodes;
char **curr;
json_t *node = NULL;
json_t *data = NULL;
char **path_nodes;
char **curr;
json_t *node = NULL;
json_t *data = NULL;
if(start == NULL) return NULL;
if(path == NULL) return NULL;
if (start == NULL)
return NULL;
if (path == NULL)
return NULL;
path_nodes = stringv_split((char*)path,"/",10);
path_nodes = stringv_split((char *)path, "/", 10);
if(path_nodes == NULL) return NULL;
if (path_nodes == NULL)
return NULL;
curr = path_nodes;
node = start;
while(curr != NULL)
{
if(*curr == NULL) break;
while (curr != NULL) {
if (*curr == NULL)
break;
node = json_object_get(node,*curr);
if(node == NULL) break;
node = json_object_get(node, *curr);
if (node == NULL)
break;
if(!json_is_object(node))
{
stringv_free(path_nodes,STRINGV_FREE_ALL);
if (!json_is_object(node)) {
stringv_free(path_nodes, STRINGV_FREE_ALL);
return NULL;
}
@@ -56,7 +57,7 @@ json_object_by_path(json_t *start,const char *path)
data = node;
}
stringv_free(path_nodes,STRINGV_FREE_ALL);
stringv_free(path_nodes, STRINGV_FREE_ALL);
return data;
}
@@ -101,5 +102,3 @@ json_object_by_path(json_t *start,const char *path)
return NULL;
}
*/

View File

@@ -16,14 +16,11 @@
*
*/
#ifndef _MFSHELL_JSON_H_
#define _MFSHELL_JSON_H_
#include <jansson.h>
json_t* json_object_by_path(json_t *start,const char *path);
json_t *json_object_by_path(json_t * start, const char *path);
#endif

View File

@@ -16,7 +16,6 @@
*
*/
#include <ctype.h>
#include <stdarg.h>
#include <stddef.h>
@@ -27,86 +26,90 @@
#include "strings.h"
#include "stringv.h"
char*
strdup_printf(char* fmt, ...)
char *strdup_printf(char *fmt, ...)
{
// Good for glibc 2.1 and above. Fedora5 is 2.4.
// Good for glibc 2.1 and above. Fedora5 is 2.4.
char *ret_str = NULL;
va_list ap;
int bytes_to_allocate;
char *ret_str = NULL;
va_list ap;
int bytes_to_allocate;
va_start(ap, fmt);
bytes_to_allocate = vsnprintf(ret_str, 0, fmt, ap);
va_end(ap);
va_start(ap, fmt);
bytes_to_allocate = vsnprintf(ret_str, 0, fmt, ap);
va_end(ap);
// Add one for '\0'
bytes_to_allocate++;
// Add one for '\0'
bytes_to_allocate++;
ret_str = (char*)malloc(bytes_to_allocate * sizeof(char));
ret_str = (char *)malloc(bytes_to_allocate * sizeof(char));
va_start(ap, fmt);
bytes_to_allocate = vsnprintf(ret_str, bytes_to_allocate, fmt, ap);
va_end(ap);
va_start(ap, fmt);
bytes_to_allocate = vsnprintf(ret_str, bytes_to_allocate, fmt, ap);
va_end(ap);
return ret_str;
return ret_str;
}
char*
strdup_join(char *string1,char *string2)
char *strdup_join(char *string1, char *string2)
{
char *new_string;
size_t string1_len;
size_t string2_len;
char *new_string;
size_t string1_len;
size_t string2_len;
if(string1 == NULL || string2 == NULL) return NULL;
if (string1 == NULL || string2 == NULL)
return NULL;
string1_len = strlen(string1);
string2_len = strlen(string2);
new_string = (char*)malloc(string1_len + string2_len + 1);
new_string = (char *)malloc(string1_len + string2_len + 1);
strncpy(new_string,string1,string1_len);
strncat(new_string,string2,string2_len);
strncpy(new_string, string1, string1_len);
strncat(new_string, string2, string2_len);
new_string[string1_len + string2_len] = '\0';
return new_string;
}
char*
strdup_subst(char *string,char *token,char *subst, unsigned int max)
char *strdup_subst(char *string, char *token, char *subst,
unsigned int max)
{
size_t string_len = 0;
size_t subst_len = 0;
size_t token_len = 0;
size_t total_len = 0;
size_t copy_len = 0;
size_t token_count;
char *str_new = NULL;
char **vectors;
char **rewind;
size_t string_len = 0;
size_t subst_len = 0;
size_t token_len = 0;
size_t total_len = 0;
size_t copy_len = 0;
size_t token_count;
char *str_new = NULL;
char **vectors;
char **rewind;
if(string == NULL) return NULL;
if (string == NULL)
return NULL;
if(token == NULL || subst == NULL) return NULL;
if (token == NULL || subst == NULL)
return NULL;
string_len = strlen(string);
token_len = strlen(token);
// return on conditions that we could never handle.
if(token_len > string_len) return NULL;
if(token[0] == '\0') return NULL;
if (token_len > string_len)
return NULL;
if (token[0] == '\0')
return NULL;
vectors = stringv_find(string,token,max);
if(vectors == NULL) return NULL;
vectors = stringv_find(string, token, max);
if (vectors == NULL)
return NULL;
rewind = vectors;
// count the number of tokens found in the string
token_count = stringv_len(vectors);
if(token_count > max) token_count = max;
if (token_count > max)
token_count = max;
// start with the original string size;
total_len = string_len;
@@ -117,24 +120,22 @@ strdup_subst(char *string,char *token,char *subst, unsigned int max)
// add back the total number of subst chars to be inserted
total_len += (subst_len * token_count);
str_new = (char*)malloc((total_len + 1) * sizeof(char));
str_new = (char *)malloc((total_len + 1) * sizeof(char));
str_new[0] = '\0';
while(*vectors != NULL)
{
while (*vectors != NULL) {
// calculate distance to the next token from current position
copy_len = *vectors - string;
if(copy_len > 0)
{
strncat(str_new,string,copy_len);
if (copy_len > 0) {
strncat(str_new, string, copy_len);
string += copy_len;
// when total_len == 0 the process is complete
total_len -= copy_len;
}
strncat(str_new,token,token_len);
strncat(str_new, token, token_len);
// when total_len == 0 the process is complete
total_len -= token_len;
@@ -143,33 +144,31 @@ strdup_subst(char *string,char *token,char *subst, unsigned int max)
}
// might have one more copy operation to complete
if(total_len > 0)
{
strcat(str_new,string);
if (total_len > 0) {
strcat(str_new, string);
}
// todo: can't free vectors directly cuz it was incremented
free(rewind);
return str_new;
}
void
string_chomp(char *string)
void string_chomp(char *string)
{
size_t len;
char *pos;
size_t len;
char *pos;
if(string == NULL) return;
if (string == NULL)
return;
len = strlen(string);
if(len == 0) return;
if (len == 0)
return;
pos = &string[len - 1];
while(isspace((int)*pos) != 0)
{
while (isspace((int)*pos) != 0) {
*pos = '\0';
pos--;
}

View File

@@ -16,17 +16,17 @@
*
*/
#ifndef _STR_TOOLS_H_
#define _STR_TOOLS_H_
char* strdup_printf(char* fmt, ...);
char *strdup_printf(char *fmt, ...);
char* strdup_join(char *string1,char *string2);
char *strdup_join(char *string1, char *string2);
char* strdup_subst(char *string,char *str_old,char *str_new, unsigned int max);
char *strdup_subst(char *string, char *str_old, char *str_new,
unsigned int max);
void string_chomp(char *string);
void string_chomp(char *string);
// void string_strip_head(char *string,char c);

View File

@@ -16,74 +16,72 @@
*
*/
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include "stringv.h"
size_t
stringv_len(char **array)
size_t stringv_len(char **array)
{
size_t count = 0;
char **pos;
size_t count = 0;
char **pos;
if(array == NULL) return 0;
if (array == NULL)
return 0;
pos = array;
while(pos[0] != NULL)
{
while (pos[0] != NULL) {
pos++;
count++;
}
return count;
return count;
}
void
stringv_free(char **array,int b_free)
void stringv_free(char **array, int b_free)
{
char **pos;
char **pos;
if(array == NULL) return;
if (array == NULL)
return;
pos = array;
pos = array;
while((*pos) != NULL)
{
free(*pos);
++pos;
}
while ((*pos) != NULL) {
free(*pos);
++pos;
}
if(b_free == STRINGV_FREE_ALL) free(array);
if (b_free == STRINGV_FREE_ALL)
free(array);
return;
}
char**
stringv_copy(char **array)
char **stringv_copy(char **array)
{
uint32_t array_len;
char **array_pos;
uint32_t array_len;
char **array_pos;
char **dup_array;
char **dup_pos;
char **dup_array;
char **dup_pos;
if(array == NULL) return (char**)NULL;
if (array == NULL)
return (char **)NULL;
array_pos = array;
array_len = stringv_len(array);
if(array_len > UINT32_MAX - 1) array_len = UINT32_MAX -1;
if (array_len > UINT32_MAX - 1)
array_len = UINT32_MAX - 1;
dup_array = (char**)calloc(array_len,sizeof(char*));
dup_array = (char **)calloc(array_len, sizeof(char *));
dup_pos = dup_array;
while((*array_pos) != NULL)
{
*dup_pos = strdup((const char*)*array_pos);
while ((*array_pos) != NULL) {
*dup_pos = strdup((const char *)*array_pos);
array_pos++;
dup_pos++;
@@ -92,82 +90,89 @@ stringv_copy(char **array)
return dup_array;
}
char**
stringv_find(char *string,char *token,int limit)
char **stringv_find(char *string, char *token, int limit)
{
char **results = NULL;
char *pos = NULL;
int count = 0;
char **results = NULL;
char *pos = NULL;
int count = 0;
if(string == NULL) return (char**)NULL;
if(token == NULL) return (char**)NULL;
if(limit == 0) return (char**)NULL;
if (string == NULL)
return (char **)NULL;
if (token == NULL)
return (char **)NULL;
if (limit == 0)
return (char **)NULL;
pos = string;
if(strlen(token) > strlen(string)) return (char**)NULL;
if (strlen(token) > strlen(string))
return (char **)NULL;
while(count != limit)
{
pos = strstr(pos,token);
if(pos == NULL) break;
while (count != limit) {
pos = strstr(pos, token);
if (pos == NULL)
break;
count++;
results = (char**)realloc((void*)results,sizeof(char*) * count + 1);
results = (char **)realloc((void *)results, sizeof(char *) * count + 1);
results[count - 1] = pos;
}
if(count == 0) return (char**)NULL;
if (count == 0)
return (char **)NULL;
results[count] = (char*)NULL;
results[count] = (char *)NULL;
return results;
}
char**
stringv_split(char *string,char *token,int limit)
char **stringv_split(char *string, char *token, int limit)
{
char **results = NULL;
char *curr = NULL;
char *next = NULL;
int count = 0;
unsigned int len;
size_t copy_len = 0;
char **results = NULL;
char *curr = NULL;
char *next = NULL;
int count = 0;
unsigned int len;
size_t copy_len = 0;
if(string == NULL) return (char**)NULL;
if(token == NULL) return (char**)NULL;
if(limit == 0) return (char**)NULL;
if (string == NULL)
return (char **)NULL;
if (token == NULL)
return (char **)NULL;
if (limit == 0)
return (char **)NULL;
len = strlen(string);
if(strlen(token) > len) return (char**)NULL;
if (strlen(token) > len)
return (char **)NULL;
curr = string;
do
{
do {
// alloc space for current item plus NULL vector terminator
results = (char**)realloc(results,sizeof(char*) * (count + 2));
results = (char **)realloc(results, sizeof(char *) * (count + 2));
// find the next occurrence
next = strstr(curr,token);
next = strstr(curr, token);
if(next != NULL)
if (next != NULL)
copy_len = next - curr;
else
copy_len = strlen(curr);
results[count] = (char*)calloc(copy_len + 1,sizeof(char));
memcpy(results[count],curr,copy_len);
results[count] = (char *)calloc(copy_len + 1, sizeof(char));
memcpy(results[count], curr, copy_len);
count++;
if(next == NULL) break;
if (next == NULL)
break;
curr = next;
curr++;
}
while(count < limit);
while (count < limit);
results[count] = NULL;

View File

@@ -16,7 +16,6 @@
*
*/
#ifndef _STRING_V_H_
#define _STRING_V_H_
@@ -25,20 +24,18 @@
#define STRINGV_FREE_ALL 1
// count number of strings in a NULL in a string vector
size_t stringv_len(char **array);
size_t stringv_len(char **array);
// free all of the strings in a vector and optionally the vector pointer
void stringv_free(char **array,int b_free);
void stringv_free(char **array, int b_free);
// deep copy of string vector. returns a new vector pointer
char** stringv_copy(char **array);
char **stringv_copy(char **array);
// returns a NULL terminated vector array to every location 'token' is found
char** stringv_find(char *string,char *token,int limit);
char **stringv_find(char *string, char *token, int limit);
// returns a NULL terminated vector array of items delimited by 'token'
char** stringv_split(char *string,char *token,int limit);
char **stringv_split(char *string, char *token, int limit);
#endif