git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2010-06-28 13:05:07 +00:00
Родитель d9d650ecfd
Коммит 82f7a98236
1 изменённых файлов: 128 добавлений и 126 удалений

46
pack.c
Просмотреть файл

@ -305,7 +305,8 @@ static unsigned long utf8_to_uv(const char*,long*);
* elements to convert. If the count is an asterisk * elements to convert. If the count is an asterisk
* (``<code>*</code>''), all remaining array elements will be * (``<code>*</code>''), all remaining array elements will be
* converted. Any of the directives ``<code>sSiIlL</code>'' may be * converted. Any of the directives ``<code>sSiIlL</code>'' may be
* followed by an underscore (``<code>_</code>'') to use the underlying * followed by an underscore (``<code>_</code>'') or
* exclamation mark (``<code>!</code>'') to use the underlying
* platform's native size for the specified type; otherwise, they use a * platform's native size for the specified type; otherwise, they use a
* platform-independent size. Spaces are ignored in the template * platform-independent size. Spaces are ignored in the template
* string. See also <code>String#unpack</code>. * string. See also <code>String#unpack</code>.
@ -320,7 +321,7 @@ static unsigned long utf8_to_uv(const char*,long*);
* *
* Integer | Array | * Integer | Array |
* Directive | Element | Meaning * Directive | Element | Meaning
* ------------------------------------------------------------------------ * ---------------------------------------------------------------------------
* C | Integer | 8-bit unsigned integer (unsigned char) * C | Integer | 8-bit unsigned integer (unsigned char)
* S | Integer | 16-bit unsigned integer, native endian (uint16_t) * S | Integer | 16-bit unsigned integer, native endian (uint16_t)
* L | Integer | 32-bit unsigned integer, native endian (uint32_t) * L | Integer | 32-bit unsigned integer, native endian (uint32_t)
@ -331,13 +332,13 @@ static unsigned long utf8_to_uv(const char*,long*);
* l | Integer | 32-bit signed integer, native endian (int32_t) * l | Integer | 32-bit signed integer, native endian (int32_t)
* q | Integer | 64-bit signed integer, native endian (int64_t) * q | Integer | 64-bit signed integer, native endian (int64_t)
* | | * | |
* S_ | Integer | unsigned short, native endian * S_, S! | Integer | unsigned short, native endian
* I, I_ | Integer | unsigned int, native endian * I, I_, I! | Integer | unsigned int, native endian
* L_ | Integer | unsigned long, native endian * L_, L! | Integer | unsigned long, native endian
* | | * | |
* s_ | Integer | signed short, native endian * s_, s! | Integer | signed short, native endian
* i, i_ | Integer | signed int, native endian * i, i_, i! | Integer | signed int, native endian
* l_ | Integer | signed long, native endian * l_, l! | Integer | signed long, native endian
* | | * | |
* n | Integer | 16-bit unsigned integer, network (big-endian) byte order * n | Integer | 16-bit unsigned integer, network (big-endian) byte order
* N | Integer | 32-bit unsigned integer, network (big-endian) byte order * N | Integer | 32-bit unsigned integer, network (big-endian) byte order
@ -349,7 +350,7 @@ static unsigned long utf8_to_uv(const char*,long*);
* *
* Float | | * Float | |
* Directive | | Meaning * Directive | | Meaning
* ------------------------------------------------------------------------ * ---------------------------------------------------------------------------
* D, d | Float | double-precision float, native format * D, d | Float | double-precision float, native format
* F, f | Float | single-precision float, native format * F, f | Float | single-precision float, native format
* E | Float | double-precision float, little-endian byte order * E | Float | double-precision float, little-endian byte order
@ -359,7 +360,7 @@ static unsigned long utf8_to_uv(const char*,long*);
* *
* String | | * String | |
* Directive | | Meaning * Directive | | 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)
* Z | String | same as ``a'', except that null is added with * * Z | String | same as ``a'', except that null is added with *
@ -376,7 +377,7 @@ static unsigned long utf8_to_uv(const char*,long*);
* *
* Misc. | | * Misc. | |
* Directive | | Meaning * Directive | | Meaning
* ------------------------------------------------------------------------ * ---------------------------------------------------------------------------
* @ | --- | moves to absolute position * @ | --- | moves to absolute position
* X | --- | back up a byte * X | --- | back up a byte
* x | --- | null byte * x | --- | null byte
@ -1213,7 +1214,8 @@ infected_str_new(const char *ptr, long len, VALUE str)
* by a number, indicating the number of times to repeat with this * by a number, indicating the number of times to repeat with this
* directive. An asterisk (``<code>*</code>'') will use up all * directive. An asterisk (``<code>*</code>'') will use up all
* remaining elements. The directives <code>sSiIlL</code> may each be * remaining elements. The directives <code>sSiIlL</code> may each be
* followed by an underscore (``<code>_</code>'') to use the underlying * followed by an underscore (``<code>_</code>'') or
* exclamation mark (``<code>!</code>'') to use the underlying
* platform's native size for the specified type; otherwise, it uses a * platform's native size for the specified type; otherwise, it uses a
* platform-independent consistent size. Spaces are ignored in the * platform-independent consistent size. Spaces are ignored in the
* format string. See also <code>Array#pack</code>. * format string. See also <code>Array#pack</code>.
@ -1232,7 +1234,7 @@ infected_str_new(const char *ptr, long len, VALUE str)
* *
* Integer | | * Integer | |
* Directive | Returns | Meaning * Directive | Returns | Meaning
* -------------------------------------------------------------- * -----------------------------------------------------------------
* C | Integer | 8-bit unsigned integer (unsigned char) * C | Integer | 8-bit unsigned integer (unsigned char)
* S | Integer | 16-bit unsigned integer, native endian (uint16_t) * S | Integer | 16-bit unsigned integer, native endian (uint16_t)
* L | Integer | 32-bit unsigned integer, native endian (uint32_t) * L | Integer | 32-bit unsigned integer, native endian (uint32_t)
@ -1243,13 +1245,13 @@ infected_str_new(const char *ptr, long len, VALUE str)
* l | Integer | 32-bit signed integer, native endian (int32_t) * l | Integer | 32-bit signed integer, native endian (int32_t)
* q | Integer | 64-bit signed integer, native endian (int64_t) * q | Integer | 64-bit signed integer, native endian (int64_t)
* | | * | |
* S_ | Integer | unsigned short, native endian * S_, S! | Integer | unsigned short, native endian
* I, I_ | Integer | unsigned int, native endian * I, I_, I! | Integer | unsigned int, native endian
* L_ | Integer | unsigned long, native endian * L_, L! | Integer | unsigned long, native endian
* | | * | |
* s_ | Integer | signed short, native endian * s_, s! | Integer | signed short, native endian
* i, i_ | Integer | signed int, native endian * i, i_, i! | Integer | signed int, native endian
* l_ | Integer | signed long, native endian * l_, l! | Integer | signed long, native endian
* | | * | |
* n | Integer | 16-bit unsigned integer, network (big-endian) byte order * n | Integer | 16-bit unsigned integer, network (big-endian) byte order
* N | Integer | 32-bit unsigned integer, network (big-endian) byte order * N | Integer | 32-bit unsigned integer, network (big-endian) byte order
@ -1261,7 +1263,7 @@ infected_str_new(const char *ptr, long len, VALUE str)
* *
* Float | | * Float | |
* Directive | Returns | Meaning * Directive | Returns | Meaning
* -------------------------------------------------------------- * -----------------------------------------------------------------
* D, d | Float | double-precision float, native format * D, d | Float | double-precision float, native format
* F, f | Float | single-precision float, native format * F, f | Float | single-precision float, native format
* E | Float | double-precision float, little-endian byte order * E | Float | double-precision float, little-endian byte order
@ -1271,7 +1273,7 @@ infected_str_new(const char *ptr, long len, VALUE str)
* *
* String | | * String | |
* Directive | Returns | Meaning * Directive | Returns | Meaning
* -------------------------------------------------------------- * -----------------------------------------------------------------
* A | String | arbitrary binary string (remove trailing nulls and ASCII spaces) * A | String | arbitrary binary string (remove trailing nulls and ASCII spaces)
* a | String | arbitrary binary string * a | String | arbitrary binary string
* Z | String | null-terminated string * Z | String | null-terminated string
@ -1288,7 +1290,7 @@ infected_str_new(const char *ptr, long len, VALUE str)
* *
* Misc. | | * Misc. | |
* Directive | Returns | Meaning * Directive | Returns | Meaning
* -------------------------------------------------------------- * -----------------------------------------------------------------
* @ | --- | skip to the offset given by the length argument * @ | --- | skip to the offset given by the length argument
* X | --- | skip backward one byte * X | --- | skip backward one byte
* x | --- | skip forward one byte * x | --- | skip forward one byte