Select Git revision
constants.h
-
Martin Stjernholm authored
Rev: src/array.c:1.207 Rev: src/array.h:1.75 Rev: src/constants.c:1.60 Rev: src/constants.h:1.37 Rev: src/mapping.c:1.201 Rev: src/mapping.h:1.68 Rev: src/multiset.c:1.111 Rev: src/multiset.h:1.44 Rev: src/object.c:1.291 Rev: src/object.h:1.96 Rev: src/pike_types.c:1.332 Rev: src/pike_types.h:1.115 Rev: src/program.c:1.692 Rev: src/program.h:1.243 Rev: src/stralloc.c:1.219 Rev: src/stralloc.h:1.104
Martin Stjernholm authoredRev: src/array.c:1.207 Rev: src/array.h:1.75 Rev: src/constants.c:1.60 Rev: src/constants.h:1.37 Rev: src/mapping.c:1.201 Rev: src/mapping.h:1.68 Rev: src/multiset.c:1.111 Rev: src/multiset.h:1.44 Rev: src/object.c:1.291 Rev: src/object.h:1.96 Rev: src/pike_types.c:1.332 Rev: src/pike_types.h:1.115 Rev: src/program.c:1.692 Rev: src/program.h:1.243 Rev: src/stralloc.c:1.219 Rev: src/stralloc.h:1.104
constants.h 3.15 KiB
/*
|| 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.37 2008/05/11 14:55:53 mast Exp $
*/
#ifndef ADD_EFUN_H
#define ADD_EFUN_H
#include "svalue.h"
#include "hashtable.h"
#include "las.h" /* For OPT_SIDE_EFFECT etc. */
#include "block_alloc_h.h"
typedef int (*docode_fun)(node *n);
typedef node *(*optimize_fun)(node *n);
#define CALLABLE_DYNAMIC 1
struct callable
{
PIKE_MEMORY_OBJECT_MEMBERS;
c_fun function;
struct pike_type *type;
struct pike_string *name;
struct program *prog;
INT16 flags; /* OPT_* */
INT16 internal_flags;
#ifdef PIKE_DEBUG
INT8 may_return_void;
long runs;
struct callable *prev;
#endif
optimize_fun optimize;
docode_fun docode;
struct callable *next;
};
#ifdef PIKE_DEBUG
/* We have a double-linked list in debug mode for identification
* purposes. */
extern struct callable *first_callable;
#endif
/* Prototypes begin here */
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,
struct pike_string *name,
struct pike_type *type,
int flags,
optimize_fun optimize,
docode_fun docode);
PMOD_EXPORT struct callable *make_callable(c_fun fun,
const char *name,
const char *type,
int flags,
optimize_fun optimize,
docode_fun docode);
PMOD_EXPORT struct callable *add_efun2(const char *name,
c_fun fun,
const char *type,
int flags,
optimize_fun optimize,
docode_fun docode);