1 /* 2 * Copyright 2011 Steven Watanabe 3 * Distributed under the Boost Software License, Version 1.0. 4 * (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) 5 */ 6 7 #ifndef FUNCTION_SW20111123_H 8 #define FUNCTION_SW20111123_H 9 10 #include "config.h" 11 #include "object.h" 12 #include "frames.h" 13 #include "lists.h" 14 #include "parse.h" 15 #include "strings.h" 16 17 typedef struct _function FUNCTION; 18 typedef struct _stack STACK; 19 20 STACK * stack_global( void ); 21 void stack_push( STACK * s, LIST * l ); 22 LIST * stack_pop( STACK * s ); 23 24 FUNCTION * function_compile( PARSE * parse ); 25 FUNCTION * function_builtin( LIST * ( * func )( FRAME * frame, int flags ), int flags, const char * * args ); 26 void function_refer( FUNCTION * ); 27 void function_free( FUNCTION * ); 28 OBJECT * function_rulename( FUNCTION * ); 29 void function_set_rulename( FUNCTION *, OBJECT * ); 30 void function_location( FUNCTION *, OBJECT * *, int * ); 31 LIST * function_run( FUNCTION * function, FRAME * frame, STACK * s ); 32 33 FUNCTION * function_compile_actions( const char * actions, OBJECT * file, int line ); 34 void function_run_actions( FUNCTION * function, FRAME * frame, STACK * s, string * out ); 35 36 FUNCTION * function_bind_variables( FUNCTION * f, module_t * module, int * counter ); 37 FUNCTION * function_unbind_variables( FUNCTION * f ); 38 39 LIST * function_get_variables( FUNCTION * f ); 40 41 void function_done( void ); 42 43 #ifdef HAVE_PYTHON 44 45 FUNCTION * function_python( PyObject * function, PyObject * bjam_signature ); 46 47 #endif 48 49 #endif 50