Ruby
3.1.0dev(2021-09-10revisionb76ad15ed0da636161de0243c547ee1e6fc95681)
|
#include "ruby/internal/config.h"
#include <ctype.h>
#include <errno.h>
#include <float.h>
#include <math.h>
#include <stdio.h>
#include "internal.h"
#include "internal/sanitizers.h"
#include "internal/util.h"
#include "ruby/util.h"
#include "ruby_atomic.h"
#include <sys/types.h>
#include <sys/stat.h>
#include "missing/dtoa.c"
Go to the source code of this file.
Data Structures | |
struct | stack_node |
Macros | |
#define | hexdigit ruby_hexdigits |
#define | S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) |
#define | mmtype long |
#define | mmcount (16 / SIZEOF_LONG) |
#define | A ((mmtype*)a) |
#define | B ((mmtype*)b) |
#define | C ((mmtype*)c) |
#define | D ((mmtype*)d) |
#define | mmstep (sizeof(mmtype) * mmcount) |
#define | mmprepare(base, size) |
#define | mmarg mmkind, size, high, low |
#define | mmargdecl int mmkind, size_t size, size_t high, size_t low |
#define | mmswap(a, b) mmswap_((a),(b),mmarg) |
#define | mmrot3(a, b, c) mmrot3_((a),(b),(c),mmarg) |
#define | PUSH(ll, rr) do { top->LL = (ll); top->RR = (rr); ++top; } while (0) /* Push L,l,R,r */ |
#define | POP(ll, rr) do { --top; (ll) = top->LL; (rr) = top->RR; } while (0) /* Pop L,l,R,r */ |
#define | med3(a, b, c) |
#define | PATH_MAX 8192 |
#define | strtod ruby_strtod |
#define | dtoa ruby_dtoa |
#define | hdtoa ruby_hdtoa |
Typedefs | |
typedef int() | cmpfunc_t(const void *, const void *, void *) |
Functions | |
unsigned long | ruby_scan_oct (const char *start, size_t len, size_t *retlen) |
unsigned long | ruby_scan_hex (const char *start, size_t len, size_t *retlen) |
NO_SANITIZE ("unsigned-integer-overflow", extern unsigned long ruby_scan_digits(const char *str, ssize_t len, int base, size_t *retlen, int *overflow)) | |
unsigned long | ruby_scan_digits (const char *str, ssize_t len, int base, size_t *retlen, int *overflow) |
unsigned long | ruby_strtoul (const char *str, char **endptr, int base) |
void | ruby_qsort (void *base, const size_t nel, const size_t size, cmpfunc_t *cmp, void *d) |
char * | ruby_strdup (const char *str) |
char * | ruby_getcwd (void) |
void | ruby_each_words (const char *str, void(*func)(const char *, int, void *), void *arg) |
Variables | |
const char | ruby_hexdigits [] = "0123456789abcdef0123456789ABCDEF" |
const signed char | ruby_digit36_to_number_table [] |
#define hdtoa ruby_hdtoa |
#define hexdigit ruby_hexdigits |
#define med3 | ( | a, | |
b, | |||
c | |||
) |
#define mmargdecl int mmkind, size_t size, size_t high, size_t low |
#define mmprepare | ( | base, | |
size | |||
) |
#define PATH_MAX 8192 |
#define strtod ruby_strtod |
NO_SANITIZE | ( | "unsigned-integer-overflow" | , |
extern unsigned long | ruby_scan_digitsconst char *str, ssize_t len, int base, size_t *retlen, int *overflow | ||
) |
char* ruby_getcwd | ( | void | ) |
Definition at line 541 of file util.c.
References buf, DATA_PTR, Data_Wrap_Struct, free(), getcwd, NULL, PATH_MAX, RB_GC_GUARD, rb_sys_fail(), rb_syserr_fail(), RUBY_DEFAULT_FREE, ruby_strdup(), size, xfree, xmalloc, and xrealloc.
Referenced by rb_dir_getwd_ospath().
unsigned long ruby_scan_digits | ( | const char * | str, |
ssize_t | len, | ||
int | base, | ||
size_t * | retlen, | ||
int * | overflow | ||
) |
Definition at line 98 of file util.c.
References len, ret, ruby_digit36_to_number_table, and str.
Referenced by ruby_strtoul().
unsigned long ruby_scan_hex | ( | const char * | start, |
size_t | len, | ||
size_t * | retlen | ||
) |
Definition at line 56 of file util.c.
References len, and ruby_digit36_to_number_table.
unsigned long ruby_scan_oct | ( | const char * | start, |
size_t | len, | ||
size_t * | retlen | ||
) |
char* ruby_strdup | ( | const char * | str | ) |
Definition at line 529 of file util.c.
References len, memcpy, str, strlen(), and xmalloc.
Referenced by compat_init_setproctitle(), and ruby_getcwd().
unsigned long ruby_strtoul | ( | const char * | str, |
char ** | endptr, | ||
int | base | ||
) |
const signed char ruby_digit36_to_number_table[] |
Definition at line 76 of file util.c.
Referenced by ruby_scan_digits(), and ruby_scan_hex().