Nilorea Library

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Macros Groups
Data Structures | Macros | Typedefs | Functions
n_str.h File Reference
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <string.h>`
`#include <strings.h>`
`#include <math.h>`
`#include "n_common.h"`
`#include "n_log.h"`
`#include "n_list.h"`
Include dependency graph for n_str.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Data Structures

struct | N_STR

## Macros

#define | local_strdup(__src_)
#define | WILDMAT_ABORT -2
#define | WILDMAT_NEGATE_CLASS '^'
#define | n_printf(__n_var,...)

## Typedefs

typedef int32_t | NSTRBYTE
typedef struct N_STR | N_STR

## Functions

N_STR * | new_nstr (NSTRBYTE size)
| create a new N_STR string More...
int | empty_nstr (N_STR *nstr)
| empty a N_STR string More...
N_STR * | nstrdup (N_STR *msg)
| Duplicate a N_STR. More...
int | char_to_nstr_ex (char *from, NSTRBYTE nboct, N_STR **to)
| Convert a char into a N_STR, extended version. More...
N_STR * | char_to_nstr (char *src)
| Convert a char into a N_STR, short version. More...
int | nstrcat_ex (N_STR *dest, void *src, NSTRBYTE size, NSTRBYTE blk_size, int resize_flag)
| Append data into N_STR using internal N_STR size and cursor position. More...
int | nstrcat (N_STR *dst, N_STR *src)
| Add N_STR *src content to N_STR *dst, resizing it if needed. More...
int | nstrcat_bytes_ex (N_STR *dest, void *src, NSTRBYTE size)
| Append data into N_STR using internal N_STR size and cursor position. Wrapper to nstrcat_ex, with resize_flag on and a block size one byte higher than size. More...
int | nstrcat_bytes (N_STR *dest, void *src)
| Append data into N_STR using internal N_STR size and cursor position. Wrapper to nstrcat_ex, with resize_flag on and a block size one byte higher than size. More...
N_STR * | file_to_nstr (char *filename)
| Load a whole file into a N_STR. Be aware of the NSTRBYTE addressing limit (2GB commonly) More...
int | nstr_to_file (N_STR *n_str, char *filename)
| Write a N_STR content into a file. More...
void | free_nstr_ptr (void *ptr)
| Free a N_STR pointer structure. More...
int | free_nstr (N_STR **ptr)
| Free a N_STR structure and set the pointer to NULL. More...
int | str_to_int_ex (const char *s, NSTRBYTE start, NSTRBYTE end, int *i, const int base)
| Helper for string[start to end] to integer. Automatically add /0 for conversion. Leave values untouched if any error occur. Work on a copy of the chunk. More...
int | str_to_int (const char *s, int *i, const int base)
| Helper for string to integer. More...
int | skipw (char *string, char toskip, NSTRBYTE *iterator, int inc)
| skip while 'toskip' occurence is found from 'iterator' to the next non 'toskip' position. The new iterator index is automatically stored, returning to it first value if an error append. More...
int | skipu (char *string, char toskip, NSTRBYTE *iterator, int inc)
| skip until 'toskip' occurence is found from 'iterator' to the next 'toskip' value. The new iterator index is automatically stored, returning to it first value if an error append. More...
int | strup (char *string, char *dest)
| Upper case a string. More...
int | strlo (char *string, char *dest)
| Upper case a string. More...
int | strcpy_u (char *from, char *to, NSTRBYTE to_size, char split, NSTRBYTE *it)
| Copy from start to dest until from[ iterator ] == split. More...
char ** | split (char *chaine, const char *delim, int vide)
| Split the strings into a an array of char *pointer , ended by a NULL one. Max 256 splitted elements per call. More...
int | split_count (char **split_result)
| Count split elements. More...
int | free_split_result (char ***tab)
| Free a split result allocated array. More...
int | write_and_fit (char **dest, NSTRBYTE *size, NSTRBYTE *written, char *src)
int | scan_dir (const char *dir, LIST *result, const int recurse)
| Scan a list of directory and return a list of char *file. More...
int | wildmat (register const char *text, register const char *p)
| Written by Rich Salz rsalz at osf.org, refurbished by me. Wildcard pattern matching . More...
int | wildmatcase (register const char *text, register const char *p)
| Written by Rich Salz rsalz at osf.org, refurbished by me. Wildcard pattern matching case insensitive. More...
char * | str_replace (const char *string, const char *substr, const char *replacement)
| Replace "substr" by "replacement" inside string taken from http://coding.debuntu.org/c-implementing-str_replace-replace-all-occurrences-substring By Chantra. More...

## Detailed Description

N_STR and string function declaration

Author
  Castagnier Mickaël

Version
  2.0

Date
  05/02/14

Definition in file n_str.h.