|
Ruby
1.9.3p551(2014-11-13revision48407)
|
Go to the source code of this file.
Data Structures | |
| struct | strscanner |
Macros | |
| #define | STRSCAN_VERSION "0.7.0" |
| #define | PRIsVALUE "s" |
| #define | RB_OBJ_CLASSNAME(obj) rb_obj_classname(obj) |
| #define | RB_OBJ_STRING(obj) StringValueCStr(obj) |
| #define | FLAG_MATCHED (1 << 0) |
| #define | MATCHED_P(s) ((s)->flags & FLAG_MATCHED) |
| #define | MATCHED(s) (s)->flags |= FLAG_MATCHED |
| #define | CLEAR_MATCH_STATUS(s) (s)->flags &= ~FLAG_MATCHED |
| #define | S_PBEG(s) (RSTRING_PTR((s)->str)) |
| #define | S_LEN(s) (RSTRING_LEN((s)->str)) |
| #define | S_PEND(s) (S_PBEG(s) + S_LEN(s)) |
| #define | CURPTR(s) (S_PBEG(s) + (s)->curr) |
| #define | S_RESTLEN(s) (S_LEN(s) - (s)->curr) |
| #define | EOS_P(s) ((s)->curr >= RSTRING_LEN(p->str)) |
| #define | GET_SCANNER(obj, var) |
| #define | INSPECT_LENGTH 5 |
| #define | BUFSIZE 256 |
Variables | |
| static VALUE | StringScanner |
| static VALUE | ScanError |
| #define BUFSIZE 256 |
Definition at line 1058 of file strscan.c.
Referenced by inspect1().
| #define CLEAR_MATCH_STATUS | ( | s | ) | (s)->flags &= ~FLAG_MATCHED |
Definition at line 52 of file strscan.c.
Referenced by strscan_do_scan(), strscan_get_byte(), strscan_getch(), strscan_reset(), strscan_s_allocate(), strscan_set_string(), strscan_terminate(), and strscan_unscan().
| #define CURPTR | ( | s | ) | (S_PBEG(s) + (s)->curr) |
Definition at line 57 of file strscan.c.
Referenced by inspect1(), inspect2(), strscan_bol_p(), strscan_do_scan(), and strscan_getch().
| #define EOS_P | ( | s | ) | ((s)->curr >= RSTRING_LEN(p->str)) |
Definition at line 60 of file strscan.c.
Referenced by inspect2(), strscan_eos_p(), strscan_get_byte(), strscan_getch(), strscan_inspect(), strscan_peek(), strscan_rest(), strscan_rest_p(), and strscan_rest_size().
| #define GET_SCANNER | ( | obj, | |
| var | |||
| ) |
Definition at line 62 of file strscan.c.
Referenced by strscan_aref(), strscan_bol_p(), strscan_concat(), strscan_do_scan(), strscan_eos_p(), strscan_get_byte(), strscan_get_pos(), strscan_get_string(), strscan_getch(), strscan_matched(), strscan_matched_p(), strscan_matched_size(), strscan_peek(), strscan_post_match(), strscan_pre_match(), strscan_reset(), strscan_rest(), strscan_rest_p(), strscan_rest_size(), strscan_set_pos(), strscan_terminate(), and strscan_unscan().
| #define INSPECT_LENGTH 5 |
Definition at line 1057 of file strscan.c.
Referenced by inspect1(), and inspect2().
| #define MATCHED | ( | s | ) | (s)->flags |= FLAG_MATCHED |
Definition at line 51 of file strscan.c.
Referenced by strscan_do_scan(), strscan_get_byte(), and strscan_getch().
| #define MATCHED_P | ( | s | ) | ((s)->flags & FLAG_MATCHED) |
Definition at line 50 of file strscan.c.
Referenced by strscan_aref(), strscan_matched(), strscan_matched_p(), strscan_matched_size(), strscan_post_match(), strscan_pre_match(), and strscan_unscan().
| #define PRIsVALUE "s" |
Definition at line 21 of file strscan.c.
Referenced by strscan_inspect().
| #define RB_OBJ_CLASSNAME | ( | obj | ) | rb_obj_classname(obj) |
Definition at line 22 of file strscan.c.
Referenced by strscan_inspect().
| #define RB_OBJ_STRING | ( | obj | ) | StringValueCStr(obj) |
Definition at line 23 of file strscan.c.
Referenced by strscan_inspect().
| #define S_LEN | ( | s | ) | (RSTRING_LEN((s)->str)) |
Definition at line 55 of file strscan.c.
Referenced by extract_beg_len(), extract_range(), inspect2(), strscan_getch(), strscan_inspect(), strscan_peek(), strscan_post_match(), strscan_rest(), strscan_rest_size(), strscan_set_pos(), and strscan_terminate().
| #define S_PBEG | ( | s | ) | (RSTRING_PTR((s)->str)) |
Definition at line 54 of file strscan.c.
Referenced by extract_beg_len(), and extract_range().
Definition at line 56 of file strscan.c.
Referenced by strscan_bol_p(), and strscan_getch().
| #define S_RESTLEN | ( | s | ) | (S_LEN(s) - (s)->curr) |
Definition at line 58 of file strscan.c.
Referenced by strscan_do_scan().
| #define STRSCAN_VERSION "0.7.0" |
Definition at line 15 of file strscan.c.
Referenced by Init_strscan().
|
static |
|
static |
|
static |
| void check_strscan _ | ( | (VALUE obj) | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 664 of file strscan.c.
References onig_region_clear(), onig_region_set(), and p.
Referenced by strscan_get_byte(), and strscan_getch().
| void check_strscan | ( | VALUE | obj | ) |
Definition at line 215 of file strscan.c.
References rb_eTypeError, rb_obj_classname(), rb_raise(), RDATA, strscan_mark(), T_DATA, and TYPE.
Referenced by strscan_init_copy().
|
static |
|
static |
Definition at line 147 of file strscan.c.
References infect(), p, Qnil, S_LEN, S_PBEG, and str_new().
Referenced by strscan_aref(), strscan_get_byte(), strscan_getch(), strscan_matched(), strscan_post_match(), strscan_pre_match(), and strscan_rest().
|
static |
Definition at line 132 of file strscan.c.
References OBJ_INFECT, and p.
Referenced by extract_beg_len(), extract_range(), strscan_inspect(), strscan_peek(), and strscan_rest().
| void Init_strscan | ( | ) |
Definition at line 1248 of file strscan.c.
References rb_alias(), rb_cObject, rb_const_defined(), rb_const_set(), rb_define_alloc_func(), rb_define_class(), rb_define_class_under(), rb_define_method(), rb_define_private_method(), rb_define_singleton_method(), rb_eStandardError, rb_intern, rb_obj_freeze(), rb_str_new2(), ScanError, StringScanner, strscan_aref(), strscan_bol_p(), strscan_check(), strscan_check_until(), strscan_clear(), strscan_concat(), strscan_empty_p(), strscan_eos_p(), strscan_exist_p(), strscan_get_byte(), strscan_get_pos(), strscan_get_string(), strscan_getbyte(), strscan_getch(), strscan_init_copy(), strscan_initialize(), strscan_inspect(), strscan_match_p(), strscan_matched(), strscan_matched_p(), strscan_matched_size(), strscan_peek(), strscan_peep(), strscan_post_match(), strscan_pre_match(), strscan_reset(), strscan_rest(), strscan_rest_p(), strscan_rest_size(), strscan_restsize(), strscan_s_allocate(), strscan_s_mustc(), strscan_scan(), strscan_scan_full(), strscan_scan_until(), strscan_search_full(), strscan_set_pos(), strscan_set_string(), strscan_skip(), strscan_skip_until(), strscan_terminate(), strscan_unscan(), and STRSCAN_VERSION.
|
static |
Definition at line 1104 of file strscan.c.
References bp, buf, BUFSIZE, CURPTR, INSPECT_LENGTH, len, p, rb_str_dump(), rb_str_new(), and rb_str_new2().
Referenced by strscan_inspect().
|
static |
Definition at line 1123 of file strscan.c.
References CURPTR, EOS_P, INSPECT_LENGTH, len, p, rb_str_cat2(), rb_str_dump(), rb_str_new(), rb_str_new2(), S_LEN, and strscanner::str.
Referenced by strscan_inspect().
|
static |
Definition at line 139 of file strscan.c.
References len, p, rb_enc_copy(), and rb_str_new().
Referenced by extract_beg_len(), extract_range(), strscan_peek(), and strscan_rest().
Definition at line 956 of file strscan.c.
References extract_range(), GET_SCANNER, i, MATCHED_P, NUM2LONG(), p, and Qnil.
Referenced by Init_strscan().
Definition at line 828 of file strscan.c.
References CURPTR, GET_SCANNER, p, Qfalse, Qnil, Qtrue, and S_PEND.
Referenced by Init_strscan().
Definition at line 549 of file strscan.c.
References strscan_do_scan().
Referenced by Init_strscan().
Definition at line 643 of file strscan.c.
References strscan_do_scan().
Referenced by Init_strscan().
Definition at line 302 of file strscan.c.
References rb_warning(), and strscan_terminate().
Referenced by Init_strscan().
Definition at line 354 of file strscan.c.
References GET_SCANNER, p, rb_str_append(), strscanner::str, and StringValue.
Referenced by Init_strscan().
|
static |
Definition at line 412 of file strscan.c.
References Check_Type, CLEAR_MATCH_STATUS, CURPTR, extract_beg_len(), GET_SCANNER, INT2FIX, MATCHED, onig_free(), onig_match(), ONIG_OPTION_NONE, onig_search(), p, Qnil, rb_raise(), rb_reg_prepare_re(), RREGEXP, S_RESTLEN, ScanError, strscanner::str, T_REGEXP, and UChar.
Referenced by strscan_check(), strscan_check_until(), strscan_exist_p(), strscan_match_p(), strscan_scan(), strscan_scan_full(), strscan_scan_until(), strscan_search_full(), strscan_skip(), and strscan_skip_until().
Definition at line 862 of file strscan.c.
References rb_warning(), and strscan_eos_p().
Referenced by Init_strscan().
Definition at line 849 of file strscan.c.
References EOS_P, GET_SCANNER, p, Qfalse, and Qtrue.
Referenced by Init_strscan(), and strscan_empty_p().
Definition at line 602 of file strscan.c.
References strscan_do_scan().
Referenced by Init_strscan().
|
static |
Definition at line 175 of file strscan.c.
References onig_region_free(), p, and ruby_xfree().
Referenced by strscan_s_allocate().
Definition at line 724 of file strscan.c.
References adjust_registers_to_matched(), CLEAR_MATCH_STATUS, EOS_P, extract_range(), GET_SCANNER, MATCHED, p, and Qnil.
Referenced by Init_strscan(), and strscan_getbyte().
Definition at line 379 of file strscan.c.
References GET_SCANNER, INT2FIX, and p.
Referenced by Init_strscan().
Definition at line 312 of file strscan.c.
References GET_SCANNER, and p.
Referenced by Init_strscan().
Definition at line 746 of file strscan.c.
References rb_warning(), and strscan_get_byte().
Referenced by Init_strscan().
Definition at line 685 of file strscan.c.
References adjust_registers_to_matched(), CLEAR_MATCH_STATUS, CURPTR, EOS_P, extract_range(), GET_SCANNER, len, MATCHED, p, Qnil, rb_enc_get(), rb_enc_mbclen(), S_LEN, and S_PEND.
Referenced by Init_strscan().
Definition at line 232 of file strscan.c.
References check_strscan(), strscanner::curr, Data_Get_Struct, strscanner::flags, onig_region_copy(), strscanner::prev, strscanner::regs, and strscanner::str.
Referenced by Init_strscan().
Definition at line 201 of file strscan.c.
References argc, argv, Data_Get_Struct, p, rb_scan_args(), strscanner::str, and StringValue.
Referenced by Init_strscan().
Definition at line 1072 of file strscan.c.
References Data_Get_Struct, EOS_P, infect(), inspect1(), inspect2(), NIL_P, p, PRIsVALUE, RB_OBJ_CLASSNAME, RB_OBJ_STRING, rb_sprintf(), and S_LEN.
Referenced by Init_strscan().
|
static |
Definition at line 169 of file strscan.c.
References p, and rb_gc_mark().
Referenced by check_strscan(), and strscan_s_allocate().
Definition at line 505 of file strscan.c.
References strscan_do_scan().
Referenced by Init_strscan().
Definition at line 911 of file strscan.c.
References extract_range(), GET_SCANNER, MATCHED_P, p, and Qnil.
Referenced by Init_strscan().
Definition at line 895 of file strscan.c.
References GET_SCANNER, MATCHED_P, p, Qfalse, and Qtrue.
Referenced by Init_strscan().
Definition at line 932 of file strscan.c.
References GET_SCANNER, INT2NUM(), MATCHED_P, p, and Qnil.
Referenced by Init_strscan().
Definition at line 764 of file strscan.c.
References EOS_P, extract_beg_len(), GET_SCANNER, infect(), len, NUM2LONG(), p, S_LEN, and str_new().
Referenced by Init_strscan(), and strscan_peep().
Definition at line 785 of file strscan.c.
References rb_warning(), and strscan_peek().
Referenced by Init_strscan().
Definition at line 1004 of file strscan.c.
References extract_range(), GET_SCANNER, MATCHED_P, p, Qnil, and S_LEN.
Referenced by Init_strscan().
Definition at line 985 of file strscan.c.
References extract_range(), GET_SCANNER, MATCHED_P, p, and Qnil.
Referenced by Init_strscan().
Definition at line 269 of file strscan.c.
References CLEAR_MATCH_STATUS, GET_SCANNER, and p.
Referenced by Init_strscan().
Definition at line 1018 of file strscan.c.
References EOS_P, extract_range(), GET_SCANNER, infect(), p, S_LEN, and str_new().
Referenced by Init_strscan().
Definition at line 877 of file strscan.c.
References EOS_P, GET_SCANNER, p, Qfalse, and Qtrue.
Referenced by Init_strscan().
Definition at line 1033 of file strscan.c.
References EOS_P, GET_SCANNER, i, INT2FIX, p, and S_LEN.
Referenced by Init_strscan(), and strscan_restsize().
Definition at line 1051 of file strscan.c.
References rb_warning(), and strscan_rest_size().
Referenced by Init_strscan().
Definition at line 182 of file strscan.c.
References ALLOC, CLEAR_MATCH_STATUS, Data_Wrap_Struct, MEMZERO, onig_region_init(), p, Qnil, strscan_free(), and strscan_mark().
Referenced by Init_strscan().
Definition at line 260 of file strscan.c.
Referenced by Init_strscan().
Definition at line 488 of file strscan.c.
References strscan_do_scan().
Referenced by Init_strscan().
Definition at line 565 of file strscan.c.
References RTEST, and strscan_do_scan().
Referenced by Init_strscan().
Definition at line 583 of file strscan.c.
References strscan_do_scan().
Referenced by Init_strscan().
Definition at line 658 of file strscan.c.
References RTEST, and strscan_do_scan().
Referenced by Init_strscan().
Definition at line 397 of file strscan.c.
References GET_SCANNER, i, INT2NUM(), NUM2INT, p, rb_eRangeError, rb_raise(), S_LEN, and v.
Referenced by Init_strscan().
Definition at line 327 of file strscan.c.
References CLEAR_MATCH_STATUS, Data_Get_Struct, p, strscanner::str, and StringValue.
Referenced by Init_strscan().
Definition at line 528 of file strscan.c.
References strscan_do_scan().
Referenced by Init_strscan().
Definition at line 624 of file strscan.c.
References strscan_do_scan().
Referenced by Init_strscan().
Definition at line 287 of file strscan.c.
References CLEAR_MATCH_STATUS, GET_SCANNER, p, and S_LEN.
Referenced by Init_strscan(), and strscan_clear().
Definition at line 803 of file strscan.c.
References CLEAR_MATCH_STATUS, GET_SCANNER, MATCHED_P, p, rb_raise(), and ScanError.
Referenced by Init_strscan().
|
static |
Definition at line 31 of file strscan.c.
Referenced by Init_strscan(), strscan_do_scan(), and strscan_unscan().
|
static |
Definition at line 30 of file strscan.c.
Referenced by Init_strscan().
1.8.14