pike.git/
src/
builtin.cmod
Branch:
Tag:
Non-build tags
All tags
No tags
2014-08-26
2014-08-26 23:56:50 by Stephen R. van den Berg <srb@cuci.nl>
bdc3d401481430599079393d5ba83e1617ceda98 (
25
lines) (+
25
/-
0
)
[
Show
|
Annotate
]
Branch:
8.0
Support == operator.
3185:
REF_RETURN Pike_fp->current_object; }
+
/*! @decl Buffer `==( mixed other )
+
*/
+
PIKEFUN int(0..1) `==( mixed other )
+
rawtype tFunc(tMixed, tInt01);
+
{
+
struct Buffer_struct *str = THIS;
+
struct pike_string *s, *a;
+
+
switch(TYPEOF(*other))
+
{
+
case PIKE_T_STRING:
+
a = other->u.string;
+
break;
+
case PIKE_T_OBJECT:
+
if (other->u.object->prog == Buffer_program) {
+
a = OBJ2_BUFFER(other->u.object)->str.s;
+
break;
+
}
+
default:
+
RETURN 0;
+
}
+
RETURN !(s = str->str.s) ? !a->len : !my_quick_strcmp(s, a);
+
}
+
/*! @decl int addat(int(0..) pos, string|Buffer ... data) *! *! Adds @[data] to the buffer, starting at position @[pos].