種類
- モジュール関数 (5)
- インスタンスメソッド (4)
キーワード
-
check
_ signedness (2) -
convertible
_ int (2) - format (1)
- sprintf (1)
-
trace
_ var (2) -
untrace
_ var (1)
検索結果
先頭5件
- Kernel
# check _ signedness(type , headers = nil , opts = nil) -> "signed" | "unsigned" | nil - Kernel
# check _ signedness(type , headers = nil , opts = nil) { . . . } -> "signed" | "unsigned" | nil - Kernel
# convertible _ int(type , headers = nil , opts = nil) - Kernel
# convertible _ int(type , headers = nil , opts = nil) { . . . } - Kernel
. # sprintf(format , *arg) -> String
-
Kernel
# check _ signedness(type , headers = nil , opts = nil) -> "signed" | "unsigned" | nil (37600.0) -
Returns the signedness of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. If the +type+ is found and is a numeric type, a macro is passed as a preprocessor constant to the compiler using the +type+ name, in uppercase, prepended with 'SIGNEDNESS_OF_', followed by the +type+ name, followed by '=X' where 'X' is positive integer if the +type+ is unsigned, or negative integer if the +type+ is signed. For example, if size_t is defined as unsigned, then check_signedness('size_t') would returned +1 and the SIGNEDNESS_OF_SIZE_T=+1 preprocessor macro would be passed to the compiler, and SIGNEDNESS_OF_INT=-1 if check_signedness('int') is done.
Returns the signedness of the given +type+. You may optionally
specify additional +headers+ to search in for the +type+.
If the +type+ is found and is a numeric type, a macro is passed as a
preprocessor constant to the compiler using the +type+ name, in
uppercase, prepended with 'SIGNEDNESS... -
Kernel
# check _ signedness(type , headers = nil , opts = nil) { . . . } -> "signed" | "unsigned" | nil (37600.0) -
Returns the signedness of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. If the +type+ is found and is a numeric type, a macro is passed as a preprocessor constant to the compiler using the +type+ name, in uppercase, prepended with 'SIGNEDNESS_OF_', followed by the +type+ name, followed by '=X' where 'X' is positive integer if the +type+ is unsigned, or negative integer if the +type+ is signed. For example, if size_t is defined as unsigned, then check_signedness('size_t') would returned +1 and the SIGNEDNESS_OF_SIZE_T=+1 preprocessor macro would be passed to the compiler, and SIGNEDNESS_OF_INT=-1 if check_signedness('int') is done.
Returns the signedness of the given +type+. You may optionally
specify additional +headers+ to search in for the +type+.
If the +type+ is found and is a numeric type, a macro is passed as a
preprocessor constant to the compiler using the +type+ name, in
uppercase, prepended with 'SIGNEDNESS... -
Kernel
# convertible _ int(type , headers = nil , opts = nil) (18844.0) -
Returns the convertible integer type of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. _Convertible_ means actually same type, or typedefed from same type. If the +type+ is a integer type and _convertible_ type is found, following macros are passed as preprocessor constants to the compiler using the +type+ name, in uppercase. * 'TYPEOF_', followed by the +type+ name, followed by '=X' where 'X' is the found _convertible_ type name. * 'TYP2NUM' and 'NUM2TYP, where 'TYP' is the +type+ name in uppercase with replacing '_t' suffix with 'T', followed by '=X' where 'X' is the macro name to convert +type+ to +Integer+ object, and vice versa. For example, if foobar_t is defined as unsigned long, then convertible_int("foobar_t") would return "unsigned long", and define macros: #define TYPEOF_FOOBAR_T unsigned long #define FOOBART2NUM ULONG2NUM #define NUM2FOOBART NUM2ULONG
Returns the convertible integer type of the given +type+. You may
optionally specify additional +headers+ to search in for the +type+.
_Convertible_ means actually same type, or typedefed from same type.
If the +type+ is a integer type and _convertible_ type is found,
following macros are p... -
Kernel
# convertible _ int(type , headers = nil , opts = nil) { . . . } (18844.0) -
Returns the convertible integer type of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. _Convertible_ means actually same type, or typedefed from same type. If the +type+ is a integer type and _convertible_ type is found, following macros are passed as preprocessor constants to the compiler using the +type+ name, in uppercase. * 'TYPEOF_', followed by the +type+ name, followed by '=X' where 'X' is the found _convertible_ type name. * 'TYP2NUM' and 'NUM2TYP, where 'TYP' is the +type+ name in uppercase with replacing '_t' suffix with 'T', followed by '=X' where 'X' is the macro name to convert +type+ to +Integer+ object, and vice versa. For example, if foobar_t is defined as unsigned long, then convertible_int("foobar_t") would return "unsigned long", and define macros: #define TYPEOF_FOOBAR_T unsigned long #define FOOBART2NUM ULONG2NUM #define NUM2FOOBART NUM2ULONG
Returns the convertible integer type of the given +type+. You may
optionally specify additional +headers+ to search in for the +type+.
_Convertible_ means actually same type, or typedefed from same type.
If the +type+ is a integer type and _convertible_ type is found,
following macros are p... -
Kernel
. # sprintf(format , *arg) -> String (9820.0) -
format 文字列を C 言語の sprintf と同じように解釈し、 引数をフォーマットした文字列を返します。
...トした文字列を返します。
@param format フォーマット文字列です。
@param arg フォーマットされる引数です。
@see Kernel.#printf,Time#strftime,Date.strptime
=== sprintf フォーマット
Ruby の sprintf フォーマットは基本的に C 言語の sprintf(3)......tf("%p", /e+/) #=> "/e+/"
//}
: d
: i
引数の数値を10進表現の整数として出力します。
引数が整数でなければ関数 Kernel.#Integer と同じ規則で整数に
変換されます。
//emlist[][ruby]{
p sprintf("%d", -1) #=> "-1"
p sprintf("%d", 3.1) #=> "3"
p sprint... -
Kernel
. # trace _ var(varname , hook) -> [String|Proc] (904.0) -
グローバル変数 varname への代入のフックを登録します。
...は明示的な代入だけです。
フックは複数登録できます。
フックを解除するには、hook に nil を
指定するか、Kernel.#untrace_var を用います。
hook が nil ならば、設定されていた
hook をすべて解除してその配列を返します(ブロッ......ます。解除した場合は解除した
フックを並べた配列を返します。
//emlist[例][ruby]{
trace_var(:$v){|val| puts "hook: $v=#{val.inspect}" }
$v = 1 #=> hook: $v=1
$v = "foo" #=> hook: $v="foo"
$v.upcase!
p $v #=> "FOO"
//}
@see Kernel.#untrace_var... -
Kernel
. # trace _ var(varname , hook) -> nil (904.0) -
グローバル変数 varname への代入のフックを登録します。
...は明示的な代入だけです。
フックは複数登録できます。
フックを解除するには、hook に nil を
指定するか、Kernel.#untrace_var を用います。
hook が nil ならば、設定されていた
hook をすべて解除してその配列を返します(ブロッ......ます。解除した場合は解除した
フックを並べた配列を返します。
//emlist[例][ruby]{
trace_var(:$v){|val| puts "hook: $v=#{val.inspect}" }
$v = 1 #=> hook: $v=1
$v = "foo" #=> hook: $v="foo"
$v.upcase!
p $v #=> "FOO"
//}
@see Kernel.#untrace_var... -
Kernel
. # untrace _ var(varname , hook = nil) -> [String|Proc] (904.0) -
グローバル変数 varname に関連付けられたフックを解除します。
...#=> hookB."str",hookA."str",
untrace_var(:$v,block)
$v = 'str' #=> hookA."str",
trace_var(:$v){|val| print "hookC.#{val.inspect}," }
p untrace_var(:$v) #=> [#<Proc:0x02b68f58@..:9>, #<Proc:0x02b6978c@..:3>]
$v = 'str' # なにも出力されない
//}
@see Kernel.#trace_var... -
Kernel
. # format(format , *arg) -> String (520.0) -
format 文字列を C 言語の sprintf と同じように解釈し、 引数をフォーマットした文字列を返します。
...トした文字列を返します。
@param format フォーマット文字列です。
@param arg フォーマットされる引数です。
@see Kernel.#printf,Time#strftime,Date.strptime
=== sprintf フォーマット
Ruby の sprintf フォーマットは基本的に C 言語の sprintf(3)......tf("%p", /e+/) #=> "/e+/"
//}
: d
: i
引数の数値を10進表現の整数として出力します。
引数が整数でなければ関数 Kernel.#Integer と同じ規則で整数に
変換されます。
//emlist[][ruby]{
p sprintf("%d", -1) #=> "-1"
p sprintf("%d", 3.1) #=> "3"
p sprint...