pike.git / src / constants.c

version» Context lines:

pike.git/src/constants.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: constants.c,v 1.49 2003/08/20 16:31:44 mast Exp $ + || $Id: constants.c,v 1.50 2004/01/13 00:48:54 nilsson Exp $   */      #include "global.h"   #include "constants.h"   #include "pike_macros.h"   #include "program.h"   #include "pike_types.h"   #include "stralloc.h"   #include "pike_memory.h"   #include "interpret.h"   #include "mapping.h"   #include "pike_error.h"   #include "security.h"   #include "block_alloc.h"    - RCSID("$Id: constants.c,v 1.49 2003/08/20 16:31:44 mast Exp $"); + RCSID("$Id: constants.c,v 1.50 2004/01/13 00:48:54 nilsson Exp $");      struct mapping *builtin_constants = 0;      #ifdef PIKE_DEBUG   struct callable *first_callable = NULL;   #endif      PMOD_EXPORT struct mapping *get_builtin_constants(void)   {    return builtin_constants;
pike.git/src/constants.c:155:    const char *type, ptrdiff_t type_length,    int flags,    optimize_fun optimize,    docode_fun docode)   {    struct svalue s;    struct pike_string *n;    struct pike_type *t;    struct callable *ret;    + #if 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); -  low_add_efun(n, &s); +  mapping_string_insert(builtin_constants, n, &s);    free_svalue(&s);    free_string(n);    return ret;   }      #ifdef PIKE_DEBUG   void present_constant_profiling(void)   {    struct callable_block *b;    size_t e;