1 /*
2  * Copyright (C) 2000-2005 Chris Ross and various contributors
3  * Copyright (C) 1999-2000 Chris Ross
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are met:
8  *
9  * o Redistributions of source code must retain the above copyright notice, this
10  *   list of conditions and the following disclaimer.
11  * o Redistributions in binary form must reproduce the above copyright notice,
12  *   this list of conditions and the following disclaimer in the documentation
13  *   and/or other materials provided with the distribution.
14  * o Neither the name of the ferite software nor the names of its contributors may
15  *   be used to endorse or promote products derived from this software without
16  *   specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
22  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28  * POSSIBILITY OF SUCH DAMAGE.
29  */
30 
31 #ifndef __FERITE_NS_H__
32 #define __FERITE_NS_H__
33 
34 #define FENS_NS  1
35 #define FENS_VAR 2
36 #define FENS_FNC 3
37 #define FENS_CLS 4
38 #define FENS_PARENT_NS 5
39 
40 FERITE_API FeriteNamespace *ferite_register_namespace( FeriteScript *script,  char *name, FeriteNamespace *parent );
41 FERITE_API int ferite_delete_namespace( FeriteScript *script,  FeriteNamespace *ns );
42 FERITE_API FeriteNamespaceBucket *ferite_register_namespace_element( FeriteScript *script,  FeriteNamespace *ns, char *name, int type, void *data );
43 FERITE_API FeriteNamespaceBucket *ferite_namespace_element_exists( FeriteScript *script,  FeriteNamespace *ns, char *name );
44 FERITE_API FeriteNamespaceBucket *ferite_find_namespace( FeriteScript *script,  FeriteNamespace *parent, char *obj, int type );
45 FERITE_API void *ferite_find_namespace_element_contents( FeriteScript *script,  FeriteNamespace *parent, char *obj, int type );
46 FERITE_API int ferite_delete_namespace_element_from_namespace( FeriteScript *script,  FeriteNamespace *ns, char *name );
47 FERITE_API int ferite_rename_namespace_element( FeriteScript *script, FeriteNamespace *ns, char *from, char *to );
48 FERITE_API FeriteFunction *ferite_register_ns_function( FeriteScript *script,  FeriteNamespace *ns, FeriteFunction *f );
49 FERITE_API FeriteVariable *ferite_register_ns_variable( FeriteScript *script,  FeriteNamespace *ns, FeriteVariable *var );
50 FERITE_API FeriteClass *ferite_register_ns_class( FeriteScript *script, FeriteNamespace *ns, FeriteClass *classt );
51 FERITE_API FeriteNamespace *ferite_namespace_dup( FeriteScript *script, FeriteNamespace *ns, FeriteNamespace *parent );
52 FERITE_API FeriteNamespaceBucket *ferite_namespace_bucket_dup( FeriteScript *script, FeriteNamespaceBucket *nsb, FeriteNamespace *parent );
53 FERITE_API char *ferite_namespace_bucket_type_to_str( FeriteScript *script, int type );
54 
55 #endif /* __FERITE_NS_H__ */
56