createrepo_c library  0.1.16
C library for metadata manipulation
 Vše Třídy Funkce Proměnné Definice typů Výčty Hodnoty výčtu Skupiny Stránky
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 {
66 
68 #define cr_metadata_key(X) ((X)->key)
69 
70 #define cr_metadata_hashtable(X) ((X)->ht)
71 
72 #define cr_metadata_chunk(X) ((X)->chunk)
73 
76 struct _cr_Metadata {
78  GHashTable *ht;
79  GStringChunk *chunk;
80  GHashTable *pkglist_ht;
81 };
82 
85 typedef struct _cr_Metadata *cr_Metadata;
86 
87 #define CR_LOAD_METADATA_OK 0
88 #define CR_LOAD_METADATA_ERR 1
104 cr_Metadata cr_metadata_new(cr_HashTableKey key,
105  int use_single_chunk,
106  GSList *pkglist);
107 
111 void cr_metadata_free(cr_Metadata md);
112 
118 int cr_metadata_load_xml(cr_Metadata md,
119  struct cr_MetadataLocation *ml);
120 
126 int cr_metadata_locate_and_load_xml(cr_Metadata md,
127  const char *repopath);
128 
131 #ifdef __cplusplus
132 }
133 #endif
134 
135 #endif /* __C_CREATEREPOLIB_LOAD_METADATA_H__ */