repo

List, download and sync packs with remote repositories
Log | Files | Refs

commit fc22815052fc6ece27897b0e94c06784a5e9b574
parent dd25eabbe37570395ca70bfdf9f0c60d62a27691
Author: z3bra <contactatz3bradotorg>
Date:   Thu Dec 15 22:34:23 +0100

Rename functions

Diffstat:
repo.c | 28++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/repo.c b/repo.c @@ -30,10 +30,10 @@ struct repo { TAILQ_HEAD(repos, repo); void usage(char *); -struct pack *pack_load(struct packs *, char *, char *, char *); -struct repo *add_repo(struct repos *, char *); -int local_load(struct packs *, char *); -int remote_sync(char *, FILE *); +struct pack *addpack(struct packs *, char *, char *, char *); +struct repo *addrepo(struct repos *, char *); +int repolist(struct packs *, char *); +int download(char *, FILE *); void usage(char *name) @@ -43,7 +43,7 @@ usage(char *name) } struct pack * -pack_load(struct packs *plist, char *name, char *version, char *url) +addpack(struct packs *plist, char *name, char *version, char *url) { struct pack *p = NULL; @@ -63,7 +63,7 @@ pack_load(struct packs *plist, char *name, char *version, char *url) } struct repo * -add_repo(struct repos *rlist, char *url) +addrepo(struct repos *rlist, char *url) { struct repo *r = NULL; @@ -85,7 +85,7 @@ add_repo(struct repos *rlist, char *url) } int -local_load(struct packs *plist, char *local) +repolist(struct packs *plist, char *local) { int r = 0; char fn[PATH_MAX] = ""; @@ -107,14 +107,14 @@ local_load(struct packs *plist, char *local) perror(fn); exit(1); } - pack_load(plist, n, v, u); + addpack(plist, n, v, u); } fclose(list); return 0; } int -remote_sync(char *url, FILE *fd) +download(char *url, FILE *fd) { ssize_t len; char *fn, *base, *encfile, *encurl; @@ -169,7 +169,7 @@ main (int argc, char *argv[]) ARGBEGIN{ case 'r': - add_repo(&rlist, EARGF(usage(argv0))); + addrepo(&rlist, EARGF(usage(argv0))); break; case 's': sflag = 1; @@ -182,7 +182,7 @@ main (int argc, char *argv[]) }ARGEND; if (TAILQ_EMPTY(&rlist)) { - add_repo(&rlist, REMOTEREPO); + addrepo(&rlist, REMOTEREPO); } if (sflag) { @@ -194,12 +194,12 @@ main (int argc, char *argv[]) } TAILQ_FOREACH(r, &rlist, entries) { snprintf(url, PATH_MAX, "%s/%s", r->url, LISTFILE); - remote_sync(url, fd); + download(url, fd); } fclose(fd); } - local_load(&plist, LOCALREPO); + repolist(&plist, LOCALREPO); if (lflag) { TAILQ_FOREACH(p, &plist, entries) { @@ -217,7 +217,7 @@ main (int argc, char *argv[]) perror(fn); continue; } - remote_sync(p->url, fd); + download(p->url, fd); puts(fn); fclose(fd); break;