pike.git / src / builtin_functions.c

version» Context lines:

pike.git/src/builtin_functions.c:1983:   {    struct pike_string *in;    INT32 min,max;    int i;    static const p_wchar1 replace = 0xfffd;    static const PCHARP repl_char = {(void*)&replace,1};       get_all_args("filter_non_unicode", args, "%W", &in);    check_string_range( in, 1, &min, &max );    -  +     if( !in->len || (min >= 0 && max < 0xd800) )    return; /* The string is obviously ok. */       if( (max < 0 || min > 0x10ffff) || (max < 0xe000 && min > 0xd7ff) )    {    /* All invalid. Could probably be optimized. */    debug_make_shared_binary_pcharp( repl_char, 1 );    push_int( in->len );    o_multiply();    }
pike.git/src/builtin_functions.c:5371:    do_debug(); /* Calls do_gc() since d_flag > 3. */   #else    do_gc(NULL, 1);   #endif    d_flag=tmp;    pop_n_elems(args);   }      #ifdef PIKE_DEBUG    - /*! @decl int debug(int(0..) level) + /*! @decl int(0..) debug(int(0..) level)    *! @belongs Debug    *!    *! Set the run-time debug level.    *!    *! @returns    *! The old debug level will be returned.    *!    *! @note    *! This function is only available if the Pike runtime has been compiled    *! with RTL debug.    */   PMOD_EXPORT void f__debug(INT32 args)   {    INT_TYPE d;       ASSERT_SECURITY_ROOT("_debug");    -  get_all_args("_debug", args, "%i", &d); +  get_all_args("_debug", args, "%+", &d);    pop_n_elems(args);    push_int(d_flag);    d_flag = d;   }    - /*! @decl int optimizer_debug(int(0..) level) + /*! @decl int(0..) optimizer_debug(int(0..) level)    *! @belongs Debug    *!    *! Set the optimizer debug level.    *!    *! @returns    *! The old optimizer debug level will be returned.    *!    *! @note    *! This function is only available if the Pike runtime has been compiled    *! with RTL debug.    */   PMOD_EXPORT void f__optimizer_debug(INT32 args)   {    INT_TYPE l;       ASSERT_SECURITY_ROOT("_optimizer_debug");    -  get_all_args("_optimizer_debug", args, "%i", &l); +  get_all_args("_optimizer_debug", args, "%+", &l);    pop_n_elems(args);    push_int(l_flag);    l_flag = l;   }       - /*! @decl int assembler_debug(int(0..) level) + /*! @decl int(0..) assembler_debug(int(0..) level)    *! @belongs Debug    *!    *! Set the assembler debug level.    *!    *! @returns    *! The old assembler debug level will be returned.    *!    *! @note    *! This function is only available if the Pike runtime has been compiled    *! with RTL debug.    */   PMOD_EXPORT void f__assembler_debug(INT32 args)   {    INT_TYPE l;       ASSERT_SECURITY_ROOT("_assembler_debug");    -  get_all_args("_assembler_debug", args, "%i", &l); +  get_all_args("_assembler_debug", args, "%+", &l);    pop_n_elems(args);    push_int(a_flag);    a_flag = l;   }    - /*! @decl void dump_program_tables(program p, int|void indent) + /*! @decl void dump_program_tables(program p, int(0..)|void indent)    *! @belongs Debug    *!    *! Dumps the internal tables for the program @[p] on stderr.    *!    *! @param p    *! Program to dump.    *!    *! @param indent    *! Number of spaces to indent the output.    *!    *! @note    *! In Pike 7.8.308 and earlier @[indent] wasn't supported.    */   void f__dump_program_tables(INT32 args)   {    struct program *p;    int indent = 0;       ASSERT_SECURITY_ROOT("_dump_program_tables"); /* FIXME: Might want lower. */ -  get_all_args("_dump_program_tables", args, "%p.%d", &p, &indent); +  get_all_args("_dump_program_tables", args, "%p.%+", &p, &indent);       dump_program_tables(p, indent);    pop_n_elems(args);   }      #ifdef YYDEBUG    - /*! @decl int compiler_trace(int(0..) level) + /*! @decl int(0..) compiler_trace(int(0..) level)    *! @belongs Debug    *!    *! Set the compiler trace level.    *!    *! @returns    *! The old compiler trace level will be returned.    *!    *! @note    *! This function is only available if the Pike runtime has been compiled    *! with RTL debug.
pike.git/src/builtin_functions.c:8477: Inside #if defined(DEBUG_MALLOC)
   *! @note    *! Only available when compiled with dmalloc.    */   PMOD_EXPORT void f__reset_dmalloc(INT32 args)   {    ASSERT_SECURITY_ROOT("_reset_dmalloc");    pop_n_elems(args);    reset_debug_malloc();   }    - /*! @decl void dmalloc_set_name(string filename, int linenumber) + /*! @decl void dmalloc_set_name(string filename, int(1..) linenumber)    *! @belongs Debug    *!    *! @note    *! Only available when compiled with dmalloc.    */   PMOD_EXPORT void f__dmalloc_set_name(INT32 args)   {    char *s;    INT_TYPE i;    extern char * dynamic_location(const char *file, INT_TYPE line);    extern char * dmalloc_default_location;       if(args)    { -  get_all_args("_dmalloc_set_name", args, "%s%i", &s, &i); +  get_all_args("_dmalloc_set_name", args, "%s%+", &s, &i);    dmalloc_default_location = dynamic_location(s, i);    }else{    dmalloc_default_location=0;    }    pop_n_elems(args);   }      /*! @decl void list_open_fds()    *! @belongs Debug    *!
pike.git/src/builtin_functions.c:9346:    push_int(0);    args++;    }       if (args<=3 &&    (TYPEOF(Pike_sp[1-args]) == T_INT &&    TYPEOF(Pike_sp[2-args]) == T_INT))    {    INT_TYPE step,start;    -  get_all_args("enumerate", args, "%i%i%i", &n, &step, &start); -  if (n<0) -  SIMPLE_BAD_ARG_ERROR("enumerate",1,"int(0..)"); -  +  get_all_args("enumerate", args, "%+%i%i", &n, &step, &start);    pop_n_elems(args);    push_array(d=allocate_array(n));    for (i=0; i<n; i++)    {    ITEM(d)[i].u.integer=start;    if ((step>0 && start+step<start) ||    (step<0 && start+step>start)) /* overflow */    {    pop_stack();    push_int(n);
pike.git/src/builtin_functions.c:9379:    d->type_field = BIT_INT;    }    else if (args<=3 &&    ((TYPEOF(Pike_sp[1-args]) == T_INT ||    TYPEOF(Pike_sp[1-args]) == T_FLOAT) &&    (TYPEOF(Pike_sp[2-args]) == T_INT ||    TYPEOF(Pike_sp[2-args]) == T_FLOAT) ) )    {    FLOAT_TYPE step, start;    -  get_all_args("enumerate", args, "%i%F%F", &n, &step, &start); -  if (n<0) -  SIMPLE_BAD_ARG_ERROR("enumerate",1,"int(0..)"); -  +  get_all_args("enumerate", args, "%+%F%F", &n, &step, &start);    pop_n_elems(args); -  +     push_array(d=allocate_array(n));    for (i=0; i<n; i++)    {    SET_SVAL(d->item[i], T_FLOAT, 0, float_number, start);    start+=step;    }    d->type_field = BIT_FLOAT;    }    else    {    TYPE_FIELD types = 0; -  get_all_args("enumerate", args, "%i", &n); -  if (n<0) SIMPLE_BAD_ARG_ERROR("enumerate",1,"int(0..)"); +  get_all_args("enumerate", args, "%+", &n);    if (args>4) pop_n_elems(args-4);    push_array(d=allocate_array(n));    if (args<4)    {    push_svalue(Pike_sp-2); /* start */    for (i=0; i<n; i++)    {    assign_svalue_no_free(ITEM(d)+i,Pike_sp-1);    types |= 1 << TYPEOF(ITEM(d)[i]);    if (i<n-1)
pike.git/src/builtin_functions.c:10132:   #endif      /* function(:void) */    ADD_EFUN("_verify_internals",f__verify_internals,    tFunc(tNone,tVoid),OPT_SIDE_EFFECT|OPT_EXTERNAL_DEPEND);      #ifdef PIKE_DEBUG      /* function(int:int) */    ADD_EFUN("_debug",f__debug, -  tFunc(tInt,tInt),OPT_SIDE_EFFECT|OPT_EXTERNAL_DEPEND); +  tFunc(tIntPos,tIntPos),OPT_SIDE_EFFECT|OPT_EXTERNAL_DEPEND);      /* function(int:int) */    ADD_EFUN("_optimizer_debug",f__optimizer_debug, -  tFunc(tInt,tInt),OPT_SIDE_EFFECT|OPT_EXTERNAL_DEPEND); +  tFunc(tIntPos,tIntPos),OPT_SIDE_EFFECT|OPT_EXTERNAL_DEPEND);      /* function(int:int) */    ADD_EFUN("_assembler_debug",f__assembler_debug, -  tFunc(tInt,tInt), OPT_SIDE_EFFECT|OPT_EXTERNAL_DEPEND); +  tFunc(tInt,tIntPos), OPT_SIDE_EFFECT|OPT_EXTERNAL_DEPEND);       ADD_EFUN("_dump_program_tables", f__dump_program_tables, -  tFunc(tPrg(tObj),tVoid), OPT_SIDE_EFFECT|OPT_EXTERNAL_DEPEND); +  tFunc(tPrg(tObj) tIntPos,tVoid), OPT_SIDE_EFFECT|OPT_EXTERNAL_DEPEND);      #ifdef YYDEBUG      /* function(int:int) */    ADD_EFUN("_compiler_trace",f__compiler_trace, -  tFunc(tInt,tInt),OPT_SIDE_EFFECT|OPT_EXTERNAL_DEPEND); +  tFunc(tIntPos,tIntPos),OPT_SIDE_EFFECT|OPT_EXTERNAL_DEPEND);   #endif /* YYDEBUG */   #endif      /* function(:mapping(string:int)) */    ADD_EFUN("_memory_usage",f__memory_usage,    tFunc(tNone,tMap(tStr,tInt)),OPT_EXTERNAL_DEPEND);       ADD_EFUN("_size_object",f__size_object,    tFunc(tObj,tInt),OPT_EXTERNAL_DEPEND);   
pike.git/src/builtin_functions.c:10316:    tFunc(tOr(tObj,tPrg(tObj)) tString,tString), 0, OPT_TRY_OPTIMIZE);    ADD_FUNCTION2("function_defined", f_function_defined,    tFunc(tFunction,tString), 0, OPT_TRY_OPTIMIZE);      #ifdef DEBUG_MALLOC      /* function(void:void) */    ADD_EFUN("_reset_dmalloc",f__reset_dmalloc,    tFunc(tVoid,tVoid),OPT_SIDE_EFFECT);    ADD_EFUN("_dmalloc_set_name",f__dmalloc_set_name, -  tOr(tFunc(tStr tInt,tVoid), tFunc(tVoid,tVoid)),OPT_SIDE_EFFECT); +  tOr(tFunc(tStr tIntPos,tVoid), tFunc(tVoid,tVoid)),OPT_SIDE_EFFECT);    ADD_EFUN("_list_open_fds",f__list_open_fds,    tFunc(tVoid,tVoid),OPT_SIDE_EFFECT);    ADD_EFUN("_dump_dmalloc_locations",f__dump_dmalloc_locations,    tFunc(tSetvar(1,tMix),tVar(1)),OPT_SIDE_EFFECT);   #endif   #ifdef PIKE_DEBUG      /* function(1=mixed:1) */    ADD_EFUN("_locate_references",f__locate_references,    tFunc(tSetvar(1,tMix),tVar(1)),OPT_SIDE_EFFECT);