createrepo_c library
C library for metadata manipulation
src/package.h
00001 /* createrepo_c - Library of routines for manipulation with repodata
00002  * Copyright (C) 2012  Tomas Mlcoch
00003  * Copyright (C) 2007  James Bowes
00004  * Copyright (C) 2006  Seth Vidal
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
00019  * USA.
00020  */
00021 
00022 #ifndef __C_CREATEREPOLIB_PACKAGE_H__
00023 #define __C_CREATEREPOLIB_PACKAGE_H__
00024 
00025 #ifdef __cplusplus
00026 extern "C" {
00027 #endif
00028 
00029 #include <glib.h>
00030 
00037 typedef struct {
00038     char *name;                 
00039     char *flags;                
00041     char *epoch;                
00042     char *version;              
00043     char *release;              
00044     gboolean pre;               
00045 } cr_Dependency;
00046 
00050 typedef struct {
00051     char *type;                 
00052     char *path;                 
00053     char *name;                 
00054 } cr_PackageFile;
00055 
00059 typedef struct {
00060     char *author;               
00061     gint64 date;                
00062     char *changelog;            
00063 } cr_ChangelogEntry;
00064 
00068 typedef struct {
00069     gint64 pkgKey;              
00070     char *pkgId;                
00071     char *name;                 
00072     char *arch;                 
00073     char *version;              
00074     char *epoch;                
00075     char *release;              
00076     char *summary;              
00077     char *description;          
00078     char *url;                  
00079     gint64 time_file;           
00080     gint64 time_build;          
00081     char *rpm_license;          
00082     char *rpm_vendor;           
00083     char *rpm_group;            
00085     char *rpm_buildhost;        
00087     char *rpm_sourcerpm;        
00088     gint64 rpm_header_start;    
00089     gint64 rpm_header_end;      
00090     char *rpm_packager;         
00091     gint64 size_package;        
00092     gint64 size_installed;      
00093     gint64 size_archive;        
00095     char *location_href;        
00096     char *location_base;        
00097     char *checksum_type;        
00100     GSList *requires;           
00101     GSList *provides;           
00102     GSList *conflicts;          
00103     GSList *obsoletes;          
00105     GSList *files;              
00107     GSList *changelogs;         
00110     GStringChunk *chunk;        
00112 } cr_Package;
00113 
00114 typedef void (*cr_PackageFn) (cr_Package *pkg, gpointer data);
00115 
00120 cr_Dependency *cr_dependency_new(void);
00121 
00126 cr_PackageFile *cr_package_file_new(void);
00127 
00132 cr_ChangelogEntry *cr_changelog_entry_new(void);
00133 
00138 cr_Package *cr_package_new(void);
00139 
00144 cr_Package *cr_package_new_without_chunk(void);
00145 
00150 void cr_package_free(cr_Package *package);
00151 
00157 gchar *cr_package_nvra(cr_Package *package);
00158 
00159 #ifdef __cplusplus
00160 }
00161 #endif
00162 
00163 #endif /* __C_CREATEREPOLIB_PACKAGE_H__ */