bottleneck testcase based on rubbos
[bottlenecks.git] / rubbos / app / tomcat-connectors-1.2.32-src / native / common / jk_map.h
1 /*
2  *  Licensed to the Apache Software Foundation (ASF) under one or more
3  *  contributor license agreements.  See the NOTICE file distributed with
4  *  this work for additional information regarding copyright ownership.
5  *  The ASF licenses this file to You under the Apache License, Version 2.0
6  *  (the "License"); you may not use this file except in compliance with
7  *  the License.  You may obtain a copy of the License at
8  *
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  *
11  *  Unless required by applicable law or agreed to in writing, software
12  *  distributed under the License is distributed on an "AS IS" BASIS,
13  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  *  See the License for the specific language governing permissions and
15  *  limitations under the License.
16  */
17
18 /***************************************************************************
19  * Description: Map object header file                                     *
20  * Author:      Gal Shachor <shachor@il.ibm.com>                           *
21  * Version:     $Revision: 756058 $                                           *
22  ***************************************************************************/
23
24 #ifndef JK_MAP_H
25 #define JK_MAP_H
26
27
28 #ifdef __cplusplus
29 extern "C"
30 {
31 #endif                          /* __cplusplus */
32
33 #define JK_MAP_HANDLE_NORMAL     0
34 #define JK_MAP_HANDLE_DUPLICATES 1
35 #define JK_MAP_HANDLE_RAW        2
36
37 struct jk_map;
38 typedef struct jk_map jk_map_t;
39
40 int jk_map_alloc(jk_map_t **m);
41
42 int jk_map_free(jk_map_t **m);
43
44 int jk_map_open(jk_map_t *m);
45
46 int jk_map_close(jk_map_t *m);
47
48 void *jk_map_get(jk_map_t *m, const char *name, const void *def);
49
50 int jk_map_get_id(jk_map_t *m, const char *name);
51
52 int jk_map_get_int(jk_map_t *m, const char *name, int def);
53
54 double jk_map_get_double(jk_map_t *m, const char *name, double def);
55
56 int jk_map_get_bool(jk_map_t *m, const char *name, int def);
57
58 const char *jk_map_get_string(jk_map_t *m, const char *name, const char *def);
59
60 char **jk_map_get_string_list(jk_map_t *m,
61                            const char *name,
62                            unsigned *list_len, const char *def);
63
64 int jk_map_get_int_list(jk_map_t *m,
65                         const char *name,
66                         int *list, unsigned int list_len,
67                         const char *def);
68
69 int jk_map_add(jk_map_t *m, const char *name, const void *value);
70
71 int jk_map_put(jk_map_t *m, const char *name, const void *value, void **old);
72
73 int jk_map_read_property(jk_map_t *m, jk_map_t *env, const char *str, int treatment, jk_logger_t *l);
74
75 int jk_map_read_properties(jk_map_t *m, jk_map_t *env, const char *f, time_t *modified, int treatment, jk_logger_t *l);
76
77 int jk_map_size(jk_map_t *m);
78
79 const char *jk_map_name_at(jk_map_t *m, int idex);
80
81 void *jk_map_value_at(jk_map_t *m, int idex);
82
83 void jk_map_dump(jk_map_t *m, jk_logger_t *l);
84
85 int jk_map_copy(jk_map_t *src, jk_map_t *dst);
86
87 int jk_map_resolve_references(jk_map_t *m, const char *prefix, int wildcard, int depth, jk_logger_t *l);
88
89 int jk_map_inherit_properties(jk_map_t *m, const char *from, const char *to, jk_logger_t *l);
90
91 #ifdef __cplusplus
92 }
93 #endif                          /* __cplusplus */
94
95 #endif                          /* JK_MAP_H */