pike.git / lib / modules / ADT.pmod / module.pmod

version» Context lines:

pike.git/lib/modules/ADT.pmod/module.pmod:62:    if (i<0)    error("Negative argument.\n");    add_data(sprintf("%*c", len, i));    }       //! Appends a variable stringĀ @[s] preceded with an unsigned integer    //! of the size @[len_width] declaring the length of the string. The    //! string @[s] should be 8 bits wide.    void put_var_string(string s, int(0..) len_width)    { -  if ( (len_width <= 3) && -  (sizeof(s) >= ({ -1, 0x100, 0x10000, 0x1000000 })[len_width] )) -  error("Field overflow.\n"); -  put_uint(sizeof(s), len_width); -  add_data(s); +  add_data(sprintf("%*H", len_width, [string(0..255)]s));    }       //! Appends a bignum @[i] as a variable string preceded with an    //! unsigned integer of the size @[len_width] declaring the length    //! of the string. @[len_width] defaults to 2.    void put_bignum(Gmp.mpz i, int(0..)|void len_width)    {    if (i<0)    error("Negative argument.\n");    put_var_string(i->digits(256), len_width || 2);