[DOC] table format refined.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2016-10-25 03:48:23 +00:00
parent f785ac9f38
commit 58206933b4

106
pack.c
View File

@ -176,7 +176,7 @@ rb_str_associated(VALUE str)
* *
* Integer | Array | * Integer | Array |
* Directive | Element | Meaning * Directive | Element | Meaning
* --------------------------------------------------------------------------- * ----------------------------------------------------------------------------
* C | Integer | 8-bit unsigned (unsigned char) * C | Integer | 8-bit unsigned (unsigned char)
* S | Integer | 16-bit unsigned, native endian (uint16_t) * S | Integer | 16-bit unsigned, native endian (uint16_t)
* L | Integer | 32-bit unsigned, native endian (uint32_t) * L | Integer | 32-bit unsigned, native endian (uint32_t)
@ -191,41 +191,35 @@ rb_str_associated(VALUE str)
* j | Integer | pointer width signed, native endian (intptr_t) * j | Integer | pointer width signed, native endian (intptr_t)
* | | (j is available since Ruby 2.3.) * | | (j is available since Ruby 2.3.)
* | | * | |
* S_, S! | Integer | unsigned short, native endian * S_ S! | Integer | unsigned short, native endian
* I, I_, I! | Integer | unsigned int, native endian * I I_ I! | Integer | unsigned int, native endian
* L_, L! | Integer | unsigned long, native endian * L_ L! | Integer | unsigned long, native endian
* Q_, Q! | Integer | unsigned long long, native endian (ArgumentError * Q_ Q! | Integer | unsigned long long, native endian (ArgumentError
* | | if the platform has no long long type.) * | | if the platform has no long long type.)
* | | (Q_ and Q! is available since Ruby 2.1.) * | | (Q_ and Q! is available since Ruby 2.1.)
* J! | Integer | uintptr_t, native endian (same with J) * J! | Integer | uintptr_t, native endian (same with J)
* | | (J! is available since Ruby 2.3.) * | | (J! is available since Ruby 2.3.)
* | | * | |
* s_, s! | Integer | signed short, native endian * s_ s! | Integer | signed short, native endian
* i, i_, i! | Integer | signed int, native endian * i i_ i! | Integer | signed int, native endian
* l_, l! | Integer | signed long, native endian * l_ l! | Integer | signed long, native endian
* q_, q! | Integer | signed long long, native endian (ArgumentError * q_ q! | Integer | signed long long, native endian (ArgumentError
* | | if the platform has no long long type.) * | | if the platform has no long long type.)
* | | (q_ and q! is available since Ruby 2.1.) * | | (q_ and q! is available since Ruby 2.1.)
* j! | Integer | intptr_t, native endian (same with j) * j! | Integer | intptr_t, native endian (same with j)
* | | (j! is available since Ruby 2.3.) * | | (j! is available since Ruby 2.3.)
* | | * | |
* S> L> Q> | Integer | same as the directives without ">" except * S> s> S!> s!> | Integer | same as the directives without ">" except
* J> s> l> | | big endian * L> l> L!> l!> | | big endian
* q> j> | | (available since Ruby 1.9.3) * I!> i!> | | (available since Ruby 1.9.3)
* S!> I!> | | "S>" is same as "n" * Q> q> Q!> q!> | | "S>" is same as "n"
* L!> Q!> | | "L>" is same as "N" * J> j> J!> j!> | | "L>" is same as "N"
* J!> s!> | |
* i!> l!> | |
* q!> j!> | |
* | | * | |
* S< L< Q< | Integer | same as the directives without "<" except * S< s< S!< s!< | Integer | same as the directives without "<" except
* J< s< l< | | little endian * L< l< L!< l!< | | little endian
* q< j< | | (available since Ruby 1.9.3) * I!< i!< | | (available since Ruby 1.9.3)
* S!< I!< | | "S<" is same as "v" * Q< q< Q!< q!< | | "S<" is same as "v"
* L!< Q!< | | "L<" is same as "V" * J< j< J!< j!< | | "L<" is same as "V"
* J!< s!< | |
* i!< l!< | |
* q!< j!< | |
* | | * | |
* n | Integer | 16-bit unsigned, network (big-endian) byte order * n | Integer | 16-bit unsigned, network (big-endian) byte order
* N | Integer | 32-bit unsigned, network (big-endian) byte order * N | Integer | 32-bit unsigned, network (big-endian) byte order
@ -235,18 +229,18 @@ rb_str_associated(VALUE str)
* U | Integer | UTF-8 character * U | Integer | UTF-8 character
* w | Integer | BER-compressed integer * w | Integer | BER-compressed integer
* *
* Float | | * Float | Array |
* Directive | | Meaning * Directive | Element | Meaning
* --------------------------------------------------------------------------- * ---------------------------------------------------------------------------
* D, d | Float | double-precision, native format * D d | Float | double-precision, native format
* F, f | Float | single-precision, native format * F f | Float | single-precision, native format
* E | Float | double-precision, little-endian byte order * E | Float | double-precision, little-endian byte order
* e | Float | single-precision, little-endian byte order * e | Float | single-precision, little-endian byte order
* G | Float | double-precision, network (big-endian) byte order * G | Float | double-precision, network (big-endian) byte order
* g | Float | single-precision, network (big-endian) byte order * g | Float | single-precision, network (big-endian) byte order
* *
* String | | * String | Array |
* Directive | | Meaning * Directive | Element | Meaning
* --------------------------------------------------------------------------- * ---------------------------------------------------------------------------
* A | String | arbitrary binary string (space padded, count is width) * A | String | arbitrary binary string (space padded, count is width)
* a | String | arbitrary binary string (null padded, count is width) * a | String | arbitrary binary string (null padded, count is width)
@ -262,8 +256,8 @@ rb_str_associated(VALUE str)
* P | String | pointer to a structure (fixed-length string) * P | String | pointer to a structure (fixed-length string)
* p | String | pointer to a null-terminated string * p | String | pointer to a null-terminated string
* *
* Misc. | | * Misc. | Array |
* Directive | | Meaning * Directive | Element | Meaning
* --------------------------------------------------------------------------- * ---------------------------------------------------------------------------
* @ | --- | moves to absolute position * @ | --- | moves to absolute position
* X | --- | back up a byte * X | --- | back up a byte
@ -1061,7 +1055,7 @@ infected_str_new(const char *ptr, long len, VALUE str)
* *
* Integer | | * Integer | |
* Directive | Returns | Meaning * Directive | Returns | Meaning
* ----------------------------------------------------------------- * ------------------------------------------------------------------
* C | Integer | 8-bit unsigned (unsigned char) * C | Integer | 8-bit unsigned (unsigned char)
* S | Integer | 16-bit unsigned, native endian (uint16_t) * S | Integer | 16-bit unsigned, native endian (uint16_t)
* L | Integer | 32-bit unsigned, native endian (uint32_t) * L | Integer | 32-bit unsigned, native endian (uint32_t)
@ -1076,39 +1070,35 @@ infected_str_new(const char *ptr, long len, VALUE str)
* j | Integer | pointer width signed, native endian (intptr_t) * j | Integer | pointer width signed, native endian (intptr_t)
* | | (j is available since Ruby 2.3.) * | | (j is available since Ruby 2.3.)
* | | * | |
* S_, S! | Integer | unsigned short, native endian * S_ S! | Integer | unsigned short, native endian
* I, I_, I! | Integer | unsigned int, native endian * I I_ I! | Integer | unsigned int, native endian
* L_, L! | Integer | unsigned long, native endian * L_ L! | Integer | unsigned long, native endian
* Q_, Q! | Integer | unsigned long long, native endian (ArgumentError * Q_ Q! | Integer | unsigned long long, native endian (ArgumentError
* | | if the platform has no long long type.) * | | if the platform has no long long type.)
* | | (Q_ and Q! is available since Ruby 2.1.) * | | (Q_ and Q! is available since Ruby 2.1.)
* J! | Integer | uintptr_t, native endian (same with J) * J! | Integer | uintptr_t, native endian (same with J)
* | | (J! is available since Ruby 2.3.) * | | (J! is available since Ruby 2.3.)
* | | * | |
* s_, s! | Integer | signed short, native endian * s_ s! | Integer | signed short, native endian
* i, i_, i! | Integer | signed int, native endian * i i_ i! | Integer | signed int, native endian
* l_, l! | Integer | signed long, native endian * l_ l! | Integer | signed long, native endian
* q_, q! | Integer | signed long long, native endian (ArgumentError * q_ q! | Integer | signed long long, native endian (ArgumentError
* | | if the platform has no long long type.) * | | if the platform has no long long type.)
* | | (q_ and q! is available since Ruby 2.1.) * | | (q_ and q! is available since Ruby 2.1.)
* j! | Integer | intptr_t, native endian (same with j) * j! | Integer | intptr_t, native endian (same with j)
* | | (j! is available since Ruby 2.3.) * | | (j! is available since Ruby 2.3.)
* | | * | |
* S> L> Q> | Integer | same as the directives without ">" except * S> s> S!> s!> | Integer | same as the directives without ">" except
* s> l> q> | | big endian * L> l> L!> l!> | | big endian
* S!> I!> | | (available since Ruby 1.9.3) * I!> i!> | | (available since Ruby 1.9.3)
* L!> Q!> | | "S>" is same as "n" * Q> q> Q!> q!> | | "S>" is same as "n"
* s!> i!> | | "L>" is same as "N" * J> j> J!> j!> | | "L>" is same as "N"
* l!> q!> | |
* J> j> J!> j!>| |
* | | * | |
* S< L< Q< | Integer | same as the directives without "<" except * S< s< S!< s!< | Integer | same as the directives without "<" except
* s< l< q< | | little endian * L< l< L!< l!< | | little endian
* S!< I!< | | (available since Ruby 1.9.3) * I!< i!< | | (available since Ruby 1.9.3)
* L!< Q!< | | "S<" is same as "v" * Q< q< Q!< q!< | | "S<" is same as "v"
* s!< i!< | | "L<" is same as "V" * J< j< J!< j!< | | "L<" is same as "V"
* l!< q!< | |
* J< j< J!< j!<| |
* | | * | |
* n | Integer | 16-bit unsigned, network (big-endian) byte order * n | Integer | 16-bit unsigned, network (big-endian) byte order
* N | Integer | 32-bit unsigned, network (big-endian) byte order * N | Integer | 32-bit unsigned, network (big-endian) byte order
@ -1121,8 +1111,8 @@ infected_str_new(const char *ptr, long len, VALUE str)
* Float | | * Float | |
* Directive | Returns | Meaning * Directive | Returns | Meaning
* ----------------------------------------------------------------- * -----------------------------------------------------------------
* D, d | Float | double-precision, native format * D d | Float | double-precision, native format
* F, f | Float | single-precision, native format * F f | Float | single-precision, native format
* E | Float | double-precision, little-endian byte order * E | Float | double-precision, little-endian byte order
* e | Float | single-precision, little-endian byte order * e | Float | single-precision, little-endian byte order
* G | Float | double-precision, network (big-endian) byte order * G | Float | double-precision, network (big-endian) byte order