Groonga 3.0.9 Source Code Document
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Data Structures | Macros | Typedefs | Functions | Variables
string.c File Reference
#include <ctype.h>
#include <limits.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include "mruby.h"
#include "mruby/array.h"
#include "mruby/class.h"
#include "mruby/range.h"
#include "re.h"
Include dependency graph for string.c:

Go to the source code of this file.

Data Structures

struct  mrb_shared_string

Macros

#define MRB_STR_SHARED   1
#define MRB_STR_NOFREE   2
#define RESIZE_CAPA(s, capacity)
#define mrb_obj_alloc_string(mrb)   ((struct RString*)mrb_obj_alloc((mrb), MRB_TT_STRING, (mrb)->string_class))
#define MRB_STR_BUF_MIN_SIZE   128
#define lesser(a, b)   (((a)>(b))?(b):(a))
#define STR_REPLACE_SHARED_MIN   10
#define ascii_isspace(c)   isspacetable[(unsigned char)(c)]
#define ISDIGIT(c)   ('0' <= (c) && (c) <= '9')
#define conv_digit(c)
#define DBL_DIG   16
#define OutOfRange()
#define CHAR_ESC_LEN   13 /* sizeof(\x{ hex of 32bit unsigned int } \0) */

Typedefs

typedef struct mrb_shared_string mrb_shared_string

Functions

void mrb_str_modify (mrb_state *mrb, struct RString *s)
mrb_value mrb_str_resize (mrb_state *mrb, mrb_value str, mrb_int len)
int mrb_str_offset (mrb_state *mrb, mrb_value str, int pos)
void str_with_class (mrb_state *mrb, struct RString *s, mrb_value obj)
mrb_value mrb_str_buf_new (mrb_state *mrb, mrb_int capa)
mrb_value mrb_str_buf_cat (mrb_state *mrb, mrb_value str, const char *ptr, size_t len)
mrb_value mrb_str_new (mrb_state *mrb, const char *p, size_t len)
mrb_value mrb_str_new_cstr (mrb_state *mrb, const char *p)
mrb_value mrb_str_new_static (mrb_state *mrb, const char *p, size_t len)
void mrb_gc_free_str (mrb_state *mrb, struct RString *str)
char * mrb_str_to_cstr (mrb_state *mrb, mrb_value str0)
mrb_value mrb_str_literal (mrb_state *mrb, mrb_value str)
const char * mrb_str_body (mrb_value str, int *len_p)
void mrb_str_concat (mrb_state *mrb, mrb_value self, mrb_value other)
mrb_value mrb_str_plus (mrb_state *mrb, mrb_value a, mrb_value b)
mrb_value mrb_str_size (mrb_state *mrb, mrb_value self)
int mrb_str_cmp (mrb_state *mrb, mrb_value str1, mrb_value str2)
mrb_bool mrb_str_equal (mrb_state *mrb, mrb_value str1, mrb_value str2)
mrb_value mrb_str_to_str (mrb_state *mrb, mrb_value str)
char * mrb_string_value_ptr (mrb_state *mrb, mrb_value ptr)
mrb_value mrb_str_dup (mrb_state *mrb, mrb_value str)
mrb_value mrb_str_substr (mrb_state *mrb, mrb_value str, mrb_int beg, mrb_int len)
mrb_value mrb_str_buf_append (mrb_state *mrb, mrb_value str, mrb_value str2)
mrb_int mrb_str_hash (mrb_state *mrb, mrb_value str)
mrb_value mrb_str_intern (mrb_state *mrb, mrb_value self)
mrb_value mrb_obj_as_string (mrb_state *mrb, mrb_value obj)
mrb_value mrb_ptr_to_str (mrb_state *mrb, void *p)
mrb_value mrb_string_type (mrb_state *mrb, mrb_value str)
mrb_value mrb_check_string_type (mrb_state *mrb, mrb_value str)
mrb_value mrb_cstr_to_inum (mrb_state *mrb, const char *str, int base, int badcheck)
char * mrb_string_value_cstr (mrb_state *mrb, mrb_value *ptr)
mrb_value mrb_str_to_inum (mrb_state *mrb, mrb_value str, int base, int badcheck)
double mrb_cstr_to_dbl (mrb_state *mrb, const char *p, int badcheck)
double mrb_str_to_dbl (mrb_state *mrb, mrb_value str, int badcheck)
mrb_value mrb_str_dump (mrb_state *mrb, mrb_value str)
mrb_value mrb_str_cat (mrb_state *mrb, mrb_value str, const char *ptr, size_t len)
mrb_value mrb_str_cat_cstr (mrb_state *mrb, mrb_value str, const char *ptr)
mrb_value mrb_str_append (mrb_state *mrb, mrb_value str, mrb_value str2)
mrb_value mrb_str_inspect (mrb_state *mrb, mrb_value str)
void mrb_init_string (mrb_state *mrb)

Variables

const char mrb_digitmap [] = "0123456789abcdefghijklmnopqrstuvwxyz"

Macro Definition Documentation

#define ascii_isspace (   c)    isspacetable[(unsigned char)(c)]

Definition at line 1744 of file string.c.

#define CHAR_ESC_LEN   13 /* sizeof(\x{ hex of 32bit unsigned int } \0) */

Definition at line 2438 of file string.c.

#define conv_digit (   c)
Value:
(!ISASCII(c) ? -1 : \
isdigit(c) ? ((c) - '0') : \
islower(c) ? ((c) - 'a' + 10) : \
isupper(c) ? ((c) - 'A' + 10) : \
-1)
#define DBL_DIG   16
#define ISDIGIT (   c)    ('0' <= (c) && (c) <= '9')
#define lesser (   a,
 
)    (((a)>(b))?(b):(a))

Definition at line 514 of file string.c.

#define mrb_obj_alloc_string (   mrb)    ((struct RString*)mrb_obj_alloc((mrb), MRB_TT_STRING, (mrb)->string_class))

Definition at line 127 of file string.c.

#define MRB_STR_BUF_MIN_SIZE   128

Definition at line 168 of file string.c.

#define MRB_STR_NOFREE   2

Definition at line 34 of file string.c.

#define MRB_STR_SHARED   1

Definition at line 33 of file string.c.

#define OutOfRange ( )
Value:
(((w = end - p) > max_width) ? \
(w = max_width, ellipsis = "...") : \
(w = (int)(end - p), ellipsis = ""))
#define RESIZE_CAPA (   s,
  capacity 
)
Value:
do {\
s->ptr = (char *)mrb_realloc(mrb, s->ptr, (capacity)+1);\
s->aux.capa = capacity;\
} while(0)

Definition at line 39 of file string.c.

#define STR_REPLACE_SHARED_MIN   10

Definition at line 1376 of file string.c.

Typedef Documentation

Function Documentation

mrb_value mrb_check_string_type ( mrb_state mrb,
mrb_value  str 
)

Definition at line 1534 of file string.c.

Here is the call graph for this function:

Here is the caller graph for this function:

double mrb_cstr_to_dbl ( mrb_state mrb,
const char *  p,
int  badcheck 
)

Definition at line 2118 of file string.c.

Here is the call graph for this function:

Here is the caller graph for this function:

mrb_value mrb_cstr_to_inum ( mrb_state mrb,
const char *  str,
int  base,
int  badcheck 
)

Definition at line 1914 of file string.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void mrb_gc_free_str ( mrb_state mrb,
struct RString str 
)

Definition at line 283 of file string.c.

Here is the call graph for this function:

void mrb_init_string ( mrb_state mrb)

Definition at line 2529 of file string.c.

Here is the call graph for this function:

Here is the caller graph for this function:

mrb_value mrb_obj_as_string ( mrb_state mrb,
mrb_value  obj 
)

Definition at line 1484 of file string.c.

Here is the call graph for this function:

Here is the caller graph for this function:

mrb_value mrb_ptr_to_str ( mrb_state mrb,
void *  p 
)

Definition at line 1498 of file string.c.

Here is the caller graph for this function:

mrb_value mrb_str_append ( mrb_state mrb,
mrb_value  str,
mrb_value  str2 
)

Definition at line 2432 of file string.c.

Here is the call graph for this function:

const char* mrb_str_body ( mrb_value  str,
int *  len_p 
)

Definition at line 369 of file string.c.

mrb_value mrb_str_buf_append ( mrb_state mrb,
mrb_value  str,
mrb_value  str2 
)

Definition at line 1223 of file string.c.

Here is the call graph for this function:

Here is the caller graph for this function:

mrb_value mrb_str_buf_cat ( mrb_state mrb,
mrb_value  str,
const char *  ptr,
size_t  len 
)

Definition at line 225 of file string.c.

Here is the caller graph for this function:

mrb_value mrb_str_buf_new ( mrb_state mrb,
mrb_int  capa 
)

Definition at line 172 of file string.c.

Here is the call graph for this function:

Here is the caller graph for this function:

mrb_value mrb_str_cat ( mrb_state mrb,
mrb_value  str,
const char *  ptr,
size_t  len 
)

Definition at line 2416 of file string.c.

Here is the call graph for this function:

Here is the caller graph for this function:

mrb_value mrb_str_cat_cstr ( mrb_state mrb,
mrb_value  str,
const char *  ptr 
)

Definition at line 2426 of file string.c.

Here is the call graph for this function:

int mrb_str_cmp ( mrb_state mrb,
mrb_value  str1,
mrb_value  str2 
)

Definition at line 525 of file string.c.

void mrb_str_concat ( mrb_state mrb,
mrb_value  self,
mrb_value  other 
)

Definition at line 384 of file string.c.

Here is the call graph for this function:

Here is the caller graph for this function:

mrb_value mrb_str_dump ( mrb_state mrb,
mrb_value  str 
)

Definition at line 2303 of file string.c.

Here is the call graph for this function:

Here is the caller graph for this function:

mrb_value mrb_str_dup ( mrb_state mrb,
mrb_value  str 
)

Definition at line 757 of file string.c.

Here is the call graph for this function:

mrb_bool mrb_str_equal ( mrb_state mrb,
mrb_value  str1,
mrb_value  str2 
)

Definition at line 611 of file string.c.

Here is the call graph for this function:

mrb_int mrb_str_hash ( mrb_state mrb,
mrb_value  str 
)

Definition at line 1230 of file string.c.

mrb_value mrb_str_inspect ( mrb_state mrb,
mrb_value  str 
)

Definition at line 2452 of file string.c.

Here is the call graph for this function:

Here is the caller graph for this function:

mrb_value mrb_str_intern ( mrb_state mrb,
mrb_value  self 
)

Definition at line 1474 of file string.c.

Here is the call graph for this function:

Here is the caller graph for this function:

mrb_value mrb_str_literal ( mrb_state mrb,
mrb_value  str 
)

Definition at line 342 of file string.c.

void mrb_str_modify ( mrb_state mrb,
struct RString s 
)

Definition at line 57 of file string.c.

Here is the call graph for this function:

Here is the caller graph for this function:

mrb_value mrb_str_new ( mrb_state mrb,
const char *  p,
size_t  len 
)

Definition at line 233 of file string.c.

Here is the caller graph for this function:

mrb_value mrb_str_new_cstr ( mrb_state mrb,
const char *  p 
)

Definition at line 249 of file string.c.

Here is the call graph for this function:

Here is the caller graph for this function:

mrb_value mrb_str_new_static ( mrb_state mrb,
const char *  p,
size_t  len 
)

Definition at line 270 of file string.c.

Here is the caller graph for this function:

int mrb_str_offset ( mrb_state mrb,
mrb_value  str,
int  pos 
)

Definition at line 131 of file string.c.

mrb_value mrb_str_plus ( mrb_state mrb,
mrb_value  a,
mrb_value  b 
)

Definition at line 412 of file string.c.

Here is the caller graph for this function:

mrb_value mrb_str_resize ( mrb_state mrb,
mrb_value  str,
mrb_int  len 
)

Definition at line 100 of file string.c.

Here is the call graph for this function:

Here is the caller graph for this function:

mrb_value mrb_str_size ( mrb_state mrb,
mrb_value  self 
)

Definition at line 464 of file string.c.

Here is the caller graph for this function:

mrb_value mrb_str_substr ( mrb_state mrb,
mrb_value  str,
mrb_int  beg,
mrb_int  len 
)

Definition at line 1199 of file string.c.

char* mrb_str_to_cstr ( mrb_state mrb,
mrb_value  str0 
)

Definition at line 292 of file string.c.

Here is the call graph for this function:

double mrb_str_to_dbl ( mrb_state mrb,
mrb_value  str,
int  badcheck 
)

Definition at line 2187 of file string.c.

Here is the call graph for this function:

Here is the caller graph for this function:

mrb_value mrb_str_to_inum ( mrb_state mrb,
mrb_value  str,
int  base,
int  badcheck 
)

Definition at line 2055 of file string.c.

Here is the call graph for this function:

Here is the caller graph for this function:

mrb_value mrb_str_to_str ( mrb_state mrb,
mrb_value  str 
)

Definition at line 649 of file string.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1528 of file string.c.

Here is the call graph for this function:

char* mrb_string_value_cstr ( mrb_state mrb,
mrb_value ptr 
)

Definition at line 2043 of file string.c.

Here is the call graph for this function:

Here is the caller graph for this function:

char* mrb_string_value_ptr ( mrb_state mrb,
mrb_value  ptr 
)

Definition at line 664 of file string.c.

Here is the call graph for this function:

void str_with_class ( mrb_state mrb,
struct RString s,
mrb_value  obj 
)

Definition at line 153 of file string.c.

Here is the caller graph for this function:

Variable Documentation

const char mrb_digitmap[] = "0123456789abcdefghijklmnopqrstuvwxyz"

Definition at line 24 of file string.c.