Simple utilities sink - stuff that doesn't fit anywhere else / objects in plain C Snapshot
Classes | Defines | Typedefs | Functions
strtk.h File Reference
#include <cutils/base.h>

Go to the source code of this file.

Classes

struct  tagSTRTK

Defines

#define STRTK_PATTERN_SIZE   ( 256 / 8 )
#define STRTK_IS_CHAR(tok, ch)   ( (tok)->pattern[ (ch) >> 3 ] && (1 << ((ch) & 7)) )
 macro checks if character is part of character class

Typedefs

typedef struct tagSTRTK STRTK

Functions

void STRTK_init (STRTK *tok, const char *stop_chars)
 initalise a character class
M_INLINE void STRTK_add_char (STRTK *tok, uint8_t ch)
M_INLINE char * STRTK_spn (STRTK *tok, const char *hay)
 Returns token where all characters belong to argument character class.
M_INLINE char * STRTK_nspn (STRTK *tok, const char *hay, size_t nsize)
 Returns token where all characters belong to argument character class, argument string is limited.
M_INLINE char * STRTK_ntok (STRTK *tok, const char *hay, size_t nsize, char **end_tok)
 tokenize a string . the character class is interpreted as set of white spaces.
M_INLINE char * STRTK_tok (STRTK *tok, const char *hay, char **end_tok)
 tokenize a string . the character class is interpreted as set of white spaces.

Define Documentation

#define STRTK_PATTERN_SIZE   ( 256 / 8 )

Definition at line 6 of file strtk.h.