pike.git
/
src
/
modules
/
_Roxen
/
roxen.c
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/modules/_Roxen/roxen.c:370:
*(pnt++) = '\n'; } pop_n_elems( args ); push_string( end_shared_string( res ) ); } static void f_http_decode_string(INT32 args) /*! @decl string http_decode_string(string encoded) *!
-
*! Decodes an http transport-encoded string.
+
*! Decodes an http transport-encoded string.
Knows about %XX and
+
*! %uXXXX syntax. Treats %UXXXX as %uXXXX. It will treat '+' as '+'
+
*! and not ' ', so form decoding needs to replace that in a second
+
*! step.
*/ { int proc; int size_shift = 0; int adjust_len = 0; p_wchar0 *foo, *bar, *end; struct pike_string *newstr; if (!args || TYPEOF(Pike_sp[-args]) != PIKE_T_STRING || Pike_sp[-args].u.string->size_shift)
pike.git/src/modules/_Roxen/roxen.c:480:
int newlen; if( args != 1 ) Pike_error("Wrong number of arguments to html_encode_string\n" ); switch( TYPEOF(Pike_sp[-1]) ) { void o_cast_to_string(); case PIKE_T_INT:
-
/* Optimization, this is basically a inlined cast_int_to_string */
-
{
-
char buf[21], *b = buf+19;
-
int neg, i, j=0;
-
i = Pike_sp[-1].u.integer;
-
pop_stack();
-
if( i < 0 )
-
{
-
neg = 1;
-
i = -i;
-
}
-
else
-
neg = 0;
-
-
buf[20] = 0;
-
-
while( i >= 10 )
-
{
-
b[ -j++ ] = '0'+(i%10);
-
i /= 10;
-
}
-
b[ -j++ ] = '0'+(i%10);
-
if( neg ) b[ -j++ ] = '-';
-
push_text( b-j+1 );
-
}
-
return;
-
+
case PIKE_T_FLOAT: /* Optimization, no need to check the resultstring for * unsafe characters. */ o_cast_to_string(); return; default: o_cast_to_string(); case PIKE_T_STRING: