pike.git / src / builtin.cmod

version» Context lines:

pike.git/src/builtin.cmod:3178:       /*! @decl Buffer `+=( string|Buffer what )    */    PIKEFUN object `+=( string|Buffer what )    rawtype tFunc(tOr(tString, tObjIs_BUFFER), tObjIs_BUFFER);    {    f_Buffer_add( 1 );    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].    *! It overwrites existing content at that offset, never truncates the    *! buffer, possibly extends the buffer if the new content does not fit.    *!    *! @returns    *! Returns the size of the buffer.    *!    *! @note