diff options
| author | Christoph Berg <myon@debian.org> | 2018-12-19 22:58:32 +0100 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2018-12-19 22:58:32 +0100 |
| commit | e0737c56c1e384e05064a0c6e1ac46979371041b (patch) | |
| tree | a0123d694a2d36c43dabdf0a3907392fce11d457 /boost/tools/build/src/engine/native.c | |
| parent | b4aebf2d137b892f53503b13785ecae900062ff7 (diff) | |
New upstream version 2.0.0+repackupstream/2.0.0+repack
Diffstat (limited to 'boost/tools/build/src/engine/native.c')
| -rw-r--r-- | boost/tools/build/src/engine/native.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/boost/tools/build/src/engine/native.c b/boost/tools/build/src/engine/native.c new file mode 100644 index 00000000..68828aa3 --- /dev/null +++ b/boost/tools/build/src/engine/native.c @@ -0,0 +1,34 @@ +/* Copyright 2003. Vladimir Prus + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + */ + +#include "native.h" + +#include "hash.h" + +#include <assert.h> + + +void declare_native_rule( char const * module, char const * rule, + char const * * args, LIST * (*f)( FRAME *, int ), int version ) +{ + OBJECT * const module_obj = module ? object_new( module ) : 0 ; + module_t * m = bindmodule( module_obj ); + if ( module_obj ) + object_free( module_obj ); + if ( !m->native_rules ) + m->native_rules = hashinit( sizeof( native_rule_t ), "native rules" ); + + { + OBJECT * const name = object_new( rule ); + int found; + native_rule_t * const np = (native_rule_t *)hash_insert( + m->native_rules, name, &found ); + np->name = name; + assert( !found ); + np->procedure = function_builtin( f, 0, args ); + np->version = version; + } +} |
