Commit 70388ef3 authored by Bernhard Link's avatar Bernhard Link

renamed target to struct target

parent c28807eb
...@@ -346,7 +346,7 @@ retvalue binaries_findnew(packagesdb pkgs,const char *component,const char *pack ...@@ -346,7 +346,7 @@ retvalue binaries_findnew(packagesdb pkgs,const char *component,const char *pack
return chunk_foreach(packages_file,processbinary,&mydata,force,0); return chunk_foreach(packages_file,processbinary,&mydata,force,0);
} }
retvalue binaries_getname(target t,const char *control,char **packagename){ retvalue binaries_getname(struct target *t,const char *control,char **packagename){
retvalue r; retvalue r;
r = chunk_getvalue(control,"Package",packagename); r = chunk_getvalue(control,"Package",packagename);
...@@ -358,7 +358,7 @@ retvalue binaries_getname(target t,const char *control,char **packagename){ ...@@ -358,7 +358,7 @@ retvalue binaries_getname(target t,const char *control,char **packagename){
} }
return r; return r;
} }
retvalue binaries_getversion(target t,const char *control,char **version) { retvalue binaries_getversion(struct target *t,const char *control,char **version) {
retvalue r; retvalue r;
r = chunk_getvalue(control,"Version",version); r = chunk_getvalue(control,"Version",version);
...@@ -371,7 +371,7 @@ retvalue binaries_getversion(target t,const char *control,char **version) { ...@@ -371,7 +371,7 @@ retvalue binaries_getversion(target t,const char *control,char **version) {
return r; return r;
} }
retvalue binaries_getinstalldata(target t,const char *packagename,const char *version,const char *chunk,char **control,struct strlist *filekeys,struct strlist *md5sums,struct strlist *origfiles) { retvalue binaries_getinstalldata(struct target *t,const char *packagename,const char *version,const char *chunk,char **control,struct strlist *filekeys,struct strlist *md5sums,struct strlist *origfiles) {
char *sourcename,*basename; char *sourcename,*basename;
retvalue r; retvalue r;
...@@ -398,6 +398,6 @@ retvalue binaries_getinstalldata(target t,const char *packagename,const char *ve ...@@ -398,6 +398,6 @@ retvalue binaries_getinstalldata(target t,const char *packagename,const char *ve
return r; return r;
} }
retvalue binaries_getfilekeys(target t,const char *name,const char *chunk,struct strlist *filekeys) { retvalue binaries_getfilekeys(struct target *t,const char *name,const char *chunk,struct strlist *filekeys) {
return binaries_parse_getfilekeys(chunk,filekeys); return binaries_parse_getfilekeys(chunk,filekeys);
} }
...@@ -48,9 +48,9 @@ retvalue binaries_findnew( ...@@ -48,9 +48,9 @@ retvalue binaries_findnew(
); );
/* Functions for the target.h-stuff: */ /* Functions for the target.h-stuff: */
retvalue binaries_getname(target t,const char *chunk,char **packagename); retvalue binaries_getname(struct target *t,const char *chunk,char **packagename);
retvalue binaries_getversion(target t,const char *chunk,char **version); retvalue binaries_getversion(struct target *t,const char *chunk,char **version);
retvalue binaries_getinstalldata(target t,const char *packagename,const char *version,const char *chunk,char **control,struct strlist *filekeys,struct strlist *md5sums,struct strlist *origfiles); retvalue binaries_getinstalldata(struct target *t,const char *packagename,const char *version,const char *chunk,char **control,struct strlist *filekeys,struct strlist *md5sums,struct strlist *origfiles);
retvalue binaries_getfilekeys(target t,const char *name,const char *chunk,struct strlist *filekeys); retvalue binaries_getfilekeys(struct target *t,const char *name,const char *chunk,struct strlist *filekeys);
#endif #endif
...@@ -379,13 +379,13 @@ retvalue deb_add(const char *dbdir,DB *references,filesdb filesdb,const char *fo ...@@ -379,13 +379,13 @@ retvalue deb_add(const char *dbdir,DB *references,filesdb filesdb,const char *fo
result = RET_NOTHING; result = RET_NOTHING;
if( strcmp(pkg->architecture,"all") != 0 ) { if( strcmp(pkg->architecture,"all") != 0 ) {
target t = distribution_getpart(distribution,pkg->component,pkg->architecture); struct target *t = distribution_getpart(distribution,pkg->component,pkg->architecture);
r = target_initpackagesdb(t,dbdir,NULL); r = target_initpackagesdb(t,dbdir,NULL);
if( !RET_WAS_ERROR(r) ) if( !RET_WAS_ERROR(r) )
r = target_addpackage(t,references,NULL,pkg->package,pkg->version,pkg->control,&pkg->filekeys,NULL,force,0); r = target_addpackage(t,references,NULL,pkg->package,pkg->version,pkg->control,&pkg->filekeys,NULL,force,0);
RET_UPDATE(result,r); RET_UPDATE(result,r);
} else for( i = 0 ; i < distribution->architectures.count ; i++ ) { } else for( i = 0 ; i < distribution->architectures.count ; i++ ) {
target t = distribution_getpart(distribution,pkg->component,distribution->architectures.values[i]); struct target *t = distribution_getpart(distribution,pkg->component,distribution->architectures.values[i]);
r = target_initpackagesdb(t,dbdir,NULL); r = target_initpackagesdb(t,dbdir,NULL);
if( !RET_WAS_ERROR(r) ) if( !RET_WAS_ERROR(r) )
r = target_addpackage(t,references,NULL,pkg->package,pkg->version,pkg->control,&pkg->filekeys,NULL,force,0); r = target_addpackage(t,references,NULL,pkg->package,pkg->version,pkg->control,&pkg->filekeys,NULL,force,0);
......
...@@ -446,7 +446,7 @@ retvalue dsc_add(const char *dbdir,DB *references,filesdb filesdb,const char *fo ...@@ -446,7 +446,7 @@ retvalue dsc_add(const char *dbdir,DB *references,filesdb filesdb,const char *fo
/* finaly put it into the source distribution */ /* finaly put it into the source distribution */
if( !RET_WAS_ERROR(r) ) { if( !RET_WAS_ERROR(r) ) {
target t = distribution_getpart(distribution,pkg->component,"source"); struct target *t = distribution_getpart(distribution,pkg->component,"source");
r = target_initpackagesdb(t,dbdir,NULL); r = target_initpackagesdb(t,dbdir,NULL);
if( !RET_WAS_ERROR(r) ) if( !RET_WAS_ERROR(r) )
r = target_addpackage(t,references,NULL,pkg->package,pkg->version,pkg->control,&pkg->filekeys,NULL,force,0); r = target_addpackage(t,references,NULL,pkg->package,pkg->version,pkg->control,&pkg->filekeys,NULL,force,0);
......
...@@ -50,7 +50,7 @@ void distribution_free(struct distribution *distribution) { ...@@ -50,7 +50,7 @@ void distribution_free(struct distribution *distribution) {
strlist_done(&distribution->updates); strlist_done(&distribution->updates);
while( distribution->targets ) { while( distribution->targets ) {
target next = distribution->targets->next; struct target *next = distribution->targets->next;
target_free(distribution->targets); target_free(distribution->targets);
distribution->targets = next; distribution->targets = next;
...@@ -64,8 +64,8 @@ static retvalue createtargets(struct distribution *distribution) { ...@@ -64,8 +64,8 @@ static retvalue createtargets(struct distribution *distribution) {
retvalue r; retvalue r;
int i,j; int i,j;
const char *arch,*comp; const char *arch,*comp;
target t; struct target *t;
target last = NULL; struct target *last = NULL;
for( i = 0 ; i < distribution->components.count ; i++ ) { for( i = 0 ; i < distribution->components.count ; i++ ) {
comp = distribution->components.values[i]; comp = distribution->components.values[i];
...@@ -167,7 +167,7 @@ static retvalue distribution_parse_and_filter(struct distribution **distribution ...@@ -167,7 +167,7 @@ static retvalue distribution_parse_and_filter(struct distribution **distribution
/* call <action> for each part of <distribution>. */ /* call <action> for each part of <distribution>. */
retvalue distribution_foreach_part(const struct distribution *distribution,distribution_each_action action,void *data,int force) { retvalue distribution_foreach_part(const struct distribution *distribution,distribution_each_action action,void *data,int force) {
retvalue result,r; retvalue result,r;
target t; struct target *t;
result = RET_NOTHING; result = RET_NOTHING;
for( t = distribution->targets ; t ; t = t->next ) { for( t = distribution->targets ; t ; t = t->next ) {
...@@ -179,8 +179,8 @@ retvalue distribution_foreach_part(const struct distribution *distribution,distr ...@@ -179,8 +179,8 @@ retvalue distribution_foreach_part(const struct distribution *distribution,distr
return result; return result;
} }
target distribution_getpart(const struct distribution *distribution,const char *component,const char *architecture) { struct target *distribution_getpart(const struct distribution *distribution,const char *component,const char *architecture) {
target t = distribution->targets; struct target *t = distribution->targets;
while( t && ( strcmp(t->component,component) != 0 || strcmp(t->architecture,architecture) )) { while( t && ( strcmp(t->component,component) != 0 || strcmp(t->architecture,architecture) )) {
t = t->next; t = t->next;
......
...@@ -18,19 +18,19 @@ struct distribution { ...@@ -18,19 +18,19 @@ struct distribution {
char *origin,*label,*description; char *origin,*label,*description;
struct strlist architectures,components,updates; struct strlist architectures,components,updates;
/* A list of all targets contained in the distribution*/ /* A list of all targets contained in the distribution*/
target targets; struct target *targets;
}; };
retvalue distribution_get(struct distribution **distribution,const char *conf,const char *name); retvalue distribution_get(struct distribution **distribution,const char *conf,const char *name);
void distribution_free(struct distribution *distribution); void distribution_free(struct distribution *distribution);
typedef retvalue distribution_each_action(void *data, const target t); typedef retvalue distribution_each_action(void *data, struct target *t);
/* call <action> for each part of <distribution>. */ /* call <action> for each part of <distribution>. */
retvalue distribution_foreach_part(const struct distribution *distribution,distribution_each_action action,void *data,int force); retvalue distribution_foreach_part(const struct distribution *distribution,distribution_each_action action,void *data,int force);
target distribution_getpart(const struct distribution *distribution,const char *component,const char *architecture); struct target *distribution_getpart(const struct distribution *distribution,const char *component,const char *architecture);
typedef retvalue distributionaction(void *data,const char *chunk,const struct distribution *distribution); typedef retvalue distributionaction(void *data,const char *chunk,const struct distribution *distribution);
......
...@@ -688,7 +688,7 @@ static int checkrelease(int argc,char *argv[]) { ...@@ -688,7 +688,7 @@ static int checkrelease(int argc,char *argv[]) {
struct data_export { const struct distribution *distribution;int force;}; struct data_export { const struct distribution *distribution;int force;};
static retvalue exportbinsrc(void *data,const target target) { static retvalue exportbinsrc(void *data,struct target *target) {
retvalue result,r; retvalue result,r;
struct data_export *d = data; struct data_export *d = data;
...@@ -795,7 +795,7 @@ static int upgrade(int argc,char *argv[]) { ...@@ -795,7 +795,7 @@ static int upgrade(int argc,char *argv[]) {
retvalue result,r; retvalue result,r;
upgradelist upgrade; upgradelist upgrade;
filesdb files; filesdb files;
target target; struct target *target;
if( argc <=1 ) { if( argc <=1 ) {
fprintf(stderr,"mirrorer upgrade [<distributions>]\n"); fprintf(stderr,"mirrorer upgrade [<distributions>]\n");
...@@ -837,7 +837,7 @@ static int upgrade(int argc,char *argv[]) { ...@@ -837,7 +837,7 @@ static int upgrade(int argc,char *argv[]) {
/***********************rereferencing*************************/ /***********************rereferencing*************************/
struct data_binsrcreref { const struct distribution *distribution; DB *references;}; struct data_binsrcreref { const struct distribution *distribution; DB *references;};
static retvalue reref(void *data,const target target) { static retvalue reref(void *data,struct target *target) {
retvalue result; retvalue result;
struct data_binsrcreref *d = data; struct data_binsrcreref *d = data;
...@@ -887,7 +887,7 @@ static int rereference(int argc,char *argv[]) { ...@@ -887,7 +887,7 @@ static int rereference(int argc,char *argv[]) {
/***********************checking*************************/ /***********************checking*************************/
struct data_check { const struct distribution *distribution; DB *references; filesdb files;}; struct data_check { const struct distribution *distribution; DB *references; filesdb files;};
static retvalue check_target(void *data,const target target) { static retvalue check_target(void *data,struct target *target) {
struct data_check *d = data; struct data_check *d = data;
retvalue r; retvalue r;
......
...@@ -188,7 +188,7 @@ retvalue release_checkfile(const char *releasefile,const char *nametocheck,const ...@@ -188,7 +188,7 @@ retvalue release_checkfile(const char *releasefile,const char *nametocheck,const
} }
/* Generate a "Release"-file for arbitrary directory */ /* Generate a "Release"-file for arbitrary directory */
retvalue release_genrelease(const struct distribution *distribution,const target target,const char *distdir) { retvalue release_genrelease(const struct distribution *distribution,const struct target *target,const char *distdir) {
FILE *f; FILE *f;
char *filename; char *filename;
int e; int e;
...@@ -228,7 +228,7 @@ retvalue release_genrelease(const struct distribution *distribution,const target ...@@ -228,7 +228,7 @@ retvalue release_genrelease(const struct distribution *distribution,const target
struct genrel { FILE *f; const char *distdir; int force; }; struct genrel { FILE *f; const char *distdir; int force; };
static retvalue printmd5(void *data,const target target) { static retvalue printmd5(void *data,struct target *target) {
struct genrel *d = data; struct genrel *d = data;
return target_printmd5sums(target,d->distdir,d->f,d->force); return target_printmd5sums(target,d->distdir,d->f,d->force);
......
...@@ -33,7 +33,7 @@ retvalue release_checkfile(const char *releasefile,const char *nametocheck,const ...@@ -33,7 +33,7 @@ retvalue release_checkfile(const char *releasefile,const char *nametocheck,const
/****** Generate release-files *************/ /****** Generate release-files *************/
/* Generate a "Release"-file for an arbitrary directory */ /* Generate a "Release"-file for an arbitrary directory */
retvalue release_genrelease(const struct distribution *distribution,const target target,const char *distdir); retvalue release_genrelease(const struct distribution *distribution,const struct target *target,const char *distdir);
/* Generate a main "Release" file for a distribution */ /* Generate a main "Release" file for a distribution */
retvalue release_gen(const struct distribution *distribution,const char *distdir,const char *chunk,int force); retvalue release_gen(const struct distribution *distribution,const char *distdir,const char *chunk,int force);
......
...@@ -502,7 +502,7 @@ retvalue sources_calcfilelines(const struct strlist *basenames,const struct strl ...@@ -502,7 +502,7 @@ retvalue sources_calcfilelines(const struct strlist *basenames,const struct strl
return RET_OK; return RET_OK;
} }
retvalue sources_getname(target t,const char *control,char **packagename){ retvalue sources_getname(struct target *t,const char *control,char **packagename){
retvalue r; retvalue r;
r = chunk_getvalue(control,"Package",packagename); r = chunk_getvalue(control,"Package",packagename);
...@@ -514,7 +514,7 @@ retvalue sources_getname(target t,const char *control,char **packagename){ ...@@ -514,7 +514,7 @@ retvalue sources_getname(target t,const char *control,char **packagename){
} }
return r; return r;
} }
retvalue sources_getversion(target t,const char *control,char **version) { retvalue sources_getversion(struct target *t,const char *control,char **version) {
retvalue r; retvalue r;
r = chunk_getvalue(control,"Version",version); r = chunk_getvalue(control,"Version",version);
...@@ -527,7 +527,7 @@ retvalue sources_getversion(target t,const char *control,char **version) { ...@@ -527,7 +527,7 @@ retvalue sources_getversion(target t,const char *control,char **version) {
return r; return r;
} }
retvalue sources_getinstalldata(target t,const char *packagename,const char *version,const char *chunk,char **control,struct strlist *filekeys,struct strlist *md5sums,struct strlist *origfiles) { retvalue sources_getinstalldata(struct target *t,const char *packagename,const char *version,const char *chunk,char **control,struct strlist *filekeys,struct strlist *md5sums,struct strlist *origfiles) {
retvalue r; retvalue r;
char *origdirectory; char *origdirectory;
struct strlist filelines,basenames; struct strlist filelines,basenames;
...@@ -562,6 +562,6 @@ retvalue sources_getinstalldata(target t,const char *packagename,const char *ver ...@@ -562,6 +562,6 @@ retvalue sources_getinstalldata(target t,const char *packagename,const char *ver
return r; return r;
} }
retvalue sources_getfilekeys(target t,const char *name,const char *chunk,struct strlist *filekeys) { retvalue sources_getfilekeys(struct target *t,const char *name,const char *chunk,struct strlist *filekeys) {
return sources_parse_getfilekeys(chunk,filekeys); return sources_parse_getfilekeys(chunk,filekeys);
} }
...@@ -37,8 +37,8 @@ retvalue sources_findnew(packagesdb pkgs,const char *component,const char *sourc ...@@ -37,8 +37,8 @@ retvalue sources_findnew(packagesdb pkgs,const char *component,const char *sourc
retvalue sources_calcfilelines(const struct strlist *basenames,const struct strlist *md5sums,char **item); retvalue sources_calcfilelines(const struct strlist *basenames,const struct strlist *md5sums,char **item);
/* Functions for the target.h-stuff: */ /* Functions for the target.h-stuff: */
retvalue sources_getname(target t,const char *chunk,char **packagename); retvalue sources_getname(struct target * t,const char *chunk,char **packagename);
retvalue sources_getversion(target ,const char *chunk,char **version); retvalue sources_getversion(struct target *t,const char *chunk,char **version);
retvalue sources_getinstalldata(target t,const char *packagename,const char *version,const char *chunk,char **control,struct strlist *filekeys,struct strlist *md5sums,struct strlist *origfiles); retvalue sources_getinstalldata(struct target *t,const char *packagename,const char *version,const char *chunk,char **control,struct strlist *filekeys,struct strlist *md5sums,struct strlist *origfiles);
retvalue sources_getfilekeys(target t,const char *name,const char *chunk,struct strlist *filekeys); retvalue sources_getfilekeys(struct target *t,const char *name,const char *chunk,struct strlist *filekeys);
#endif #endif
...@@ -41,15 +41,15 @@ extern int verbose; ...@@ -41,15 +41,15 @@ extern int verbose;
static retvalue target_initialize( static retvalue target_initialize(
const char *codename,const char *component,const char *architecture, const char *codename,const char *component,const char *architecture,
get_name getname,get_version getversion,get_installdata getinstalldata, get_name getname,get_version getversion,get_installdata getinstalldata,
get_filekeys getfilekeys, char *directory, const char *indexfile, int unc , target *d) { get_filekeys getfilekeys, char *directory, const char *indexfile, int unc ,struct target **d) {
target t; struct target *t;
assert(indexfile); assert(indexfile);
if( directory == NULL ) if( directory == NULL )
return RET_ERROR_OOM; return RET_ERROR_OOM;
t = calloc(1,sizeof(struct s_target)); t = calloc(1,sizeof(struct target));
if( t == NULL ) { if( t == NULL ) {
free(directory); free(directory);
return RET_ERROR_OOM; return RET_ERROR_OOM;
...@@ -76,16 +76,16 @@ static retvalue target_initialize( ...@@ -76,16 +76,16 @@ static retvalue target_initialize(
return RET_OK; return RET_OK;
} }
retvalue target_initialize_binary(const char *codename,const char *component,const char *architecture,target *target) { retvalue target_initialize_binary(const char *codename,const char *component,const char *architecture,struct target **target) {
return target_initialize(codename,component,architecture,binaries_getname,binaries_getversion,binaries_getinstalldata,binaries_getfilekeys,mprintf("%s/%s/binary-%s",codename,component,architecture),"Packages",1,target); return target_initialize(codename,component,architecture,binaries_getname,binaries_getversion,binaries_getinstalldata,binaries_getfilekeys,mprintf("%s/%s/binary-%s",codename,component,architecture),"Packages",1,target);
} }
retvalue target_initialize_source(const char *codename,const char *component,target *target) { retvalue target_initialize_source(const char *codename,const char *component,struct target **target) {
return target_initialize(codename,component,"source",sources_getname,sources_getversion,sources_getinstalldata,sources_getfilekeys,mprintf("%s/%s/source",codename,component),"Sources",0,target); return target_initialize(codename,component,"source",sources_getname,sources_getversion,sources_getinstalldata,sources_getfilekeys,mprintf("%s/%s/source",codename,component),"Sources",0,target);
} }
void target_free(target target) { void target_free(struct target *target) {
if( target == NULL ) if( target == NULL )
return; return;
free(target->codename); free(target->codename);
...@@ -97,7 +97,7 @@ void target_free(target target) { ...@@ -97,7 +97,7 @@ void target_free(target target) {
} }
/* This opens up the database, if db != NULL, *db will be set to it.. */ /* This opens up the database, if db != NULL, *db will be set to it.. */
retvalue target_initpackagesdb(target target, const char *dbdir, packagesdb *db) { retvalue target_initpackagesdb(struct target *target, const char *dbdir, packagesdb *db) {
retvalue r; retvalue r;
if( target->packages != NULL ) if( target->packages != NULL )
...@@ -114,7 +114,7 @@ retvalue target_initpackagesdb(target target, const char *dbdir, packagesdb *db) ...@@ -114,7 +114,7 @@ retvalue target_initpackagesdb(target target, const char *dbdir, packagesdb *db)
return r; return r;
} }
retvalue target_addpackage(target target,DB *references,filesdb files,const char *name,const char *version,const char *control,const struct strlist *filekeys,const struct strlist *md5sums,int force,int downgrade) { retvalue target_addpackage(struct target *target,DB *references,filesdb files,const char *name,const char *version,const char *control,const struct strlist *filekeys,const struct strlist *md5sums,int force,int downgrade) {
struct strlist oldfilekeys,*ofk; struct strlist oldfilekeys,*ofk;
char *oldcontrol; char *oldcontrol;
retvalue r; retvalue r;
...@@ -183,7 +183,7 @@ retvalue target_addpackage(target target,DB *references,filesdb files,const char ...@@ -183,7 +183,7 @@ retvalue target_addpackage(target target,DB *references,filesdb files,const char
/* rereference a full database */ /* rereference a full database */
struct data_reref { struct data_reref {
DB *referencesdb; DB *referencesdb;
target target; struct target *target;
}; };
static retvalue rereferencepkg(void *data,const char *package,const char *chunk) { static retvalue rereferencepkg(void *data,const char *package,const char *chunk) {
...@@ -204,7 +204,7 @@ static retvalue rereferencepkg(void *data,const char *package,const char *chunk) ...@@ -204,7 +204,7 @@ static retvalue rereferencepkg(void *data,const char *package,const char *chunk)
return r; return r;
} }
retvalue target_rereference(target target,DB *referencesdb,int force) { retvalue target_rereference(struct target *target,DB *referencesdb,int force) {
retvalue result,r; retvalue result,r;
struct data_reref refdata; struct data_reref refdata;
...@@ -234,7 +234,7 @@ retvalue target_rereference(target target,DB *referencesdb,int force) { ...@@ -234,7 +234,7 @@ retvalue target_rereference(target target,DB *referencesdb,int force) {
struct data_check { struct data_check {
DB *referencesdb; DB *referencesdb;
filesdb filesdb; filesdb filesdb;
target target; struct target *target;
}; };
static retvalue checkpkg(void *data,const char *package,const char *chunk) { static retvalue checkpkg(void *data,const char *package,const char *chunk) {
...@@ -256,7 +256,7 @@ static retvalue checkpkg(void *data,const char *package,const char *chunk) { ...@@ -256,7 +256,7 @@ static retvalue checkpkg(void *data,const char *package,const char *chunk) {
return r; return r;
} }
retvalue target_check(target target,filesdb filesdb,DB *referencesdb,int force) { retvalue target_check(struct target *target,filesdb filesdb,DB *referencesdb,int force) {
struct data_check data; struct data_check data;
assert(target->packages); assert(target->packages);
...@@ -269,7 +269,7 @@ retvalue target_check(target target,filesdb filesdb,DB *referencesdb,int force) ...@@ -269,7 +269,7 @@ retvalue target_check(target target,filesdb filesdb,DB *referencesdb,int force)
return packages_foreach(target->packages,checkpkg,&data,force); return packages_foreach(target->packages,checkpkg,&data,force);
} }
/* export a database */ /* export a database */
retvalue target_export(target target,const char *distdir,int force) { retvalue target_export(struct target *target,const char *distdir,int force) {
indexcompression compression; indexcompression compression;
retvalue result,r; retvalue result,r;
...@@ -294,7 +294,8 @@ retvalue target_export(target target,const char *distdir,int force) { ...@@ -294,7 +294,8 @@ retvalue target_export(target target,const char *distdir,int force) {
return result; return result;
} }
static inline retvalue printfilemd5(target target,const char *distdir,FILE *out, static inline retvalue printfilemd5(const struct target *target,
const char *distdir,FILE *out,
const char *filename,indexcompression compression) { const char *filename,indexcompression compression) {
char *fn,*md; char *fn,*md;
const char *fn2; const char *fn2;
...@@ -320,7 +321,7 @@ static inline retvalue printfilemd5(target target,const char *distdir,FILE *out, ...@@ -320,7 +321,7 @@ static inline retvalue printfilemd5(target target,const char *distdir,FILE *out,
return r; return r;
} }
retvalue target_printmd5sums(target target,const char *distdir,FILE *out,int force) { retvalue target_printmd5sums(const struct target *target,const char *distdir,FILE *out,int force) {
indexcompression compression; indexcompression compression;
retvalue result,r; retvalue result,r;
......
...@@ -11,14 +11,14 @@ ...@@ -11,14 +11,14 @@
#include "packages.h" #include "packages.h"
#endif #endif
typedef struct s_target *target; struct target;
typedef retvalue get_name(target,const char *,char **); typedef retvalue get_name(struct target *,const char *,char **);
typedef retvalue get_version(target,const char *,char **); typedef retvalue get_version(struct target *,const char *,char **);
typedef retvalue get_installdata(target,const char *,const char *,const char *,char **,struct strlist *,struct strlist *,struct strlist *); typedef retvalue get_installdata(struct target *,const char *,const char *,const char *,char **,struct strlist *,struct strlist *,struct strlist *);
typedef retvalue get_filekeys(target,const char *,const char *,struct strlist *); typedef retvalue get_filekeys(struct target *,const char *,const char *,struct strlist *);
struct s_target { struct target {
char *codename; char *codename;
char *component; char *component;
char *architecture; char *architecture;
...@@ -31,26 +31,26 @@ struct s_target { ...@@ -31,26 +31,26 @@ struct s_target {
get_installdata *getinstalldata; get_installdata *getinstalldata;
get_filekeys *getfilekeys; get_filekeys *getfilekeys;
/* the next one in the list of targets of a distribution */ /* the next one in the list of targets of a distribution */
struct s_target *next; struct target *next;
/* is initialized as soon as needed: */ /* is initialized as soon as needed: */
packagesdb packages; packagesdb packages;
}; };
retvalue target_initialize_binary(const char *codename,const char *component,const char *architecture,target *target); retvalue target_initialize_binary(const char *codename,const char *component,const char *architecture,struct target **target);
retvalue target_initialize_source(const char *codename,const char *component,target *target); retvalue target_initialize_source(const char *codename,const char *component,struct target **target);
void target_free(target target); void target_free(struct target *target);
retvalue target_printmd5sums(target target,const char *distdir,FILE *out,int force); retvalue target_printmd5sums(const struct target *target,const char *distdir,FILE *out,int force);
/* This opens up the database, if db != NULL, *db will be set to it.. */ /* This opens up the database, if db != NULL, *db will be set to it.. */
retvalue target_initpackagesdb(target target, const char *dbdir, packagesdb *db); retvalue target_initpackagesdb(struct target *target, const char *dbdir, packagesdb *db);
/* The following calls can only be called if target_initpackagesdb was called before: */ /* The following calls can only be called if target_initpackagesdb was called before: */
retvalue target_addpackage(target target,DB *references,filesdb files,const char *name,const char *version,const char *control,const struct strlist *filekeys,const struct strlist *md5sums,int force,int downgrade); retvalue target_addpackage(struct target *target,DB *references,filesdb files,const char *name,const char *version,const char *control,const struct strlist *filekeys,const struct strlist *md5sums,int force,int downgrade);
retvalue target_export(target target,const char *distdir, int force); retvalue target_export(struct target *target,const char *distdir, int force);
retvalue target_check(target target,filesdb filesdb,DB *referencesdb,int force); retvalue target_check(struct target *target,filesdb filesdb,DB *referencesdb,int force);
retvalue target_rereference(target target,DB *referencesdb,int force); retvalue target_rereference(struct target *target,DB *referencesdb,int force);
#endif #endif
...@@ -58,7 +58,7 @@ typedef struct s_package_data { ...@@ -58,7 +58,7 @@ typedef struct s_package_data {
struct s_upgradelist { struct s_upgradelist {
upgrade_decide_function *decide; upgrade_decide_function *decide;
target target; struct target *target;
package_data *list; package_data *list;
/* NULL or the last/next thing to test in alphabetical order */ /* NULL or the last/next thing to test in alphabetical order */
package_data *current,*last; package_data *current,*last;
...@@ -126,7 +126,7 @@ static retvalue save_package_version(void *d,const char *packagename,const char ...@@ -126,7 +126,7 @@ static retvalue save_package_version(void *d,const char *packagename,const char
} }
retvalue upgradelist_initialize(upgradelist *ul,target t,const char *dbdir,upgrade_decide_function *decide) { retvalue upgradelist_initialize(upgradelist *ul,struct target *t,const char *dbdir,upgrade_decide_function *decide) {
upgradelist upgrade; upgradelist upgrade;
packagesdb packages; packagesdb packages;
retvalue r; retvalue r;
......
...@@ -20,7 +20,7 @@ upgrade_decision ud_always(const char *p,const char *ov,const char *nv); ...@@ -20,7 +20,7 @@ upgrade_decision ud_always(const char *p,const char *ov,const char *nv);
typedef struct s_upgradelist *upgradelist; typedef struct s_upgradelist *upgradelist;
retvalue upgradelist_initialize(upgradelist *ul,target target,const char *dbdir,upgrade_decide_function *decide); retvalue upgradelist_initialize(upgradelist *ul,struct target *target,const char *dbdir,upgrade_decide_function *decide);
retvalue upgradelist_done(upgradelist upgrade); retvalue upgradelist_done(upgradelist upgrade);
retvalue upgradelist_dump(upgradelist upgrade); retvalue upgradelist_dump(upgradelist upgrade);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment