Ruby  3.4.0dev (2024-11-05 revision 348a53415339076afc4a02fcd09f3ae36e9c4c61)
Functions
ctype.h File Reference

(348a53415339076afc4a02fcd09f3ae36e9c4c61)

Routines to query chacater types. More...

#include "ruby/onigmo.h"
#include "ruby/internal/attr/const.h"
#include "ruby/internal/dllexport.h"
#include "ruby/internal/encoding/encoding.h"
#include "ruby/internal/value.h"
Include dependency graph for ctype.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

static bool rb_enc_is_newline (const char *p, const char *e, rb_encoding *enc)
 Queries if the passed pointer points to a newline character. More...
 
static bool rb_enc_isctype (OnigCodePoint c, OnigCtype t, rb_encoding *enc)
 Queries if the passed code point is of passed character type in the passed encoding. More...
 
static bool rb_enc_isascii (OnigCodePoint c, rb_encoding *enc)
 Identical to rb_isascii(), except it additionally takes an encoding. More...
 
static bool rb_enc_isalpha (OnigCodePoint c, rb_encoding *enc)
 Identical to rb_isalpha(), except it additionally takes an encoding. More...
 
static bool rb_enc_islower (OnigCodePoint c, rb_encoding *enc)
 Identical to rb_islower(), except it additionally takes an encoding. More...
 
static bool rb_enc_isupper (OnigCodePoint c, rb_encoding *enc)
 Identical to rb_isupper(), except it additionally takes an encoding. More...
 
static bool rb_enc_iscntrl (OnigCodePoint c, rb_encoding *enc)
 Identical to rb_iscntrl(), except it additionally takes an encoding. More...
 
static bool rb_enc_ispunct (OnigCodePoint c, rb_encoding *enc)
 Identical to rb_ispunct(), except it additionally takes an encoding. More...
 
static bool rb_enc_isalnum (OnigCodePoint c, rb_encoding *enc)
 Identical to rb_isalnum(), except it additionally takes an encoding. More...
 
static bool rb_enc_isprint (OnigCodePoint c, rb_encoding *enc)
 Identical to rb_isprint(), except it additionally takes an encoding. More...
 
static bool rb_enc_isspace (OnigCodePoint c, rb_encoding *enc)
 Identical to rb_isspace(), except it additionally takes an encoding. More...
 
static bool rb_enc_isdigit (OnigCodePoint c, rb_encoding *enc)
 Identical to rb_isdigit(), except it additionally takes an encoding. More...
 
int rb_enc_toupper (int c, rb_encoding *enc)
 Identical to rb_toupper(), except it additionally takes an encoding. More...
 
int rb_enc_tolower (int c, rb_encoding *enc)
 Identical to rb_tolower(), except it additionally takes an encoding. More...
 

Detailed Description

Routines to query chacater types.

Author
Ruby developers ruby-.nosp@m.core.nosp@m.@ruby.nosp@m.-lan.nosp@m.g.org
Warning
Symbols prefixed with either RBIMPL or rbimpl are implementation details. Don't take them as canon. They could rapidly appear then vanish. The name (path) of this header file is also an implementation detail. Do not expect it to persist at the place it is now. Developers are free to move it anywhere anytime at will.
Note
To ruby-core: remember that this header can be possibly recursively included from extension libraries written in C++. Do not expect for instance __VA_ARGS__ is always available. We assume C99 for ruby itself but we don't assume languages of extension libraries. They could be written in C++98.

Definition in file ctype.h.

Function Documentation

◆ rb_enc_is_newline()

static bool rb_enc_is_newline ( const char *  p,
const char *  e,
rb_encoding enc 
)
inlinestatic

Queries if the passed pointer points to a newline character.

What is a newline and what is not depends on the passed encoding.

Parameters
[in]pPointer to a possibly-middle of a character.
[in]endEnd of the string.
[in]encEncoding.
Return values
falseIt isn't.
trueIt is.

Definition at line 43 of file ctype.h.

◆ rb_enc_isalnum()

static bool rb_enc_isalnum ( OnigCodePoint  c,
rb_encoding enc 
)
inlinestatic

Identical to rb_isalnum(), except it additionally takes an encoding.

Parameters
[in]cA code point.
[in]encAn encoding.
Return values
trueenc classifies c as "ANUM".
falseOtherwise.

Definition at line 166 of file ctype.h.

◆ rb_enc_isalpha()

static bool rb_enc_isalpha ( OnigCodePoint  c,
rb_encoding enc 
)
inlinestatic

Identical to rb_isalpha(), except it additionally takes an encoding.

Parameters
[in]cA code point.
[in]encAn encoding.
Return values
trueenc classifies c as "ALPHA".
falseOtherwise.

Definition at line 96 of file ctype.h.

◆ rb_enc_isascii()

static bool rb_enc_isascii ( OnigCodePoint  c,
rb_encoding enc 
)
inlinestatic

Identical to rb_isascii(), except it additionally takes an encoding.

Parameters
[in]cA code point.
[in]encAn encoding.
Return values
falsec is out of range of ASCII character set in enc.
trueOtherwise.

Definition at line 82 of file ctype.h.

Referenced by rb_enc_ascget(), and rb_str_inspect().

◆ rb_enc_iscntrl()

static bool rb_enc_iscntrl ( OnigCodePoint  c,
rb_encoding enc 
)
inlinestatic

Identical to rb_iscntrl(), except it additionally takes an encoding.

Parameters
[in]cA code point.
[in]encAn encoding.
Return values
trueenc classifies c as "CNTRL".
falseOtherwise.

Definition at line 138 of file ctype.h.

◆ rb_enc_isctype()

static bool rb_enc_isctype ( OnigCodePoint  c,
OnigCtype  t,
rb_encoding enc 
)
inlinestatic

Queries if the passed code point is of passed character type in the passed encoding.

The "character type" here is a set of macros defined in onigmo.h, like ONIGENC_CTYPE_PUNCT.

Parameters
[in]cAn OnigCodePoint value.
[in]tAn OnigCtype value.
[in]encA rb_encoding* value.
Return values
truec is of t in enc.
falseOtherwise.

Definition at line 63 of file ctype.h.

◆ rb_enc_isdigit()

static bool rb_enc_isdigit ( OnigCodePoint  c,
rb_encoding enc 
)
inlinestatic

Identical to rb_isdigit(), except it additionally takes an encoding.

Parameters
[in]cA code point.
[in]encAn encoding.
Return values
trueenc classifies c as "DIGIT".
falseOtherwise.

Definition at line 208 of file ctype.h.

◆ rb_enc_islower()

static bool rb_enc_islower ( OnigCodePoint  c,
rb_encoding enc 
)
inlinestatic

Identical to rb_islower(), except it additionally takes an encoding.

Parameters
[in]cA code point.
[in]encAn encoding.
Return values
trueenc classifies c as "LOWER".
falseOtherwise.

Definition at line 110 of file ctype.h.

◆ rb_enc_isprint()

static bool rb_enc_isprint ( OnigCodePoint  c,
rb_encoding enc 
)
inlinestatic

Identical to rb_isprint(), except it additionally takes an encoding.

Parameters
[in]cA code point.
[in]encAn encoding.
Return values
trueenc classifies c as "PRINT".
falseOtherwise.

Definition at line 180 of file ctype.h.

Referenced by rb_str_format(), and rb_str_inspect().

◆ rb_enc_ispunct()

static bool rb_enc_ispunct ( OnigCodePoint  c,
rb_encoding enc 
)
inlinestatic

Identical to rb_ispunct(), except it additionally takes an encoding.

Parameters
[in]cA code point.
[in]encAn encoding.
Return values
trueenc classifies c as "PUNCT".
falseOtherwise.

Definition at line 152 of file ctype.h.

◆ rb_enc_isspace()

static bool rb_enc_isspace ( OnigCodePoint  c,
rb_encoding enc 
)
inlinestatic

Identical to rb_isspace(), except it additionally takes an encoding.

Parameters
[in]cA code point.
[in]encAn encoding.
Return values
trueenc classifies c as "PRINT".
falseOtherwise.

Definition at line 194 of file ctype.h.

◆ rb_enc_isupper()

static bool rb_enc_isupper ( OnigCodePoint  c,
rb_encoding enc 
)
inlinestatic

Identical to rb_isupper(), except it additionally takes an encoding.

Parameters
[in]cA code point.
[in]encAn encoding.
Return values
trueenc classifies c as "UPPER".
falseOtherwise.

Definition at line 124 of file ctype.h.

◆ rb_enc_tolower()

int rb_enc_tolower ( int  c,
rb_encoding enc 
)

Identical to rb_tolower(), except it additionally takes an encoding.

Parameters
[in]cA code point.
[in]encAn encoding.
Returns
c's (Ruby's definition of) lower case counterpart.

Definition at line 1242 of file encoding.c.

◆ rb_enc_toupper()

int rb_enc_toupper ( int  c,
rb_encoding enc 
)

Identical to rb_toupper(), except it additionally takes an encoding.

Parameters
[in]cA code point.
[in]encAn encoding.
Returns
c's (Ruby's definition of) upper case counterpart.

Definition at line 1236 of file encoding.c.

Referenced by rb_str_format().