Skip to content
Snippets Groups Projects
Commit 7abd89f9 authored by Henrik (Grubba) Grubbström's avatar Henrik (Grubba) Grubbström
Browse files

Added add_pike_string_constant().

Rev: src/constants.c:1.55
Rev: src/constants.h:1.33
parent faf7fb66
Branches
Tags
No related merge requests found
......@@ -2,7 +2,7 @@
|| 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.54 2004/09/18 20:50:48 nilsson Exp $
|| $Id: constants.c,v 1.55 2004/12/30 12:57:24 grubba Exp $
*/
#include "global.h"
......@@ -53,6 +53,15 @@ void low_add_constant(const char *name, struct svalue *fun)
free_string(p);
}
void add_pike_string_constant(const char *name, const char *str, int len)
{
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;
......
......@@ -2,7 +2,7 @@
|| 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.h,v 1.32 2003/08/20 16:31:44 mast Exp $
|| $Id: constants.h,v 1.33 2004/12/30 12:57:24 grubba Exp $
*/
#ifndef ADD_EFUN_H
......@@ -48,6 +48,7 @@ extern struct callable *first_callable;
PMOD_EXPORT struct mapping *get_builtin_constants(void);
void low_add_efun(struct pike_string *name, struct svalue *fun);
void low_add_constant(const char *name, struct svalue *fun);
void add_pike_string_constant(const char *name, const char *str, int len);
PMOD_EXPORT void add_global_program(const char *name, struct program *p);
BLOCK_ALLOC_FILL_PAGES(callable,2)
PMOD_EXPORT struct callable *low_make_callable(c_fun fun,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment