Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)
Functions
sprintf.h File Reference

Our own private printf(3). More...

#include "ruby/internal/attr/format.h"
#include "ruby/internal/dllexport.h"
#include "ruby/internal/value.h"

Go to the source code of this file.

Functions

VALUE rb_f_sprintf (int, const VALUE *)
 
VALUE rb_sprintf (const char *,...)
 
VALUE rb_vsprintf (const char *, va_list)
 
VALUE rb_str_catf (VALUE, const char *,...)
 
VALUE rb_str_vcatf (VALUE, const char *, va_list)
 
VALUE rb_str_format (int, const VALUE *, VALUE)
 

Detailed Description

Our own private printf(3).

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 sprintf.h.

Function Documentation

◆ rb_f_sprintf()

VALUE rb_f_sprintf ( int  argc,
const VALUE argv 
)

Definition at line 208 of file sprintf.c.

References argc, argv, GETNTHARG, and rb_str_format().

Referenced by rb_io_printf().

◆ rb_sprintf()

VALUE rb_sprintf ( const char *  format,
  ... 
)

◆ rb_str_catf()

VALUE rb_str_catf ( VALUE  str,
const char *  format,
  ... 
)

◆ rb_str_format()

VALUE rb_str_format ( int  argc,
const VALUE argv,
VALUE  fmt 
)

Definition at line 214 of file sprintf.c.

References argc, argv, BIT_DIGITS, CHAR_BIT, CHECK, CHECK_FOR_FLAGS, CHECK_FOR_WIDTH, CHECKNAMEARG, ENC_CODERANGE, ENC_CODERANGE_7BIT, ENC_CODERANGE_BROKEN, ENC_CODERANGE_SET, ENC_CODERANGE_UNKNOWN, ffs(), FILL, FILL_, FIX2LONG, FIXABLE, FIXNUM_P, FMINUS, FNONE, FPLUS, FPREC, FPREC0, FSHARP, FSPACE, FWIDTH, FZERO, GETARG, GETASTER, GETNUM, GETPOSARG, int(), INT2FIX, INTEGER_PACK_2COMP, INTEGER_PACK_BIG_ENDIAN, isinf(), isnan, len, LONG2FIX, memcpy, NIL_P, NULL, num, NUM2INT, prefix, PRIsVALUE, PRIuSIZE, PUSH, PUSH_, Qnil, Qundef, rb_absint_numwords(), rb_absint_singlebit_p(), rb_big2str(), rb_big_uminus(), rb_check_string_type(), rb_check_symbol_cstr(), rb_dbl2big(), rb_eArgError, rb_enc_associate(), rb_enc_check(), rb_enc_codelen(), rb_enc_codepoint_len(), rb_enc_get(), rb_enc_isprint, rb_enc_mbclen(), rb_enc_mbcput, rb_enc_nth(), rb_enc_raise, rb_enc_right_char_head, rb_enc_sprintf(), rb_enc_strlen(), rb_enc_toupper(), rb_Float(), RB_GC_GUARD, rb_hash_default_value(), rb_hash_lookup2(), rb_inspect(), rb_int2str(), rb_int_idiv(), rb_int_mul(), rb_int_plus(), rb_int_positive_pow(), rb_Integer(), rb_integer_pack(), RB_INTEGER_TYPE_P, rb_long2int, rb_obj_as_string(), rb_raise(), rb_rational_den(), rb_rational_num(), rb_str_buf_new(), rb_str_capacity(), rb_str_catf(), rb_str_coderange_scan_restartable(), rb_str_new, rb_str_resize(), rb_str_set_len(), rb_str_tmp_frozen_acquire(), rb_str_tmp_frozen_release(), rb_str_to_inum(), rb_sym2str(), rb_sym_intern(), rb_warn(), RFLOAT_VALUE, RSTRING_GETMEM, RSTRING_LEN, RSTRING_PTR, RTEST, ruby_debug, ruby_digitmap, ruby_verbose, SIGNED_VALUE, str, StringValue, strlen(), sym, t, T_BIGNUM, T_FIXNUM, T_FLOAT, T_RATIONAL, T_STRING, term, TRUE, and TYPE.

Referenced by rb_f_sprintf(), rb_str_upto_each(), and rb_str_upto_endless_each().

◆ rb_str_vcatf()

VALUE rb_str_vcatf ( VALUE  str,
const char *  fmt,
va_list  ap 
)

◆ rb_vsprintf()

VALUE rb_vsprintf ( const char *  fmt,
va_list  ap 
)