]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/src/engine/native.cpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / tools / build / src / engine / native.cpp
1 /* Copyright 2003. Vladimir Prus
2 * Distributed under the Boost Software License, Version 1.0.
3 * (See accompanying file LICENSE.txt or copy at
4 * https://www.bfgroup.xyz/b2/LICENSE.txt)
5 */
6
7 #include "native.h"
8
9 #include "hash.h"
10
11 #include <assert.h>
12
13
14 void declare_native_rule( char const * module, char const * rule,
15 char const * * args, LIST * (*f)( FRAME *, int32_t ), int32_t version )
16 {
17 OBJECT * const module_obj = module ? object_new( module ) : 0 ;
18 module_t * m = bindmodule( module_obj );
19 if ( module_obj )
20 object_free( module_obj );
21 if ( !m->native_rules )
22 m->native_rules = hashinit( sizeof( native_rule_t ), "native rules" );
23
24 {
25 OBJECT * const name = object_new( rule );
26 int32_t found;
27 native_rule_t * const np = (native_rule_t *)hash_insert(
28 m->native_rules, name, &found );
29 np->name = name;
30 assert( !found );
31 np->procedure = function_builtin( f, 0, args );
32 np->version = version;
33 }
34 }