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
9 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 /***************************************************************************
19 * Description: Map object header file *
20 * Author: Gal Shachor <shachor@il.ibm.com> *
21 * Version: $Revision: 756058 $ *
22 ***************************************************************************/
31 #endif /* __cplusplus */
33 #define JK_MAP_HANDLE_NORMAL 0
34 #define JK_MAP_HANDLE_DUPLICATES 1
35 #define JK_MAP_HANDLE_RAW 2
38 typedef struct jk_map jk_map_t;
40 int jk_map_alloc(jk_map_t **m);
42 int jk_map_free(jk_map_t **m);
44 int jk_map_open(jk_map_t *m);
46 int jk_map_close(jk_map_t *m);
48 void *jk_map_get(jk_map_t *m, const char *name, const void *def);
50 int jk_map_get_id(jk_map_t *m, const char *name);
52 int jk_map_get_int(jk_map_t *m, const char *name, int def);
54 double jk_map_get_double(jk_map_t *m, const char *name, double def);
56 int jk_map_get_bool(jk_map_t *m, const char *name, int def);
58 const char *jk_map_get_string(jk_map_t *m, const char *name, const char *def);
60 char **jk_map_get_string_list(jk_map_t *m,
62 unsigned *list_len, const char *def);
64 int jk_map_get_int_list(jk_map_t *m,
66 int *list, unsigned int list_len,
69 int jk_map_add(jk_map_t *m, const char *name, const void *value);
71 int jk_map_put(jk_map_t *m, const char *name, const void *value, void **old);
73 int jk_map_read_property(jk_map_t *m, jk_map_t *env, const char *str, int treatment, jk_logger_t *l);
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);
77 int jk_map_size(jk_map_t *m);
79 const char *jk_map_name_at(jk_map_t *m, int idex);
81 void *jk_map_value_at(jk_map_t *m, int idex);
83 void jk_map_dump(jk_map_t *m, jk_logger_t *l);
85 int jk_map_copy(jk_map_t *src, jk_map_t *dst);
87 int jk_map_resolve_references(jk_map_t *m, const char *prefix, int wildcard, int depth, jk_logger_t *l);
89 int jk_map_inherit_properties(jk_map_t *m, const char *from, const char *to, jk_logger_t *l);
93 #endif /* __cplusplus */