diff options
| author | KOBAYASHI Shuji <[email protected]> | 2019-08-01 13:13:32 +0900 |
|---|---|---|
| committer | KOBAYASHI Shuji <[email protected]> | 2019-08-01 13:24:52 +0900 |
| commit | eea42e06af745f0a7ae68d0d364a8f71d72823fe (patch) | |
| tree | cce84526455a3d70a79d919b318e0dcf36222e7f /mrbgems/mruby-socket/src | |
| parent | 3d3a6da2ca89a9f3bab01fdd79fed32c18b02005 (diff) | |
| download | mruby-eea42e06af745f0a7ae68d0d364a8f71d72823fe.tar.gz mruby-eea42e06af745f0a7ae68d0d364a8f71d72823fe.zip | |
Add new specifiers/modifiers to format string of `mrb_vfromat()`
Format sequence syntax:
%[modifier]specifier
Modifiers:
----------+------------------------------------------------------------
Modifier | Meaning
----------+------------------------------------------------------------
! | Convert to string by corresponding `inspect` instead of
| corresponding `to_s`.
----------+------------------------------------------------------------
Specifiers:
----------+----------------+--------------------------------------------
Specifier | Argument Type | Note
----------+----------------+--------------------------------------------
c | char |
d,i | mrb_int |
f | mrb_float |
l | char*, mrb_int | Arguments are string and length.
n | mrb_sym |
s | char* | Argument is NUL terminated string.
t | mrb_value | Convert to type (class) of object.
v,S | mrb_value |
C | struct RClass* |
T | mrb_value | Convert to real type (class) of object.
Y | mrb_value | Same as `!v` if argument is `true`, `false`
| | or `nil`, otherwise same as `T`.
% | - | Convert to percent sign itself (no argument
| | taken).
----------+----------------+--------------------------------------------
This change will increase the binary size, but replacing all format strings
with new specifiers/modifiers will decrease the size because it reduces
inline expansion of `mrb_obj_value()`, etc. at the caller.
Diffstat (limited to 'mrbgems/mruby-socket/src')
0 files changed, 0 insertions, 0 deletions
