1/*
2 * Copyright 2005-2006 Massachusetts Institute of Technology.
3 * All Rights Reserved.
4 *
5 * Export of this software from the United States of America may
6 * require a specific license from the United States Government.
7 * It is the responsibility of any person or organization contemplating
8 * export to obtain such a license before exporting.
9 *
10 * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
11 * distribute this software and its documentation for any purpose and
12 * without fee is hereby granted, provided that the above copyright
13 * notice appear in all copies and that both that copyright notice and
14 * this permission notice appear in supporting documentation, and that
15 * the name of M.I.T. not be used in advertising or publicity pertaining
16 * to distribution of the software without specific, written prior
17 * permission.  Furthermore if you modify this software you must label
18 * your software as modified software and not distribute it in such a
19 * fashion that it might be confused with the original M.I.T. software.
20 * M.I.T. makes no representations about the suitability of
21 * this software for any purpose.  It is provided "as is" without express
22 * or implied warranty.
23 */
24
25#ifndef KIM_TYPES_H
26#define KIM_TYPES_H
27
28#include <stdint.h>
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34/*!
35 * \defgroup kim_types_reference KIM Types and Constants
36 * @{
37 */
38
39/*!
40 * The KIM Error type.
41 */
42typedef int32_t     kim_error;
43
44/*!
45 * No error value for the kim_error type.
46 */
47#define KIM_NO_ERROR ((kim_error) 0)
48
49/*!
50 * A time value represented in seconds since January 1, 1970.
51 */
52typedef int64_t     kim_time;
53
54/*!
55 * A duration represented in seconds.
56 */
57typedef int64_t     kim_lifetime;
58
59/*!
60 * An quantity, usually used to return the number of elements in an array.
61 */
62typedef uint64_t    kim_count;
63
64/*!
65 * A boolean value.  0 means false, all other values mean true.
66 */
67typedef int         kim_boolean;
68
69/*!
70 * A comparison between two sortable objects.
71 * \li Less than 0 means the first object is less than the second.
72 * \li 0 means the two objects are identical.
73 * \li Greater than 0 means the first object is greater than the second.
74 * \note Convenience macros are provided for interpreting #kim_comparison
75 * values to improve code readability.
76 * See #kim_comparison_is_less_than(), #kim_comparison_is_equal_to() and
77 * #kim_comparison_is_greater_than()
78 */
79typedef int         kim_comparison;
80
81/*!
82 * Convenience macro for interpreting #kim_comparison.
83 */
84#define kim_comparison_is_less_than(c)    (c < 0)
85
86/*!
87 * Convenience macro for interpreting #kim_comparison.
88 */
89#define kim_comparison_is_equal_to(c)        (c == 0)
90
91/*!
92 * Convenience macro for interpreting #kim_comparison.
93 */
94#define kim_comparison_is_greater_than(c) (c > 0)
95
96/*!
97 * The KIM String type.  See \ref kim_string_overview for more information.
98 */
99typedef const char *kim_string;
100
101struct kim_identity_opaque;
102/*!
103 * A KIM Principal object.  See \ref kim_identity_overview for more information.
104 */
105typedef struct kim_identity_opaque *kim_identity;
106
107struct kim_options_opaque;
108/*!
109 * A KIM Options object.  See \ref kim_options_overview for more information.
110 */
111typedef struct kim_options_opaque *kim_options;
112
113struct kim_selection_hints_opaque;
114/*!
115 * A KIM Selection Hints object.  See \ref kim_selection_hints_overview for more information.
116 */
117typedef struct kim_selection_hints_opaque *kim_selection_hints;
118
119struct kim_preferences_opaque;
120/*!
121 * A KIM Preferences object.  See \ref kim_preferences_overview for more information.
122 */
123typedef struct kim_preferences_opaque *kim_preferences;
124
125struct kim_ccache_iterator_opaque;
126/*!
127 * A KIM CCache Iterator object.  See \ref kim_credential_cache_collection for more information.
128 */
129typedef struct kim_ccache_iterator_opaque *kim_ccache_iterator;
130
131struct kim_ccache_opaque;
132/*!
133 * A KIM CCache object.  See \ref kim_ccache_overview for more information.
134 */
135typedef struct kim_ccache_opaque *kim_ccache;
136
137struct kim_credential_iterator_opaque;
138/*!
139 * A KIM Credential Iterator object.  See \ref kim_credential_iterator for more information.
140 */
141typedef struct kim_credential_iterator_opaque *kim_credential_iterator;
142
143struct kim_credential_opaque;
144/*!
145 * A KIM Credential object.  See \ref kim_credential_overview for more information.
146 */
147typedef struct kim_credential_opaque *kim_credential;
148
149/*!@}*/
150
151#ifdef __cplusplus
152}
153#endif
154
155#endif /* KIM_TYPES_H */
156