Back to index

php5  5.3.10
Functions
reggnu.c File Reference
#include "regint.h"
#include "oniggnu.h"

Go to the source code of this file.

Functions

void re_free_registers (OnigRegion *r)
int re_adjust_startpos (regex_t *reg, const char *string, int size, int startpos, int range)
int re_match (regex_t *reg, const char *str, int size, int pos, struct re_registers *regs)
int re_search (regex_t *bufp, const char *string, int size, int startpos, int range, struct re_registers *regs)
int re_compile_pattern (const char *pattern, int size, regex_t *reg, char *ebuf)
void re_free_pattern (regex_t *reg)
int re_alloc_pattern (regex_t **reg)
void re_set_casetable (const char *table)
void re_mbcinit (int mb_code)

Function Documentation

int re_adjust_startpos ( regex_t reg,
const char *  string,
int  size,
int  startpos,
int  range 
)

Definition at line 44 of file reggnu.c.

{
  if (startpos > 0 && ONIGENC_MBC_MAXLEN(reg->enc) != 1 && startpos < size) {
    UChar *p;
    UChar *s = (UChar* )string + startpos;

    if (range > 0) {
      p = onigenc_get_right_adjust_char_head(reg->enc, (UChar* )string, s);
    }
    else {
      p = ONIGENC_LEFT_ADJUST_CHAR_HEAD(reg->enc, (UChar* )string, s);
    }
    return p - (UChar* )string;
  }

  return startpos;
}

Here is the call graph for this function:

Definition at line 126 of file reggnu.c.

Here is the call graph for this function:

int re_compile_pattern ( const char *  pattern,
int  size,
regex_t reg,
char *  ebuf 
)

Definition at line 82 of file reggnu.c.

{
  int r;
  OnigErrorInfo einfo;

  r = onig_compile(reg, (UChar* )pattern, (UChar* )(pattern + size), &einfo);
  if (r != 0) {
    if (IS_NOT_NULL(ebuf))
      (void )onig_error_code_to_str((UChar* )ebuf, r, &einfo);
  }

  return r;
}

Here is the call graph for this function:

void re_free_pattern ( regex_t reg)

Definition at line 120 of file reggnu.c.

{
  onig_free(reg);
}

Here is the call graph for this function:

void re_free_registers ( OnigRegion *  r)

Definition at line 37 of file reggnu.c.

{
  /* 0: don't free self */
  onig_region_free(r, 0);
}

Here is the call graph for this function:

int re_match ( regex_t reg,
const char *  str,
int  size,
int  pos,
struct re_registers regs 
)

Definition at line 64 of file reggnu.c.

{
  return onig_match(reg, (UChar* )str, (UChar* )(str + size),
                  (UChar* )(str + pos), regs, ONIG_OPTION_NONE);
}

Here is the call graph for this function:

void re_mbcinit ( int  mb_code)

Definition at line 144 of file reggnu.c.

{
#ifdef ONIG_RUBY_M17N

  onigenc_set_default_encoding(enc);

#else

  OnigEncoding enc;

  switch (mb_code) {
  case RE_MBCTYPE_ASCII:
    enc = ONIG_ENCODING_ASCII;
    break;
  case RE_MBCTYPE_EUC:
    enc = ONIG_ENCODING_EUC_JP;
    break;
  case RE_MBCTYPE_SJIS:
    enc = ONIG_ENCODING_SJIS;
    break;
  case RE_MBCTYPE_UTF8:
    enc = ONIG_ENCODING_UTF8;
    break;
  default:
    return ;
    break;
  }

  onigenc_set_default_encoding(enc);
#endif
}

Here is the call graph for this function:

int re_search ( regex_t bufp,
const char *  string,
int  size,
int  startpos,
int  range,
struct re_registers regs 
)

Definition at line 72 of file reggnu.c.

{
  return onig_search(bufp, (UChar* )string, (UChar* )(string + size),
                   (UChar* )(string + startpos),
                   (UChar* )(string + startpos + range),
                   regs, ONIG_OPTION_NONE);
}

Here is the call graph for this function:

void re_set_casetable ( const char *  table)

Definition at line 135 of file reggnu.c.

Here is the call graph for this function: