pike.git / src / constants.c

version» Context lines:

pike.git/src/constants.c:28:      PMOD_EXPORT struct mapping *get_builtin_constants(void)   {    return builtin_constants;   }      void low_add_efun(struct pike_string *name, struct svalue *fun)   {    struct svalue s;    -  s.type=T_STRING; -  s.subtype=0; -  s.u.string=name; +  SET_SVAL(s, T_STRING, 0, string, name);       if(fun)    {    mapping_insert(builtin_constants, &s, fun);    }else{    map_delete(builtin_constants, &s);    }   }      void low_add_constant(const char *name, struct svalue *fun)
pike.git/src/constants.c:60:    struct pike_string *key = make_shared_string(name);    struct pike_string *val = make_shared_binary_string(str, len);    mapping_string_insert_string(builtin_constants, key, val);    free_string(val);    free_string(key);   }      PMOD_EXPORT void add_global_program(const char *name, struct program *p)   {    struct svalue s; -  s.type=T_PROGRAM; -  s.subtype=0; -  s.u.program=p; +  SET_SVAL(s, T_PROGRAM, 0, program, p);    low_add_constant(name, p?&s:NULL);   }      #undef INIT_BLOCK   #define INIT_BLOCK(X) do { \    DO_IF_DEBUG (DOUBLELINK (first_callable, X)); \    } while (0)      #undef EXIT_BLOCK   #define EXIT_BLOCK(X) do { \
pike.git/src/constants.c:144:    const char *type,    int flags,    optimize_fun optimize,    docode_fun docode)   {    struct svalue s;    struct pike_string *n;    struct callable *ret;       n=make_shared_string(name); -  s.type=T_FUNCTION; -  s.subtype=FUNCTION_BUILTIN; -  ret=s.u.efun=make_callable(fun, name, type, flags, optimize, docode); +  SET_SVAL(s, T_FUNCTION, FUNCTION_BUILTIN, efun, +  make_callable(fun, name, type, flags, optimize, docode));    low_add_efun(n, &s);    free_svalue(&s);    free_string(n);    return ret;   }      PMOD_EXPORT struct callable *add_efun(const char *name, c_fun fun, const char *type, int flags)   {    return add_efun2(name,fun,type,flags,0,0);   }
pike.git/src/constants.c:180: Inside #if defined(PIKE_DEBUG)
  #ifdef PIKE_DEBUG    if(simple_mapping_string_lookup(builtin_constants, name))    Pike_fatal("%s added as efun more than once.\n", name);   #endif       n = make_shared_binary_string(name, name_length);    t = make_pike_type(type);   #ifdef DEBUG    check_type_string(t);   #endif -  s.type=T_FUNCTION; -  s.subtype=FUNCTION_BUILTIN; +     add_ref(n); -  ret=s.u.efun=low_make_callable(fun, n, t, flags, optimize, docode); +  SET_SVAL(s, T_FUNCTION, FUNCTION_BUILTIN, efun, +  ret = low_make_callable(fun, n, t, flags, optimize, docode));    mapping_string_insert(builtin_constants, n, &s);    free_svalue(&s);    free_string(n);    return ret;   }      PMOD_EXPORT void visit_callable (struct callable *c, int action)   {    switch (action) {   #ifdef PIKE_DEBUG