Commit 4978bd00 authored by Bernhard Link's avatar Bernhard Link

remove unused functions and prototypes

parent a3b01d0f
......@@ -114,7 +114,6 @@ void checksumsarray_resetunsupported(const struct checksumsarray *, bool[cs_hash
retvalue hashline_parse(const char * /*filenametoshow*/, const char * /*line*/, enum checksumtype, /*@out@*/const char ** /*basename_p*/, /*@out@*/struct hash_data *, /*@out@*/struct hash_data *);
struct configiterator;
retvalue checksums_parseignorelist(bool ignorelist[cs_hashCOUNT], const char *, struct configiterator *);
#ifdef CHECKSUMS_CONTEXT
#ifndef MD5_H
......
......@@ -121,29 +121,6 @@ retvalue chunk_getvalue(const char *chunk, const char *name, char **value) {
return RET_OK;
}
retvalue chunk_getfirstword(const char *chunk, const char *name, char **value) {
const char *field;
char *val;
const char *b, *e;
assert(value != NULL);
field = chunk_getfield(name, chunk);
if (field == NULL)
return RET_NOTHING;
b = field;
if (xisspace(*b))
b++;
e = b;
while (!xisspace(*e) && *e != '\n' && *e != '\0')
e++;
val = strndup(b, e - b);
if (FAILEDTOALLOC(val))
return RET_ERROR_OOM;
*value = val;
return RET_OK;
}
retvalue chunk_getextralinelist(const char *chunk, const char *name, struct strlist *strlist) {
retvalue r;
const char *f, *b, *e;
......
......@@ -11,7 +11,6 @@
/* look for name in chunk. returns RET_NOTHING if not found */
retvalue chunk_getvalue(const char *, const char *, /*@out@*/char **);
retvalue chunk_getfirstword(const char *, const char *, /*@out@*/char **);
retvalue chunk_getextralinelist(const char *, const char *, /*@out@*/struct strlist *);
retvalue chunk_getwordlist(const char *, const char *, /*@out@*/struct strlist *);
retvalue chunk_getuniqwordlist(const char *, const char *, /*@out@*/struct strlist *);
......@@ -51,9 +50,6 @@ void addfield_free(/*@only@*//*@null@*/struct fieldtoadd *);
/* that is chunk_replacefields(chunk,{fieldname,strlen,data,strlen},fieldname); */
/*@null@*/char *chunk_replacefield(const char *, const char *, const char *, bool /*maybemissing*/);
/* check if all field names are in allowedfieldnames */
retvalue chunk_checkfields(const char *, const char * const * /*allowedfieldnames*/, bool /*commentsallowed*/);
/* reformat control data, removing leading spaces and CRs */
size_t chunk_extract(char * /*buffer*/, const char */*start*/, /*@out@*/char ** /*next*/);
......
......@@ -114,8 +114,6 @@ retvalue distribution_get(struct distribution * /*all*/, const char *, bool /*lo
/* set lookedat, start logger, ... */
retvalue distribution_prepareforwriting(struct distribution *);
typedef retvalue distribution_each_action(void *, struct target *, struct distribution *);
typedef retvalue each_target_action(struct distribution *, struct target *, void *);
typedef retvalue each_package_action(struct distribution *, struct target *, const char *, const char *, void *);
......@@ -148,7 +146,6 @@ retvalue distribution_match(struct distribution * /*alldistributions*/, int /*ar
struct distribution *distribution_find(struct distribution *, const char *);
retvalue distribution_freelist(/*@only@*/struct distribution *distributions);
retvalue distribution_exportandfreelist(enum exportwhen when, /*@only@*/struct distribution *distributions);
retvalue distribution_exportlist(enum exportwhen when, /*@only@*/struct distribution *distributions);
retvalue distribution_loadalloverrides(struct distribution *);
......
......@@ -6,7 +6,6 @@
#endif
struct checksums;
retvalue donefile_isold(const char *filename, const struct checksums *expected);
struct markdonefile;
retvalue markdone_create(const char *, /*@out@*/struct markdonefile **);
......
......@@ -266,37 +266,6 @@ retvalue files_checkorimprove(const struct strlist *filekeys, struct checksums *
return RET_OK;
}
/* print missing files */
retvalue files_printmissing(const struct strlist *filekeys, const struct checksumsarray *origfiles) {
int i;
retvalue ret, r;
ret = RET_NOTHING;
assert (filekeys->count == origfiles->names.count);
for (i = 0 ; i < filekeys->count ; i++) {
const char *filekey = filekeys->values[i];
const char *origfile = origfiles->names.values[i];
const struct checksums *checksums = origfiles->checksums[i];
r = files_expect(filekey, checksums, false);
if (RET_WAS_ERROR(r)) {
return r;
}
if (r == RET_NOTHING) {
/* File missing */
(void)fputs(origfile, stdout);
(void)putchar(' ');
(void)fputs(global.outdir, stdout);
(void)putchar('/');
(void)fputs(filekey, stdout);
(void)putchar('\n');
RET_UPDATE(ret, RET_OK);
} else
RET_UPDATE(ret, r);
}
return ret;
}
/* dump out all information */
retvalue files_printmd5sums(void) {
retvalue result, r;
......
......@@ -31,9 +31,6 @@ retvalue files_expectfiles(const struct strlist *, struct checksums **);
/* check for several files in the database and update information */
retvalue files_checkorimprove(const struct strlist *, struct checksums **);
/* print missing files */
retvalue files_printmissing(const struct strlist *filekeys, const struct checksumsarray *);
/* what to do with files */
/* file should already be there, just make sure it is in the database */
#define D_INPLACE -1
......
......@@ -29,8 +29,6 @@ void logger_log(struct logger *, struct target *, const char * /*name*/, /*@null
bool logger_rerun_needs_target(const struct logger *, const struct target *);
retvalue logger_reruninfo(struct logger *, struct target *, const char * /*name*/, const char * /*version*/, const char * /*control*/, /*@null@*/const struct strlist * /*filekeys*/);
/* do work that is left */
retvalue logger_continue(struct logger *);
/* wait for all jobs to finish */
void logger_wait(void);
void logger_warn_waiting(void);
......
......@@ -63,7 +63,6 @@ retvalue cachedlists_scandir(/*@out@*/struct cachedlistfile **);
void cachedlistfile_need_index(struct cachedlistfile *, const char * /*repository*/, const char * /*suite*/, const char * /*architecture*/, const char * /*component*/, packagetype_t);
void cachedlistfile_need_flat_index(struct cachedlistfile *, const char * /*repository*/, const char * /*suite*/, packagetype_t);
void cachedlistfile_need(struct cachedlistfile *, const char * /*type*/, unsigned int /*count*/, ...) __attribute__((sentinel));
void cachedlistfile_flat_markneeded(struct cachedlistfile *, packagetype_t);
void cachedlistfile_freelist(/*@only@*/struct cachedlistfile *);
void cachedlistfile_deleteunneeded(const struct cachedlistfile *);
#endif
......@@ -9,9 +9,6 @@
#include "target.h"
#endif
/* Calculate the filelines in a form suitable for chunk_replacefields: */
retvalue sources_calcfilelines(const struct checksumsarray *, /*@out@*/char **item);
/* Functions for the target.h-stuff: */
get_version sources_getversion;
get_installdata sources_getinstalldata;
......
......@@ -196,26 +196,6 @@ retvalue strlist_fprint(FILE *file, const struct strlist *strlist) {
return result;
}
/* duplicate with content */
retvalue strlist_dup(struct strlist *dest, const struct strlist *orig) {
int i;
assert(dest != NULL && orig != NULL);
dest->size = dest->count = orig->count;
dest->values = nzNEW(dest->count, char *);
if (FAILEDTOALLOC(dest->values))
return RET_ERROR_OOM;
for (i = 0 ; i < dest->count ; i++) {
dest->values[i] = strdup(orig->values[i]);
if (FAILEDTOALLOC(dest->values[i])) {
strlist_done(dest);
return RET_ERROR_OOM;
}
}
return RET_OK;
}
/* replace the contents of dest with those from orig, which get emptied */
void strlist_move(struct strlist *dest, struct strlist *orig) {
......@@ -230,32 +210,6 @@ void strlist_move(struct strlist *dest, struct strlist *orig) {
orig->size = orig->count = 0;
orig->values = NULL;
}
/* empty orig and add everything to the end of dest, in case of error, nothing
* was done. */
retvalue strlist_mvadd(struct strlist *dest, struct strlist *orig) {
int i;
assert(dest != NULL && orig != NULL && dest != orig);
if (dest->count+orig->count >= dest->size) {
int newsize = dest->count+orig->count+8;
char **v = realloc(dest->values, newsize*sizeof(char *));
if (FAILEDTOALLOC(v)) {
return RET_ERROR_OOM;
}
dest->size = newsize;
dest->values = v;
}
for (i = 0 ; i < orig->count ; i++)
dest->values[dest->count+i] = orig->values[i];
dest->count += orig->count;
free(orig->values);
orig->size = orig->count = 0;
orig->values = NULL;
return RET_OK;
}
retvalue strlist_adduniq(struct strlist *strlist, char *element) {
// TODO: is there something better feasible?
......
......@@ -32,12 +32,8 @@ retvalue strlist_add_dup(struct strlist *strlist, const char *todup);
/* print a space separated list of elements */
retvalue strlist_fprint(FILE *, const struct strlist *);
/* duplicate with content */
retvalue strlist_dup(struct strlist * /*dest*/, const struct strlist * /*orig*/);
/* replace the contents of dest with those from orig, which get emptied */
void strlist_move(/*@out@*/struct strlist *dest, /*@special@*/struct strlist *orig) /*@releases orig->values @*/;
/* empty orig and add everything to the end of dest, on error nothing is freed */
retvalue strlist_mvadd(struct strlist *dest, /*@special@*/struct strlist *orig) /*@releases orig->values @*/;
bool strlist_in(const struct strlist *, const char *);
int strlist_ofs(const struct strlist *, const char *);
......
......@@ -598,24 +598,6 @@ retvalue upgradelist_deleteall(struct upgradelist *upgrade) {
return RET_OK;
}
retvalue upgradelist_listmissing(struct upgradelist *upgrade){
struct package_data *pkg;
for (pkg = upgrade->list ; pkg != NULL ; pkg = pkg->next) {
if (pkg->version == pkg->new_version) {
retvalue r;
r = files_printmissing(&pkg->new_filekeys,
&pkg->new_origfiles);
if (RET_WAS_ERROR(r))
return r;
}
}
return RET_OK;
}
/* request all wanted files in the downloadlists given before */
retvalue upgradelist_enqueue(struct upgradelist *upgrade, enqueueaction *action, void *calldata) {
struct package_data *pkg;
......@@ -774,8 +756,3 @@ void upgradelist_dump(struct upgradelist *upgrade, dumpaction action){
pkg->privdata);
}
}
/* standard answer function */
upgrade_decision ud_always(UNUSED(void *privdata), UNUSED(const struct target *target), UNUSED(const char *package), UNUSED(const char *old_version), UNUSED(const char *new_version), UNUSED(const char *new_controlchunk)) {
return UD_UPGRADE;
}
......@@ -7,8 +7,6 @@ typedef enum { UD_ERROR, UD_LOUDNO, UD_NO, UD_UPGRADE, UD_HOLD } upgrade_decisio
typedef upgrade_decision upgrade_decide_function(void *privdata, const struct target *, const char *package, const char *old_version, const char *new_version, const char *newcontrolchunk);
upgrade_decision ud_always(void *, const struct target *, const char *, const char *, const char *, const char *);
/* The main part: */
struct target;
......@@ -21,7 +19,6 @@ void upgradelist_free(/*@only@*/struct upgradelist *);
typedef void dumpaction(const char */*packagename*/, /*@null@*/const char */*oldversion*/, /*@null@*/const char */*newversion*/, /*@null@*/const char */*bestcandidate*/, /*@null@*/const struct strlist */*newfilekeys*/, /*@null@*/const char */*newcontrol*/, void *);
void upgradelist_dump(struct upgradelist *, dumpaction *);
retvalue upgradelist_listmissing(struct upgradelist *);
/* Take all items in 'filename' into account, and remember them coming from 'method' */
retvalue upgradelist_update(struct upgradelist *, /*@dependent@*/void *, const char * /*filename*/, upgrade_decide_function *, void *, bool /*ignorewrongarchitecture*/);
......
......@@ -2,7 +2,6 @@
#define REPREPRO_UPLOADERSLIST_H
struct upload_condition;
struct upload_conditions;
struct uploaders;
......@@ -24,6 +23,4 @@ enum upload_condition_type uploaders_nextcondition(struct upload_conditions *);
bool uploaders_verifystring(struct upload_conditions *, const char *);
bool uploaders_verifyatom(struct upload_conditions *, atom_t);
void upload_conditions_free(/*@only@*/struct upload_conditions *);
#endif
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