pike.git/src/constants.c:10:
#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.38 2002/08/15 14:49:20 marcus Exp $");
+ RCSID("$Id: constants.c,v 1.39 2002/09/12 13:15:49 marcus Exp $");
struct mapping *builtin_constants = 0;
PMOD_EXPORT struct mapping *get_builtin_constants(void)
{
return builtin_constants;
}
void low_add_efun(struct pike_string *name, struct svalue *fun)
{
pike.git/src/constants.c:35:
s.u.string=name;
if(fun)
{
mapping_insert(builtin_constants, &s, fun);
}else{
map_delete(builtin_constants, &s);
}
}
- void low_add_constant(char *name, struct svalue *fun)
+ void low_add_constant(const char *name, struct svalue *fun)
{
struct pike_string *p;
p=make_shared_string(name);
low_add_efun(p, fun);
free_string(p);
}
- PMOD_EXPORT void add_global_program(char *name, struct program *p)
+ 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;
low_add_constant(name, &s);
}
#undef EXIT_BLOCK
#define EXIT_BLOCK(X) do { \
pike.git/src/constants.c:94: Inside #if defined(PIKE_DEBUG)
if(!z) Pike_fatal("Gnapp!\n");
free_type(z);
}
f->runs=0;
f->compiles=0;
#endif
return f;
}
PMOD_EXPORT struct callable *make_callable(c_fun fun,
- char *name,
- char *type,
+ const char *name,
+ const char *type,
INT16 flags,
optimize_fun optimize,
docode_fun docode)
{
return low_make_callable(fun, make_shared_string(name), parse_type(type),
flags, optimize, docode);
}
- PMOD_EXPORT struct callable *add_efun2(char *name,
+ PMOD_EXPORT struct callable *add_efun2(const char *name,
c_fun fun,
- char *type,
+ const char *type,
INT16 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);
low_add_efun(n, &s);
free_svalue(&s);
free_string(n);
return ret;
}
- PMOD_EXPORT struct callable *add_efun(char *name, c_fun fun, char *type, INT16 flags)
+ PMOD_EXPORT struct callable *add_efun(const char *name, c_fun fun, const char *type, INT16 flags)
{
return add_efun2(name,fun,type,flags,0,0);
}
- PMOD_EXPORT struct callable *quick_add_efun(char *name, ptrdiff_t name_length,
+ PMOD_EXPORT struct callable *quick_add_efun(const char *name, ptrdiff_t name_length,
c_fun fun,
- char *type, ptrdiff_t type_length,
+ const char *type, ptrdiff_t type_length,
INT16 flags,
optimize_fun optimize,
docode_fun docode)
{
struct svalue s;
struct pike_string *n;
struct pike_type *t;
struct callable *ret;
n = make_shared_binary_string(name, name_length);