mrb_args_format

Type Alias mrb_args_format 

Source
pub type mrb_args_format = *const c_char;
Expand description

Format specifiers for {mrb_get_args} function

Must be a C string composed of the following format specifiers:

charRuby typeC typesNotes
o{Object}{mrb_value}Could be used to retrieve any type of argument
C{Class}/{Module}{mrb_value}when ! follows, the value may be nil
S{String}{mrb_value}when ! follows, the value may be nil
A{Array}{mrb_value}when ! follows, the value may be nil
H{Hash}{mrb_value}when ! follows, the value may be nil
s{String}const char *, {mrb_int}Receive two arguments; s! gives (NULL,0) for nil
z{String}const char *NULL terminated string; z! gives NULL for nil
a{Array}const {mrb_value} *, {mrb_int}Receive two arguments; a! gives (NULL,0) for nil
c{Class}/{Module}strcut RClass *c! gives NULL for nil
f{Integer}/{Float}{mrb_float}
i{Integer}/{Float}{mrb_int}
bboolean{mrb_bool}
n{String}/{Symbol}{mrb_sym}
ddatavoid *, {mrb_data_type} const2nd argument will be used to check data type so it won’t be modified; when ! follows, the value may be nil
Iinline structvoid *, struct RClassI! gives NULL for nil
&block{mrb_value}&! raises exception if no block given.
*rest argumentsconst {mrb_value} *, {mrb_int}Receive the rest of arguments as an array; *! avoid copy of the stack.
|optionalAfter this spec following specs would be optional.
?optional given{mrb_bool}TRUE if preceding argument is given. Used to check optional argument is given.
:keyword args{mrb_kwargs} constGet keyword arguments. @see mrb_kwargs

@see mrb_get_args

Immediately after format specifiers it can add format modifiers:

charNotes
!Switch to the alternate mode; The behaviour changes depending on the format specifier
+Request a not frozen object; However, except nil value