Sanitize python object -> tag number exception handling
[platform/upstream/rpm.git] / lib / rpmtypes.h
1 #ifndef _RPMTYPES_H
2 #define _RPMTYPES_H
3
4 /** \ingroup rpmtypes
5  * \file lib/rpmtypes.h
6  *
7  * Typedefs for RPM abstract data types.
8  * @todo The grouping needs love to look sane...
9  */
10
11 #include <stdint.h>
12
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16
17 typedef const char *    errmsg_t;
18
19 /** \ingroup rpmtypes
20  *
21  * RPM header and data retrieval types.
22  * @{
23  */
24 typedef struct headerToken_s * Header;
25 typedef struct headerIterator_s * HeaderIterator;
26
27 typedef int32_t         rpm_tag_t;
28 typedef uint32_t        rpm_tagtype_t;          /* unused */
29 typedef uint32_t        rpm_count_t;
30
31 typedef void *          rpm_data_t;
32 typedef const void *    rpm_constdata_t;
33
34 typedef struct rpmtd_s * rpmtd;
35
36 typedef uint32_t        rpm_color_t;
37 typedef uint32_t        rpm_flag_t;
38 typedef uint32_t        rpm_tid_t;
39 /** @} */
40
41 /** \ingroup rpmtypes
42  *
43  * In-header hardcoded sizes for various POSIXy types
44  * @{
45  */
46 typedef uint32_t        rpm_off_t;
47 typedef uint64_t        rpm_loff_t;
48 typedef uint32_t        rpm_time_t;
49 typedef uint16_t        rpm_mode_t;
50 typedef uint16_t        rpm_rdev_t;
51 typedef uint32_t        rpm_dev_t;
52 typedef uint32_t        rpm_ino_t;
53 /** @} */
54
55 /** \ingroup rpmtypes
56  * The main types involved in transaction manipulation 
57  * @{
58  */
59 typedef struct rpmts_s * rpmts;
60 typedef struct rpmte_s * rpmte;
61 typedef struct rpmds_s * rpmds;
62 typedef struct rpmfi_s * rpmfi;
63 typedef struct rpmdb_s * rpmdb;
64 typedef struct rpmdbMatchIterator_s * rpmdbMatchIterator;
65 typedef const void * fnpyKey;
66 typedef void * rpmCallbackData;
67 /** @} */
68
69 typedef struct rpmPubkey_s * rpmPubkey;
70 typedef struct rpmKeyring_s * rpmKeyring;
71
72 typedef struct rpmgi_s * rpmgi;
73
74 typedef struct rpmSpec_s * rpmSpec;
75
76 typedef struct rpmRelocation_s rpmRelocation;
77
78
79 /** \ingroup rpmtypes 
80  * RPM IO file descriptor type
81  */
82 typedef struct _FD_s * FD_t;
83
84 /** \ingroup rpmtypes
85  * Package read return codes.
86  */
87 typedef enum rpmRC_e {
88     RPMRC_OK            = 0,    /*!< Generic success code */
89     RPMRC_NOTFOUND      = 1,    /*!< Generic not found code. */
90     RPMRC_FAIL          = 2,    /*!< Generic failure code. */
91     RPMRC_NOTTRUSTED    = 3,    /*!< Signature is OK, but key is not trusted. */
92     RPMRC_NOKEY         = 4     /*!< Public key is unavailable. */
93 } rpmRC;
94
95 #ifdef __cplusplus
96 }
97 #endif
98
99 /* XXX included late as rpmtag.h depends on our definitions here... */
100 #include <rpm/rpmtag.h>
101
102 #endif /* _RPMTYPES_H */