pike.git / src / builtin.cmod

version» Context lines:

pike.git/src/builtin.cmod:1:   /* -*- c -*- -  * $Id: builtin.cmod,v 1.29 2002/10/03 17:23:28 mast Exp $ +  * $Id: builtin.cmod,v 1.30 2002/11/27 09:41:24 grubba 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:493:    PIKEFUN int add( string ... arg1 )   /*! @decl void add(string ... data)    *!    *! Adds @[data] to the buffer. Returns the size of the buffer.    *!    */    {    struct Buffer_struct *str = THIS;    int j;    +  for (j=0; j < args; j++) { +  if (Pike_sp[j-args].type != T_STRING) { +  Pike_error("add(): Bad argument %d (expected string).", j+1); +  } +  } +     if (!str->str.s && args) {    int sum = 0;    int shift = 0;    for (j=0; j < args; j++) {    struct pike_string *a = Pike_sp[j-args].u.string;    sum += a->len;    shift |= a->size_shift;    }    if (sum < str->initial) {    sum = str->initial;