pike.git
/
src
/
builtin.cmod
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/builtin.cmod:1:
/* -*- c -*- || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information.
-
|| $Id: builtin.cmod,v 1.
128
2003/04/
01
18
:
09
:
15
nilsson
Exp $
+
|| $Id: builtin.cmod,v 1.
129
2003/04/
07
15
:
30
:
10
mast
Exp $
*/ #include "global.h" #include "interpret.h" #include "svalue.h" #include "opcodes.h" #include "pike_macros.h" #include "object.h" #include "program.h" #include "array.h"
pike.git/src/builtin.cmod:1678:
f_Buffer_get( 0 ); o_cast_to_int( ); return; } Pike_error("Cannot cast to %s\n", type->str ); } PIKEFUN object `+( string what ) { struct Buffer_struct *str = THIS, *str2;
-
struct object *res = clone_object( Buffer_program
,
0
);
-
-
if( str->str.s )
-
{
+
struct object *res =
fast_
clone_object( Buffer_program );
str2 = OBJ2_BUFFER( res );
-
-
if(
str2->
str.s
)
free_string_builder( &str2
->
str )
;
-
*str2 = *str;
-
init_string_builder_alloc
(
&str2->
str
,
-
str
->str.
malloced,
-
str->str.
s
->size_shift
)
;
-
/* We know the actual shift. */
-
str2->str.known
_
shift = str->str.s->size
_
shift;
-
MEMCPY
(
(void *)
str2->str
.s
,
(void *)
str->str
.s,
-
str->str.malloced+sizeof(struct pike_string
)
)
;
-
}
+
str2->
initial
=
str
->
initial
;
+
if
( str->str.s )
+
init
_
string
_
builder_copy
(
&
str2->str,
&
str->str);
apply( res, "add", 1 ); RETURN res; } /*! @decl int add(string ... data) *! *! Adds @[data] to the buffer. Returns the size of the buffer. *! */ PIKEFUN int add( string ... arg1 )