Ruby 2.7.0p0(2019-12-25revision647ee6f091eafcce70ffb75ddf7e121e192ab217)

Data Structures | Macros | Functions
strscan.c File Reference
`#include "ruby/ruby.h"`
`#include "ruby/re.h"`
`#include "ruby/encoding.h"`
`#include <stdbool.h>`

Go to the source code of this file.

## Data Structures
struct | strscanner

## Macros
#define | STRSCAN_VERSION "1.0.3"
#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

## Functions
void | Init_strscan (void)

## Macro Definition Documentation

## ◆ CLEAR_MATCH_STATUS

#define CLEAR_MATCH_STATUS | ( |  | s | ) | (s)->flags &= ~FLAG_MATCHED

Definition at line 60 of file strscan.c.

## ◆ CURPTR

#define CURPTR | ( |  | s | ) | (S_PBEG(s) + (s)->curr)

Definition at line 65 of file strscan.c.

## ◆ EOS_P

#define EOS_P | ( |  | s | ) | ((s)->curr >= RSTRING_LEN(p->str))

Definition at line 68 of file strscan.c.

## ◆ FLAG_MATCHED

#define FLAG_MATCHED (1 << 0)

Definition at line 39 of file strscan.c.

## ◆ GET_SCANNER

#define GET_SCANNER | ( |  | obj,
|  |  | var
| ) |  |

Value:
do {\
(var) = check_strscan(obj);\
if (NIL_P((var)->str)) rb_raise(rb_eArgError, "uninitialized StringScanner object");\
} while (0)

Definition at line 70 of file strscan.c.

## ◆ INSPECT_LENGTH

#define INSPECT_LENGTH 5

Definition at line 1364 of file strscan.c.

## ◆ MATCHED

#define MATCHED | ( |  | s | ) | (s)->flags |= FLAG_MATCHED

Definition at line 59 of file strscan.c.

## ◆ MATCHED_P

#define MATCHED_P | ( |  | s | ) | ((s)->flags & FLAG_MATCHED)

Definition at line 58 of file strscan.c.

## ◆ S_LEN

#define S_LEN | ( |  | s | ) | (RSTRING_LEN((s)->str))

Definition at line 63 of file strscan.c.

## ◆ S_PBEG

#define S_PBEG | ( |  | s | ) | (RSTRING_PTR((s)->str))

Definition at line 62 of file strscan.c.

## ◆ S_PEND

#define S_PEND | ( |  | s | ) | (S_PBEG(s) + S_LEN(s))

Definition at line 64 of file strscan.c.

## ◆ S_RESTLEN

#define S_RESTLEN | ( |  | s | ) | (S_LEN(s) - (s)->curr)

Definition at line 66 of file strscan.c.

## ◆ STRSCAN_VERSION

#define STRSCAN_VERSION "1.0.3"

Definition at line 25 of file strscan.c.

## Function Documentation

## ◆ Init_strscan()

void Init_strscan | ( | void |  | ) |

Definition at line 1571 of file strscan.c.

References rb_intern.

rb_eArgError
VALUE rb_eArgError
Definition: error.c:923
rb_raise
void rb_raise(VALUE exc, const char *fmt,...)
Definition: error.c:2669
obj
const VALUE VALUE obj
Definition: rb_mjit_min_header-2.7.0.h:5742
str
char str[HTML_ESCAPE_MAX_LEN+1]
Definition: escape.c:18
NIL_P
#define NIL_P(v)
Definition: ruby.h:482