pike.git / src / builtin.cmod

version» Context lines:

pike.git/src/builtin.cmod:1:   /* -*- c -*- -  * $Id: builtin.cmod,v 1.51 2001/07/01 13:12:46 grubba Exp $ +  * $Id: builtin.cmod,v 1.52 2001/07/01 15:39:16 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:1295:    CVAR size_t v_sz;    CVAR size_t sz;    CVAR INT32 set_start[256];    CVAR INT32 set_end[256];       static int replace_sortfun(struct tupel *a,struct tupel *b)    {    return DO_NOT_WARN((int)my_quick_strcmp(a->ind, b->ind));    }    -  PIKEFUN void create(array(string) from, array(string) to) +  PIKEFUN void create(array(string)|void from_, array(string)|void to_)    {    int i; -  +  struct array *from; +  struct array *to; +  if (!args) { +  push_int(0); +  return; +  } +  if (!from_ || !to_) { +  Pike_error("Bad number of arguments to create().\n"); +  } +  from = from_->u.array; +  to = to_->u.array;    if (from->size != to->size) {    Pike_error("Replace must have equal-sized from and to arrays.\n");    }    for (i = 0; i < (int)from->size; i++) {    if (from->item[i].type != PIKE_T_STRING) {    Pike_error("Replace: from array is not an array(string).\n");    }    if (to->item[i].type != PIKE_T_STRING) {    Pike_error("Replace: to array is not an array(string).\n");    }
pike.git/src/builtin.cmod:1347:    MEMSET(THIS->set_end, 0, sizeof(INT32)*256);       for (i = 0; i < (int)from->size; i++) {    INT32 x = index_shared_string(THIS->v[from->size-1-i].ind, 0);    if ((x >= 0) && (x < 256))    THIS->set_start[x] = from->size-1-i;    x = index_shared_string(THIS->v[i].ind, 0);    if ((x >= 0) && (x < 256))    THIS->set_end[x] = i+1;    } +  pop_n_elems(args); +  push_int(0);    }       static int find_longest_prefix(char *str,    ptrdiff_t len,    int size_shift,    struct tupel *v,    INT32 a,    INT32 b)    {    INT32 c,match=-1;