pike.git / src / builtin_functions.c

version» Context lines:

pike.git/src/builtin_functions.c:799:    Pike_fatal("lower_case(): Bad string shift:%d\n", orig->size_shift);   #endif    }       pop_n_elems(args);    ret = end_shared_string(ret);    ret->flags |= STRING_IS_UPPERCASE;    push_string(ret);   }    - /*! @decl string random_string(int len) -  *! -  *! Returns a string of random characters 0-255 with the length @[len]. -  */ - PMOD_EXPORT void f_random_string(INT32 args) - { -  struct pike_string *ret; -  INT_TYPE len, e = 0; -  unsigned INT64 *str; -  get_all_args("random_string",args,"%+",&len); -  ret = begin_shared_string(len); -  -  /* Note: Assumes pike_string->str is aligned on a 4 byte boundary -  * (it is, currently) -  */ -  str = (unsigned INT64 *)ret->str; -  -  while( (e+=sizeof(INT64)) <= len ) -  { -  str[0] = my_rand64(0xffffffffffffffff); -  str++; -  } -  -  for(e-=sizeof(INT64);e<len;e++) -  { -  ret->str[e] = (char)my_rand(0xffffffff); -  } -  -  pop_n_elems(args); -  push_string(end_shared_string(ret)); - } -  +    /*! @decl void random_seed(int seed)    *!    *! This function sets the initial value for the random generator.    *!    *! @seealso    *! @[random()]    *!    *! @deprecated    *! @[Random.Deterministic]    */ - PMOD_EXPORT void f_random_seed(INT32 args) + static void f_random_seed(INT32 args)   {    INT_TYPE i;    pop_n_elems(args);   }      /*! @decl int query_num_arg()    *!    *! Returns the number of arguments given when the previous function was    *! called.    *!
pike.git/src/builtin_functions.c:9351:    ADD_EFUN("programp",f_programp,tFunc(tMix,tInt01),0);       /* function(:int) */    ADD_EFUN("query_num_arg",f_query_num_arg,    tFunc(tNone,tInt),OPT_EXTERNAL_DEPEND);       /* function(int:void) */    ADD_EFUN("random_seed",f_random_seed,    tAttr("deprecated",tFunc(tInt,tVoid)),OPT_SIDE_EFFECT);    -  ADD_EFUN("random_string",f_random_string, -  tFunc(tInt,tStr8), OPT_EXTERNAL_DEPEND); -  +     ADD_EFUN2("replace", f_replace,    tOr5(tFunc(tStr tStr tStr,tStr),    tFunc(tStr tArr(tStr) tOr(tArr(tStr), tStr), tStr),    tFunc(tStr tMap(tStr,tStr),tStr),    tFunc(tSetvar(0,tArray) tMix tMix,tVar(0)),    tFunc(tSetvar(1,tMapping) tMix tMix,tVar(1))),    OPT_TRY_OPTIMIZE, optimize_replace, 0);       ADD_EFUN("reverse",f_reverse,    tOr3(tFunc(tInt tOr(tVoid, tInt) tOr(tVoid, tInt), tInt),