#include "ruby.h"
#include <sys/types.h>
#include <ctype.h>
Go to the source code of this file.
Defines | |
| #define | SIZE16 2 |
| #define | SIZE32 4 |
| #define | NATINT_LEN(type, len) sizeof(type) |
| #define | NATINT_HTOVS(x) htovs(x) |
| #define | NATINT_HTOVL(x) htovl(x) |
| #define | NATINT_HTONS(x) htons(x) |
| #define | NATINT_HTONL(x) htonl(x) |
| #define | OFF16(p) (char*)(p) |
| #define | OFF32(p) (char*)(p) |
| #define | OFF16B(p) (char*)(p) |
| #define | OFF32B(p) (char*)(p) |
| #define | define_swapx(x, xtype) |
| #define | swap16(x) ((((x)&0xFF)<<8) | (((x)>>8)&0xFF)) |
| #define | swaps(x) swap16(x) |
| #define | swap32(x) |
| #define | swapl(x) swap32(x) |
| #define | swapf(x) swapl(x) |
| #define | FLOAT_SWAPPER unsigned long |
| #define | ntohs(x) swaps(x) |
| #define | ntohl(x) swapl(x) |
| #define | htons(x) swaps(x) |
| #define | htonl(x) swapl(x) |
| #define | ntohf(x) swapf(x) |
| #define | ntohd(x) swapd(x) |
| #define | htonf(x) swapf(x) |
| #define | htond(x) swapd(x) |
| #define | htovs(x) (x) |
| #define | htovl(x) (x) |
| #define | htovf(x) (x) |
| #define | htovd(x) (x) |
| #define | vtohs(x) (x) |
| #define | vtohl(x) (x) |
| #define | vtohf(x) (x) |
| #define | vtohd(x) (x) |
| #define | FLOAT_CONVWITH(y) FLOAT_SWAPPER y; |
| #define | HTONF(x, y) |
| #define | HTOVF(x, y) |
| #define | NTOHF(x, y) |
| #define | VTOHF(x, y) |
| #define | DOUBLE_CONVWITH(y) |
| #define | HTOND(x, y) htond(x) |
| #define | HTOVD(x, y) htovd(x) |
| #define | NTOHD(x, y) ntohd(x) |
| #define | VTOHD(x, y) vtohd(x) |
| #define | EXTEND32(x) |
| #define | EXTEND16(x) |
| #define | QUAD_SIZE sizeof(LONG_LONG) |
| #define | THISFROM RARRAY(ary)->ptr[idx] |
| #define | NEXTFROM (items-- > 0 ? RARRAY(ary)->ptr[idx++] : (rb_raise(rb_eArgError, toofew),0)) |
| #define | PACK_LENGTH_ADJUST_SIZE(sz) |
| #define | PACK_LENGTH_ADJUST(type, sz) PACK_LENGTH_ADJUST_SIZE(sizeof(type)) |
| #define | PACK_ITEM_ADJUST() while (tmp--) rb_ary_push(ary, Qnil) |
| #define | BYTEWIDTH 8 |
Functions | |
| double | swapd (double d) const |
| unsigned long | rb_big2ulong_pack (VALUE x) |
| unsigned long | num2i32 (VALUE x) |
| void | encodes (VALUE, char *, long, int) |
| void | qpencode (VALUE, VALUE, long) |
| int | uv_to_utf8 (char *, unsigned long) |
| unsigned long | utf8_to_uv (char *, long *) |
| VALUE | pack_pack (VALUE ary, VALUE fmt) |
| int | hex2num (char c) |
| VALUE | infected_str_new (char *ptr, long len, VALUE str) const |
| VALUE | pack_unpack (VALUE str, VALUE fmt) |
| void | Init_pack () |
Variables | |
| char * | toofew = "too few arguments" |
| char | uu_table [] |
| char | b64_table [] |
| char | hex_table [] = "0123456789ABCDEF" |
| const unsigned long | utf8_limits [] |
|
|
Definition at line 1990 of file pack.c. Referenced by is_in_list_sbc(), print_mbc(), print_partial_compiled_pattern(), re_compile_fastmap(), and re_compile_pattern(). |
|
|
Value: static xtype \ TOKEN_PASTE(swap,x)(z) \ xtype z; \ { \ xtype r; \ xtype *zp; \ unsigned char *s, *t; \ int i; \ \ zp = malloc(sizeof(xtype)); \ *zp = z; \ s = (unsigned char*)zp; \ t = malloc(sizeof(xtype)); \ for (i=0; i<sizeof(xtype); i++) { \ t[sizeof(xtype)-i-1] = s[i]; \ } \ r = *(xtype *)t; \ free(t); \ free(zp); \ return r; \ } |
|
|
Definition at line 327 of file pack.c. Referenced by pack_pack(), and pack_unpack(). |
|
|
Definition at line 357 of file pack.c. Referenced by pack_unpack(). |
|
|
Definition at line 351 of file pack.c. Referenced by pack_unpack(). |
|
|
Definition at line 283 of file pack.c. Referenced by pack_pack(), and pack_unpack(). |
|
|
|
|
|
Definition at line 328 of file pack.c. Referenced by pack_pack(). |
|
|
|
|
|
Value: (memcpy(&y,&x,sizeof(float)), \ y = htonf((FLOAT_SWAPPER)y), \ memcpy(&x,&y,sizeof(float)), \ x) Definition at line 284 of file pack.c. Referenced by pack_pack(). |
|
|
|
|
|
|
|
|
|
|
|
Definition at line 329 of file pack.c. Referenced by pack_pack(). |
|
|
|
|
|
Value: (memcpy(&y,&x,sizeof(float)), \ y = htovf((FLOAT_SWAPPER)y), \ memcpy(&x,&y,sizeof(float)), \ x) Definition at line 288 of file pack.c. Referenced by pack_pack(). |
|
|
|
|
|
|
|
|
|
|
|
Definition at line 41 of file pack.c. Referenced by pack_pack(). |
|
|
Definition at line 40 of file pack.c. Referenced by pack_pack(). |
|
|
Definition at line 39 of file pack.c. Referenced by pack_pack(). |
|
|
Definition at line 38 of file pack.c. Referenced by pack_pack(). |
|
|
Definition at line 37 of file pack.c. Referenced by pack_pack(), and pack_unpack(). |
|
|
Referenced by pack_pack(). |
|
|
Definition at line 330 of file pack.c. Referenced by pack_unpack(). |
|
|
|
|
|
Value: (memcpy(&y,&x,sizeof(float)), \ y = ntohf((FLOAT_SWAPPER)y), \ memcpy(&x,&y,sizeof(float)), \ x) Definition at line 292 of file pack.c. Referenced by pack_unpack(). |
|
|
|
|
|
Definition at line 258 of file pack.c. Referenced by pack_unpack(). |
|
|
Definition at line 257 of file pack.c. Referenced by pack_unpack(). |
|
|
Definition at line 45 of file pack.c. Referenced by pack_pack(), and pack_unpack(). |
|
|
Definition at line 49 of file pack.c. Referenced by pack_unpack(). |
|
|
Definition at line 46 of file pack.c. Referenced by pack_pack(), and pack_unpack(). |
|
|
Definition at line 50 of file pack.c. Referenced by pack_unpack(). |
|
|
Definition at line 1149 of file pack.c. Referenced by pack_unpack(). |
|
|
Definition at line 1145 of file pack.c. Referenced by pack_unpack(). |
|
|
Value: do { \ tmp = 0; \ if (len > (send-s)/sz) { \ if (!star) { \ tmp = len-(send-s)/sz; \ } \ len = (send-s)/sz; \ } \ } while (0) Definition at line 1129 of file pack.c. Referenced by pack_unpack(). |
|
|
Definition at line 363 of file pack.c. Referenced by pack_pack(), and pack_unpack(). |
|
|
|
|
|
|
|
|
|
|
|
Value: ((((x)&0xFF)<<24) \
|(((x)>>24)&0xFF) \
|(((x)&0x0000FF00)<<8) \
|(((x)&0x00FF0000)>>8) )
|
|
|
|
|
|
Definition at line 99 of file pack.c. Referenced by swapd(). |
|
|
|
|
|
Referenced by pack_pack(). |
|
|
Definition at line 331 of file pack.c. Referenced by pack_unpack(). |
|
|
|
|
|
Value: (memcpy(&y,&x,sizeof(float)), \ y = vtohf((FLOAT_SWAPPER)y), \ memcpy(&x,&y,sizeof(float)), \ x) Definition at line 296 of file pack.c. Referenced by pack_unpack(). |
|
|
|
|
|
Definition at line 270 of file pack.c. Referenced by pack_unpack(). |
|
|
Definition at line 269 of file pack.c. Referenced by pack_unpack(). |
|
||||||||||||||||||||
|
Definition at line 1011 of file pack.c. References ALLOCA_N, b64_table, rb_str_buf_cat(), uu_table, and VALUE. Referenced by pack_pack(). |
|
|
Definition at line 1111 of file pack.c. Referenced by pack_unpack(). |
|
||||||||||||||||
|
Definition at line 1152 of file pack.c. References OBJ_INFECT, rb_str_new(), and VALUE. Referenced by pack_unpack(). |
|
|
Definition at line 2102 of file pack.c. References pack_pack(), pack_unpack(), rb_cArray, rb_cString, and rb_define_method(). Referenced by rb_call_inits(). |
|
|
Definition at line 337 of file pack.c. References FIX2LONG, FIXNUM_P, rb_big2ulong_pack(), rb_eTypeError, rb_obj_classname(), rb_raise(), rb_to_int(), T_BIGNUM, TYPE, and VALUE. Referenced by pack_pack(). |
|
||||||||||||
|
Definition at line 441 of file pack.c. References DOUBLE_CONVWITH, encodes(), FLOAT_CONVWITH, HTOND, HTONF, HTOVD, HTOVF, ISALPHA, ISDIGIT, ISSPACE, NATINT_HTONL, NATINT_HTONS, NATINT_HTOVL, NATINT_HTOVS, NATINT_LEN, NEXTFROM, NIL_P, num2i32(), NUM2INT, NUM2LONG, OBJ_INFECT, OFF16, OFF32, qpencode(), QUAD_SIZE, RARRAY, rb_ary_new(), rb_ary_push(), rb_big_divmod(), rb_eArgError, rb_eRangeError, rb_eRuntimeError, rb_Float(), rb_obj_as_string(), rb_quad_pack(), rb_raise(), rb_str_associate(), rb_str_buf_cat(), rb_str_buf_new(), rb_str_new(), rb_to_int(), rb_uint2big(), RFLOAT, RSTRING, strchr(), StringValue, StringValuePtr, strtoul(), T_BIGNUM, THISFROM, TYPE, uv_to_utf8(), and VALUE. Referenced by Init_pack(). |
|
||||||||||||
|
Definition at line 1302 of file pack.c. References b64_table, DOUBLE_CONVWITH, end, EXTEND16, EXTEND32, FLOAT_CONVWITH, hex2num(), infected_str_new(), INT2FIX, INT2NUM, ISDIGIT, ISSPACE, LONG2NUM, NATINT_LEN, NTOHD, NTOHF, ntohl, ntohs, OBJ_INFECT, OFF16, OFF16B, OFF32, OFF32B, PACK_ITEM_ADJUST, PACK_LENGTH_ADJUST, PACK_LENGTH_ADJUST_SIZE, Qnil, QUAD_SIZE, RARRAY, rb_ary_new(), rb_ary_push(), rb_big_mul(), rb_big_plus(), rb_eArgError, rb_float_new(), rb_quad_unpack(), rb_raise(), rb_str_associated(), rb_str_new(), rb_str_new2(), rb_tainted_str_new(), rb_uint2big(), RSTRING, strchr(), StringValue, strtoul(), T_STRING, TYPE, UINT2NUM, ULONG2NUM, utf8_to_uv(), VALUE, VTOHD, VTOHF, vtohl, and vtohs. Referenced by Init_pack(). |
|
||||||||||||||||
|
Definition at line 1056 of file pack.c. References hex_table, rb_str_buf_cat(), RSTRING, and VALUE. Referenced by pack_pack(). |
|
|
Definition at line 750 of file bignum.c. References big2ulong(), RBIGNUM, and VALUE. Referenced by num2i32(). |
|
|
Definition at line 138 of file pack.c. References swapl. |
|
||||||||||||
|
Definition at line 2050 of file pack.c. References rb_eArgError, rb_raise(), and utf8_limits. Referenced by pack_unpack(). |
|
||||||||||||
|
Definition at line 1993 of file pack.c. References rb_eRangeError, and rb_raise(). Referenced by pack_pack(). |
|
|
Initial value:
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
Definition at line 1007 of file pack.c. Referenced by encodes(), and pack_unpack(). |
|
|
Definition at line 1053 of file pack.c. Referenced by qpencode(). |
|
|
|
|
|
Initial value: {
0x0,
0x80,
0x800,
0x10000,
0x200000,
0x4000000,
0x80000000,
}
Definition at line 2039 of file pack.c. Referenced by utf8_to_uv(). |
|
|
Initial value:
"`!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"
Definition at line 1005 of file pack.c. Referenced by encodes(). |
1.3.5