Skip to content
Snippets Groups Projects
Commit cecf5156 authored by Fredrik Hübinette (Hubbe)'s avatar Fredrik Hübinette (Hubbe)
Browse files

some more user-friendlyness added

Rev: src/constants.c:1.8
Rev: src/constants.h:1.4
parent 7b394141
No related branches found
No related tags found
No related merge requests found
...@@ -43,6 +43,23 @@ void low_add_efun(struct pike_string *name, struct svalue *fun) ...@@ -43,6 +43,23 @@ void low_add_efun(struct pike_string *name, struct svalue *fun)
} }
} }
void low_add_constant(char *name, struct svalue *fun)
{
struct pike_string *p;
p=make_shared_string(name);
low_add_efun(p, fun);
free_string(p);
}
void add_global_program(char *name, struct program *p)
{
struct svalue s;
s.type=T_PROGRAM;
s.subtype=0;
s.u.program=p;
low_add_constant(name, &s);
}
struct callable *make_callable(c_fun fun, struct callable *make_callable(c_fun fun,
char *name, char *name,
char *type, char *type,
......
...@@ -28,6 +28,8 @@ struct callable ...@@ -28,6 +28,8 @@ struct callable
/* Prototypes begin here */ /* Prototypes begin here */
struct mapping *get_builtin_constants(); struct mapping *get_builtin_constants();
void low_add_efun(struct pike_string *name, struct svalue *fun); void low_add_efun(struct pike_string *name, struct svalue *fun);
void low_add_constant(char *name, struct svalue *fun);
void add_global_program(char *name, struct program *p);
struct callable *make_callable(c_fun fun, struct callable *make_callable(c_fun fun,
char *name, char *name,
char *type, char *type,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment