rpm  5.4.15
rpmsyck.h
Go to the documentation of this file.
1 #ifndef H_RPMSYCK
2 #define H_RPMSYCK
3 
4 #if defined(WITH_SYCK)
5 
6 #include <syck.h>
7 #include <rpmhash.h>
8 
9 typedef enum {
10  T_END,
11  T_STR,
12  T_SEQ,
13  T_MAP
14 } syck_type_t;
15 
16 typedef /*@abstract@*/ struct rpmsyck_node_s * rpmsyck_node;
17 
18 struct rpmsyck_node_s {
19  syck_type_t type;
20  char *tag;
21  union {
22  char *key;
23  rpmsyck_node seq;
24  hashTable map;
25  } value;
26 };
27 
28 typedef /*@abstract@*/ /*@refcounted@*/ struct rpmSyck_s * rpmSyck;
29 
30 struct rpmSyck_s {
31  struct rpmioItem_s _item;
32  rpmsyck_node firstNode;
33  st_table *syms;
34 #if defined(__LCLINT__)
35 /*@refs@*/
36  int nrefs;
37 #endif
38 };
39 
44 /*@newref@*/ /*@null@*/
45 rpmSyck rpmSyckCreate(void);
46 
52 /*@newref@*/ /*@null@*/
53 rpmSyck rpmSyckLoad(char *yaml);
54 
60 /*@unused@*/ /*@null@*/
61 rpmSyck rpmSyckUnlink (/*@killref@*/ /*@null@*/ rpmSyck rs)
62  /*@modifies rs @*/;
63 #define rpmSyckUnlink(_rs) \
64  ((rpmSyck)rpmioUnlinkPoolItem((rpmioItem)(_rs), __FUNCTION__, __FILE__, __LINE__))
65 
71 /*@unused@*/ /*@newref@*/ /*@null@*/
72 rpmSyck rpmSyckLink (/*@null@*/ rpmSyck rs)
73  /*@modifies rs @*/;
74 #define rpmSyckLink(_rs) \
75  ((rpmSyck)rpmioLinkPoolItem((rpmioItem)(_rs), __FUNCTION__, __FILE__, __LINE__))
76 
82 /*@null@*/
83 rpmSyck rpmSyckFree( /*@only@*/ rpmSyck rs)
84  /*@modifies rs @*/;
85 #define rpmSyckFree(_rs) \
86  ((rpmSyck)rpmioFreePoolItem((rpmioItem)(_rs), __FUNCTION__, __FILE__, __LINE__))
87 
88 #endif
89 
90 #endif /* H_RPMSYCK */
Hash table implemenation.
const char const bson * key
Definition: mongo.h:717
const char char type
Definition: bson.h:908