repo

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

commit 4bac36e604cf02941aaab5f76eade66ceeeaa43a
parent 6652abe7cecd4d2cbaa54939be7dc492041e0906
Author: z3bra <contactatz3bradotorg>
Date:   Thu Dec 15 10:53:11 +0100

Use TAILQ instead of SLIST

Diffstat:
repo.c | 10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/repo.c b/repo.c @@ -20,9 +20,9 @@ struct pack { char name[LINE_MAX]; char version[LINE_MAX]; char filename[PATH_MAX]; - SLIST_ENTRY(pack) entries; + TAILQ_ENTRY(pack) entries; }; -SLIST_HEAD(packs, pack); +TAILQ_HEAD(packs, pack); void usage(char *); int mkdir_parents(char *, mode_t); @@ -111,7 +111,7 @@ local_load(struct packs *plist, char *local) while (fgets(buf, LINE_MAX, list)) { p = pack_load(buf); if (p) - SLIST_INSERT_HEAD(plist, p, entries); + TAILQ_INSERT_TAIL(plist, p, entries); p = NULL; } return 0; @@ -123,7 +123,7 @@ local_list(char *local) struct packs plist; struct pack *p = NULL; local_load(&plist, local); - SLIST_FOREACH(p, &plist, entries) { + TAILQ_FOREACH(p, &plist, entries) { printf("%s\t%s\n", p->name, p->version); } return 0; @@ -220,7 +220,7 @@ main (int argc, char *argv[]) local_load(&plist, LOCALREPO); while ((n = *(argv++))) { - SLIST_FOREACH(p, &plist, entries) { + TAILQ_FOREACH(p, &plist, entries) { if (!strncmp(p->name, n, PATH_MAX)) { remote_sync(REMOTEREPO, LOCALREPO, p->filename); printf("%s%s\n", LOCALREPO, p->filename);