createrepo_c library
C library for metadata manipulation
|
00001 /* createrepo_c - Library of routines for manipulation with repodata 00002 * Copyright (C) 2012 Tomas Mlcoch 00003 * 00004 * This program is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU General Public License 00006 * as published by the Free Software Foundation; either version 2 00007 * of the License, or (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 00017 * USA. 00018 */ 00019 00020 #ifndef __C_CREATEREPOLIB_REPOMD_H__ 00021 #define __C_CREATEREPOLIB_REPOMD_H__ 00022 00023 #ifdef __cplusplus 00024 extern "C" { 00025 #endif 00026 00027 #include "compression_wrapper.h" 00028 #include "package.h" 00029 00036 typedef struct _cr_RepomdRecord * cr_RepomdRecord; 00037 00041 typedef struct _cr_Repomd * cr_Repomd; 00042 00046 struct _cr_RepomdRecord { 00047 char *location_real; 00048 char *location_href; 00049 char *checksum; 00050 char *checksum_type; 00051 char *checksum_open; 00052 char *checksum_open_type; 00053 long timestamp; 00054 long size; 00055 long size_open; 00056 int db_ver; 00058 GStringChunk *chunk; 00059 }; 00060 00064 struct _cr_Repomd { 00065 cr_RepomdRecord pri_xml; 00066 cr_RepomdRecord fil_xml; 00067 cr_RepomdRecord oth_xml; 00068 cr_RepomdRecord pri_sql; 00069 cr_RepomdRecord fil_sql; 00070 cr_RepomdRecord oth_sql; 00071 cr_RepomdRecord groupfile; 00072 cr_RepomdRecord cgroupfile; 00073 cr_RepomdRecord updateinfo; 00074 cr_RepomdRecord pkgorigins; 00075 GSList *repo_tags; 00076 GSList *distro_tags; 00077 GSList *content_tags; 00078 gchar *revision; 00079 }; 00080 00084 typedef enum { 00085 CR_MD_PRIMARY_XML, 00086 CR_MD_FILELISTS_XML, 00087 CR_MD_OTHER_XML, 00088 CR_MD_PRIMARY_SQLITE, 00089 CR_MD_FILELISTS_SQLITE, 00090 CR_MD_OTHER_SQLITE, 00091 CR_MD_GROUPFILE, 00092 CR_MD_COMPRESSED_GROUPFILE, 00093 CR_MD_UPDATEINFO, 00094 CR_MD_PKGORIGINS 00095 } cr_RepomdRecordType; 00096 00101 cr_RepomdRecord cr_new_repomdrecord(const char *path); 00102 00109 void cr_free_repomdrecord(cr_RepomdRecord record); 00110 00118 int cr_fill_repomdrecord(cr_RepomdRecord record, 00119 cr_ChecksumType checksum_type); 00120 00132 void cr_process_groupfile_repomdrecord(cr_RepomdRecord groupfile, 00133 cr_RepomdRecord compressed_groupfile, 00134 cr_ChecksumType checksum_type, 00135 cr_CompressionType compression); 00136 00141 void cr_rename_repomdrecord_file(cr_RepomdRecord record); 00142 00146 cr_Repomd cr_new_repomd(); 00147 00154 void cr_repomd_set_record(cr_Repomd repomd, 00155 cr_RepomdRecord record, 00156 cr_RepomdRecordType type); 00157 00163 void cr_repomd_set_revision(cr_Repomd repomd, const char *revision); 00164 00171 void cr_repomd_add_distro_tag(cr_Repomd repomd, 00172 const char *cpeid, 00173 const char *tag); 00174 00180 void cr_repomd_add_repo_tag(cr_Repomd repomd, const char *tag); 00181 00187 void cr_repomd_add_content_tag(cr_Repomd repomd, const char *tag); 00188 00193 void cr_free_repomd(cr_Repomd repomd); 00194 00195 00201 gchar *cr_generate_repomd_xml(cr_Repomd repomd); 00202 00203 #ifdef __cplusplus 00204 } 00205 #endif 00206 00207 #endif /* __C_CREATEREPOLIB_REPOMD_H__ */