1 |
/* Creation date: 2005-07-09 21:44:59
|
2 |
* Authors: Don
|
3 |
* Change log:
|
4 |
*/
|
5 |
|
6 |
/* Copyright (c) 2005 Don Owens
|
7 |
All rights reserved.
|
8 |
|
9 |
This code is released under the BSD license:
|
10 |
|
11 |
Redistribution and use in source and binary forms, with or without
|
12 |
modification, are permitted provided that the following conditions
|
13 |
are met:
|
14 |
|
15 |
* Redistributions of source code must retain the above copyright
|
16 |
notice, this list of conditions and the following disclaimer.
|
17 |
|
18 |
* Redistributions in binary form must reproduce the above
|
19 |
copyright notice, this list of conditions and the following
|
20 |
disclaimer in the documentation and/or other materials provided
|
21 |
with the distribution.
|
22 |
|
23 |
* Neither the name of the author nor the names of its
|
24 |
contributors may be used to endorse or promote products derived
|
25 |
from this software without specific prior written permission.
|
26 |
|
27 |
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
28 |
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
29 |
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
30 |
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
31 |
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
32 |
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
33 |
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
34 |
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
35 |
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
36 |
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
37 |
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
38 |
OF THE POSSIBILITY OF SUCH DAMAGE.
|
39 |
*/
|
40 |
|
41 |
#include "cfu.h"
|
42 |
|
43 |
struct libcfu_item {
|
44 |
libcfu_type type;
|
45 |
};
|
46 |
|
47 |
extern libcfu_type
|
48 |
cfu_get_type(void *item) {
|
49 |
if (!item) return libcfu_t_none;
|
50 |
return ((libcfu_item_t *)item)->type;
|
51 |
}
|
52 |
|
53 |
extern int
|
54 |
cfu_is_hash(void *item) {
|
55 |
if (cfu_get_type(item) == libcfu_t_hash_table) return 1;
|
56 |
return 0;
|
57 |
}
|
58 |
|
59 |
extern int
|
60 |
cfu_is_list(void *item) {
|
61 |
if (cfu_get_type(item) == libcfu_t_list) return 1;
|
62 |
return 0;
|
63 |
}
|
64 |
|
65 |
extern int
|
66 |
cfu_is_string(void *item) {
|
67 |
if (cfu_get_type(item) == libcfu_t_string) return 1;
|
68 |
return 0;
|
69 |
}
|
70 |
|
71 |
extern int
|
72 |
cfu_is_time(void *item) {
|
73 |
if (cfu_get_type(item) == libcfu_t_time) return 1;
|
74 |
return 0;
|
75 |
}
|
76 |
|
77 |
extern int
|
78 |
cfu_is_conf(void *item) {
|
79 |
if (cfu_get_type(item) == libcfu_t_conf) return 1;
|
80 |
return 0;
|
81 |
}
|