CliXoN
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Functions
clixon_string.c File Reference
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <stdlib.h>
#include <errno.h>
#include <regex.h>
#include <ctype.h>
#include "clixon_queue.h"
#include "clixon_chunk.h"
#include "clixon_string.h"
#include "clixon_err.h"

Functions

char ** clicon_strsep (char *string, char *delim, int *nvec0)
 
char * clicon_strjoin (int argc, char **argv, char *delim)
 
char * clicon_strndup (const char *str, size_t len)
 

Function Documentation

char* clicon_strjoin ( int  argc,
char **  argv,
char *  delim 
)

Concatenate elements of a string array into a string. An optional delimiter string can be specified which will be inserted betwen each element.

Return values
strJoined string. Free after use.
NULLFailure
char* clicon_strndup ( const char *  str,
size_t  len 
)

strndup() for systems without it, such as xBSD

char** clicon_strsep ( char *  string,
char *  delim,
int *  nvec0 
)

Split string into a vector based on character delimiters. Using malloc

The given string is split into a vector where the delimiter can be any of the characters in the specified delimiter string.

The vector returned is one single memory block that must be freed by the caller

Parameters
[in]stringString to be split
[in]delimString of delimiter characters
[out]nvecNumber of entries in returned vector
Return values
vecVector of strings. NULL terminated. Free after use
NULLError *