CXXR (C++ R)
Macros | Enumerations | Functions
character.cpp File Reference

($Id: character.cpp 1348 2013-02-25 17:49:03Z arr $)

#include <config.h>
#include <Defn.h>
#include <errno.h>
#include <R_ext/RS.h>
#include <R_ext/rlocale.h>
#include "RBufferUtils.h"
Include dependency graph for character.cpp:

Macros

#define SWAP(_a, _b, _TYPE)
#define ISORT(_base, _num, _TYPE, _comp)
#define COMPRESS(_base, _num, _TYPE, _comp)
#define BSEARCH(_rc, _key, _base, _nmemb, _TYPE, _comp)

Enumerations

enum  wtr_type { , WTR_CHAR, WTR_RANGE }
enum  tr_spec_type { TR_INIT, TR_CHAR, TR_RANGE }

Functions

SEXP attribute_hidden do_nzchar (SEXP call, SEXP op, SEXP args, SEXP env)
SEXP attribute_hidden do_nchar (SEXP call, SEXP op, SEXP args, SEXP env)
SEXP attribute_hidden do_substr (SEXP call, SEXP op, SEXP args, SEXP env)
SEXP attribute_hidden do_substrgets (SEXP call, SEXP op, SEXP args, SEXP env)
SEXP attribute_hidden do_abbrev (SEXP call, SEXP op, SEXP args, SEXP env)
SEXP attribute_hidden do_makenames (SEXP call, SEXP op, SEXP args, SEXP env)
SEXP attribute_hidden do_tolower (SEXP call, SEXP op, SEXP args, SEXP env)
SEXP attribute_hidden do_chartr (SEXP call, SEXP op, SEXP args, SEXP env)
SEXP attribute_hidden do_strtrim (SEXP call, SEXP op, SEXP args, SEXP env)
SEXP attribute_hidden do_strtoi (SEXP call, SEXP op, SEXP args, SEXP env)

Detailed Description

All sorts of character manipulation, including grep and agrep.


Macro Definition Documentation

#define ISORT (   _base,
  _num,
  _TYPE,
  _comp 
)
Value:
{ \
/* insert sort */ \
/* require stable data */ \
int _i, _j ; \
for ( _i = 1 ; _i < _num ; _i++ ) \
for ( _j = _i; _j > 0 && \
(*_comp)(_base+_j-1, _base+_j)>0; _j--) \
SWAP(_base+_j-1, _base+_j, _TYPE); \
}
#define SWAP (   _a,
  _b,
  _TYPE 
)
Value:
{ \
_TYPE _t; \
_t = *(_a); \
*(_a) = *(_b); \
*(_b) = _t; \
}