Date:2010-11-21 07:25:53 (13 years 4 months ago)
Author:Werner Almesberger
Commit:dd0ee663045491fb1a95ccb0c0fb0dd0918122bf
Message:qpkg: give ID2S macro a more "offical" status

- prereq.c (ID2S), id.h (ID2PF): renamed ID2S to ID2PF and moved it to id.h
- prereq.c (push, satisfies, resolve): change ID2S to ID2PF
Files: qpkg/id.h (1 diff)
qpkg/prereq.c (4 diffs)

Change Details

qpkg/id.h
5959};
6060
6161
62/*
63 * Helper macro for printing identifiers.
64 * Use with "... %.*s ..."
65 */
66
67#define ID2PF(id) (int) (id)->len, (id)->s
68
69
6270int comp_id(const void *a, const void *b);
6371
6472struct tree *make_tree(int (*comp)(const void *a, const void *b));
qpkg/prereq.c
3636static int stack_max = 0;
3737
3838
39#define ID2S(id) (int) (id)->len, (id)->s
40
41
4239static int epoch(const char **s, const struct id *id)
4340{
4441    const char *end = id->s+id->len;
...... 
114111
115112static void push(struct pkg *pkg)
116113{
117//fprintf(stderr, "push %.*s\n", ID2S(pkg->id));
114//fprintf(stderr, "push %.*s\n", ID2PF(pkg->id));
118115    if (n_stack == stack_max) {
119116        stack_max = (stack_max+1)*2;
120117        stack = realloc(stack, sizeof(*stack)*stack_max);
...... 
149146    assert(pkg->version);
150147    cmp = comp_versions(pkg->version, ref->version);
151148//fprintf(stderr, "%.*s <%d> %.*s\n",
152// ID2S(pkg->version), cmp, ID2S(ref->version));
149// ID2PF(pkg->version), cmp, ID2PF(ref->version));
153150    switch (ref->relop) {
154151    case rel_eq:
155152        return !cmp;
...... 
193190            return;
194191#if 0
195192fprintf(stderr, "%*s", level, "");
196fprintf(stderr, "%.*s %p", ID2S(pkg->id), pkg);
193fprintf(stderr, "%.*s %p", ID2PF(pkg->id), pkg);
197194if (pkg->version)
198fprintf(stderr, " %.*s", ID2S(pkg->version));
195fprintf(stderr, " %.*s", ID2PF(pkg->version));
199196if (pkg->mark) fprintf(stderr, " +");
200197if (pkg->flags & QPKG_INSTALLED) fprintf(stderr, " ***");
201198fprintf(stderr, "\n");

Archive Download the corresponding diff file

Branches:
master



interactive