diff options
author | Timo Teras <timo.teras@iki.fi> | 2008-04-22 08:16:26 +0000 |
---|---|---|
committer | Timo Teras <timo.teras@iki.fi> | 2008-04-22 08:16:26 +0000 |
commit | 219a1b2ee8f4c3c2caf57e79bcb9780e32da7155 (patch) | |
tree | 0a4d20d18de572e5eba37138ca5176fee051d981 /src/apk_defines.h | |
parent | 384c2f1d94282ff5564a5f6c5ab9e51c975f83a6 (diff) | |
download | apk-tools-219a1b2ee8f4c3c2caf57e79bcb9780e32da7155.tar.gz apk-tools-219a1b2ee8f4c3c2caf57e79bcb9780e32da7155.tar.bz2 apk-tools-219a1b2ee8f4c3c2caf57e79bcb9780e32da7155.tar.xz apk-tools-219a1b2ee8f4c3c2caf57e79bcb9780e32da7155.zip |
Overwriting of bb files, apk_create (from old apk-tools), chdir changes,
other stuff.
Diffstat (limited to 'src/apk_defines.h')
-rw-r--r-- | src/apk_defines.h | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/apk_defines.h b/src/apk_defines.h index c9c64f5..d6557a2 100644 --- a/src/apk_defines.h +++ b/src/apk_defines.h @@ -44,9 +44,9 @@ typedef struct md5_ctx csum_ctx_t; #define csum_finish(ctx, buf) md5_finish(ctx, buf) #endif -extern int apk_quiet; +extern int apk_cwd_fd, apk_quiet; -#define apk_error(args...) if (!apk_quiet) { apk_log("ERROR: ", args); } +#define apk_error(args...) apk_log("ERROR: ", args); #define apk_warning(args...) if (!apk_quiet) { apk_log("WARNING: ", args); } #define apk_message(args...) if (!apk_quiet) { apk_log(NULL, args); } @@ -101,12 +101,18 @@ static inline int hlist_hashed(const struct hlist_node *n) static inline void __hlist_del(struct hlist_node *n, struct hlist_node **pprev) { *pprev = n->next; + n->next = NULL; } -static inline void hlist_del(struct hlist_node *n, struct hlist_node **pprev) +static inline void hlist_del(struct hlist_node *n, struct hlist_head *h) { - __hlist_del(n, pprev); - n->next = LIST_POISON1; + struct hlist_node **pp = &h->first; + + while (*pp != NULL && *pp != LIST_END && *pp != n) + pp = &(*pp)->next; + + if (*pp == n) + __hlist_del(n, pp); } static inline void hlist_add_head(struct hlist_node *n, struct hlist_head *h) @@ -123,6 +129,16 @@ static inline void hlist_add_after(struct hlist_node *n, struct hlist_node **pre *prev = n; } +static inline struct hlist_node **hlist_tail_ptr(struct hlist_head *h) +{ + struct hlist_node *n = h->first; + if (n == NULL || n == LIST_END) + return &h->first; + while (n->next != NULL && n->next != LIST_END) + n = n->next; + return &n->next; +} + #define hlist_entry(ptr, type, member) container_of(ptr,type,member) #define hlist_for_each(pos, head) \ |