createrepo_c library 1.2.1 C library for metadata manipulation

load_metadata.h
1 /* createrepo_c - Library of routines for manipulation with repodata
2 * Copyright (C) 2012 Tomas Mlcoch
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
17 * USA.
18 */
19
20 #ifndef __C_CREATEREPOLIB_LOAD_METADATA_H__
21 #define __C_CREATEREPOLIB_LOAD_METADATA_H__
22
23 #include <glib.h>
24 #include "locate_metadata.h"
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29
59 typedef enum {
60 CR_HT_KEY_DEFAULT,
61 CR_HT_KEY_HASH = CR_HT_KEY_DEFAULT,
62 CR_HT_KEY_NAME,
63 CR_HT_KEY_FILENAME,
65 CR_HT_KEY_HREF,
66 CR_HT_KEY_SENTINEL,
67 } cr_HashTableKey;
68
75 typedef enum {
76 CR_HT_DUPACT_KEEPFIRST = 0,
78 CR_HT_DUPACT_REMOVEALL,
80 CR_HT_DUPACT_SENTINEL,
82 } cr_HashTableKeyDupAction;
83
86 typedef struct _cr_Metadata cr_Metadata;
87
92 cr_HashTableKey cr_metadata_key(cr_Metadata *md);
93
98 GHashTable *cr_metadata_hashtable(cr_Metadata *md);
99
114 cr_Metadata *cr_metadata_new(cr_HashTableKey key,
115 int use_single_chunk,
116 GSList *pkglist);
117
120 gboolean
121 cr_metadata_set_dupaction(cr_Metadata *md, cr_HashTableKeyDupAction dupaction);
122
126 void cr_metadata_free(cr_Metadata *md);
127
134 int cr_metadata_load_xml(cr_Metadata *md,
135 struct cr_MetadataLocation *ml,
136 GError **err);
137
144 int cr_metadata_locate_and_load_xml(cr_Metadata *md,
145 const char *repopath,
146 GError **err);
147
150 #ifdef __cplusplus
151 }
152 #endif
153
154 #endif /* __C_CREATEREPOLIB_LOAD_METADATA_H__ */
cr_Metadata
struct _cr_Metadata cr_Metadata
Definition: load_metadata.h:86
cr_metadata_key
cr_HashTableKey cr_metadata_key(cr_Metadata *md)
cr_metadata_hashtable
GHashTable * cr_metadata_hashtable(cr_Metadata *md)
cr_metadata_free
void cr_metadata_free(cr_Metadata *md)
cr_metadata_new
cr_Metadata * cr_metadata_new(cr_HashTableKey key, int use_single_chunk, GSList *pkglist)
CR_HT_KEY_NAME
@ CR_HT_KEY_NAME
Definition: load_metadata.h:62
CR_HT_DUPACT_REMOVEALL
@ CR_HT_DUPACT_REMOVEALL
Definition: load_metadata.h:78
cr_metadata_locate_and_load_xml
int cr_metadata_locate_and_load_xml(cr_Metadata *md, const char *repopath, GError **err)
cr_MetadataLocation
Definition: locate_metadata.h:37
CR_HT_DUPACT_KEEPFIRST
@ CR_HT_DUPACT_KEEPFIRST
Definition: load_metadata.h:76
CR_HT_DUPACT_SENTINEL
@ CR_HT_DUPACT_SENTINEL
Definition: load_metadata.h:80
CR_HT_KEY_HREF
@ CR_HT_KEY_HREF
Definition: load_metadata.h:65
cr_metadata_load_xml
int cr_metadata_load_xml(cr_Metadata *md, struct cr_MetadataLocation *ml, GError **err)
CR_HT_KEY_SENTINEL
@ CR_HT_KEY_SENTINEL
Definition: load_metadata.h:66
cr_HashTableKeyDupAction
cr_HashTableKeyDupAction
Definition: load_metadata.h:75
CR_HT_KEY_DEFAULT
@ CR_HT_KEY_DEFAULT
Definition: load_metadata.h:60
cr_HashTableKey
cr_HashTableKey
Definition: load_metadata.h:59
cr_metadata_set_dupaction
gboolean cr_metadata_set_dupaction(cr_Metadata *md, cr_HashTableKeyDupAction dupaction)
CR_HT_KEY_HASH
@ CR_HT_KEY_HASH
Definition: load_metadata.h:61
CR_HT_KEY_FILENAME
@ CR_HT_KEY_FILENAME
Definition: load_metadata.h:63