#include "internal.h"
#include "ruby/re.h"
#include "id.h"
#include <math.h>
#include <stdarg.h>
#include "vsnprintf.c"
Go to the source code of this file.
|
#define | BIT_DIGITS(N) (((N)*146)/485 + 1) /* log2(10) =~ 146/485 */ |
|
#define | FNONE 0 |
|
#define | FSHARP 1 |
|
#define | FMINUS 2 |
|
#define | FPLUS 4 |
|
#define | FZERO 8 |
|
#define | FSPACE 16 |
|
#define | FWIDTH 32 |
|
#define | FPREC 64 |
|
#define | FPREC0 128 |
|
#define | CHECK(l) |
|
#define | PUSH(s, l) |
|
#define | PUSH_(s, l) |
|
#define | FILL(c, l) |
|
#define | FILL_(c, l) |
|
#define | GETARG() |
|
#define | GETNEXTARG() |
|
#define | GETPOSARG(n) |
|
#define | GETNTHARG(nth) (((nth) >= argc) ? (rb_raise(rb_eArgError, "too few arguments"), 0) : argv[(nth)]) |
|
#define | CHECKNAMEARG(name, len, enc) |
|
#define | GETNUM(n, val) |
|
#define | GETASTER(val) |
|
#define | CHECK_FOR_WIDTH(f) |
|
#define | CHECK_FOR_FLAGS(f) |
|
#define | FILE rb_printf_buffer |
|
#define | __sbuf rb_printf_sbuf |
|
#define | __sFILE rb_printf_sfile |
|
#define | FLOATING_POINT 1 |
|
#define | BSD__dtoa ruby_dtoa |
|
#define | BSD__hdtoa ruby_hdtoa |
|
#define | PRI_EXTRA_MARK RUBY_PRI_VALUE_MARK |
|
#define | lower_hexdigits (ruby_hexdigits+0) |
|
#define | upper_hexdigits (ruby_hexdigits+16) |
|
#define | LITERAL(str) (*sz = rb_strlen_lit(str), str) |
|
#define | f buffer.base |
|
#define | f buffer.base |
|
|
VALUE | rb_f_sprintf (int argc, const VALUE *argv) |
|
VALUE | rb_str_format (int argc, const VALUE *argv, VALUE fmt) |
|
int | ruby_vsnprintf (char *str, size_t n, const char *fmt, va_list ap) |
|
int | ruby_snprintf (char *str, size_t n, char const *fmt,...) |
|
VALUE | rb_enc_vsprintf (rb_encoding *enc, const char *fmt, va_list ap) |
|
VALUE | rb_enc_sprintf (rb_encoding *enc, const char *format,...) |
|
VALUE | rb_vsprintf (const char *fmt, va_list ap) |
|
VALUE | rb_sprintf (const char *format,...) |
|
VALUE | rb_str_vcatf (VALUE str, const char *fmt, va_list ap) |
|
VALUE | rb_str_catf (VALUE str, const char *format,...) |
|
◆ __sbuf
◆ __sFILE
◆ BIT_DIGITS
#define BIT_DIGITS |
( |
|
N | ) |
(((N)*146)/485 + 1) /* log2(10) =~ 146/485 */ |
◆ BSD__dtoa
◆ BSD__hdtoa
◆ CHECK
Value:do {\
while ((l) >= bsiz - blen) {\
bsiz*=2;\
}\
} while (0)
void rb_raise(VALUE exc, const char *fmt,...)
#define ENC_CODERANGE_SET(obj, cr)
VALUE rb_str_resize(VALUE, long)
unsigned char buf[MIME_BUF_SIZE]
#define ENC_CODERANGE(obj)
Definition at line 57 of file sprintf.c.
◆ CHECK_FOR_FLAGS
#define CHECK_FOR_FLAGS |
( |
|
f | ) |
|
◆ CHECK_FOR_WIDTH
#define CHECK_FOR_WIDTH |
( |
|
f | ) |
|
◆ CHECKNAMEARG
#define CHECKNAMEARG |
( |
|
name, |
|
|
|
len, |
|
|
|
enc |
|
) |
| |
Value:( \
check_name_arg(posarg,
name,
len, enc), \
posarg = -2)
register unsigned int len
Definition at line 103 of file sprintf.c.
◆ f [1/2]
Referenced by lgamma_r(), rb_class_foreach_subclass(), rb_find_file_ext_safe(), rb_find_file_safe(), rb_flt_rationalize(), rb_int_ceil(), rb_int_floor(), rb_int_round(), rb_int_truncate(), rb_str_vcatf(), rb_w32_wrap_io_handle(), round(), ruby_enc_find_basename(), SHA256_Transform(), SHA512_Transform(), VpSqrt(), and VpVtoD().
◆ f [2/2]
◆ FILE
#define FILE rb_printf_buffer |
◆ FILL
Value:do { \
if ((l) <= 0) break;\
} while (0)
Definition at line 78 of file sprintf.c.
◆ FILL_
Value:do { \
memset(&
buf[blen], (c), (l));\
blen += (l);\
} while (0)
unsigned char buf[MIME_BUF_SIZE]
Definition at line 84 of file sprintf.c.
◆ FLOATING_POINT
◆ FMINUS
◆ FNONE
◆ FPLUS
◆ FPREC
◆ FPREC0
◆ FSHARP
◆ FSPACE
◆ FWIDTH
◆ FZERO
◆ GETARG
Value:(nextvalue !=
Qundef ? nextvalue : \
GETNEXTARG())
Definition at line 89 of file sprintf.c.
◆ GETASTER
Value:do { \
t = p++; \
n = 0; \
if (*p == '$') { \
} \
else { \
p = t; \
} \
} while (0)
Definition at line 111 of file sprintf.c.
◆ GETNEXTARG
Value:( \
check_next_arg(posarg, nextarg), \
Definition at line 92 of file sprintf.c.
◆ GETNTHARG
◆ GETNUM
#define GETNUM |
( |
|
n, |
|
|
|
val |
|
) |
| |
Value:(!(p = get_num(p, end, enc, &(n))) ? \
void rb_raise(VALUE exc, const char *fmt,...)
Definition at line 107 of file sprintf.c.
◆ GETPOSARG
Value:( \
check_pos_arg(posarg, (n)), \
Definition at line 96 of file sprintf.c.
◆ LITERAL
◆ lower_hexdigits
◆ PRI_EXTRA_MARK
◆ PUSH
Value:do { \
CHECK(l);\
PUSH_(s, l);\
} while (0)
Definition at line 68 of file sprintf.c.
◆ PUSH_
Value:do { \
memcpy(&
buf[blen], (s), (l));\
blen += (l);\
} while (0)
unsigned char buf[MIME_BUF_SIZE]
Definition at line 73 of file sprintf.c.
◆ upper_hexdigits
◆ rb_enc_sprintf()
◆ rb_enc_vsprintf()
◆ rb_f_sprintf()
◆ rb_sprintf()
Definition at line 1452 of file sprintf.c.
Referenced by rb_any_to_s(), rb_block_to_s(), rb_insn_operand_intern(), rb_keyword_error_new(), rb_parser_show_bitstack(), rb_profile_frame_full_label(), rb_thread_current_status(), rsock_syserr_fail_host_port(), rsock_syserr_fail_path(), rsock_syserr_fail_raddrinfo(), and ruby_setenv().
◆ rb_str_catf()
◆ rb_str_format()
◆ rb_str_vcatf()
Definition at line 1465 of file sprintf.c.
References __SSTR, __SWR, f, rb_str_capacity(), rb_str_modify(), RBASIC, RBASIC_CLEAR_CLASS, RSTRING_END, and StringValue.
Referenced by rb_parser_fatal(), rb_parser_printf(), and rb_str_catf().
◆ rb_vsprintf()
VALUE rb_vsprintf |
( |
const char * |
fmt, |
|
|
va_list |
ap |
|
) |
| |
◆ ruby_snprintf()
int ruby_snprintf |
( |
char * |
str, |
|
|
size_t |
n, |
|
|
char const * |
fmt, |
|
|
|
... |
|
) |
| |
◆ ruby_vsnprintf()
int ruby_vsnprintf |
( |
char * |
str, |
|
|
size_t |
n, |
|
|
const char * |
fmt, |
|
|
va_list |
ap |
|
) |
| |