summaryrefslogtreecommitdiff
path: root/src/util.h
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2008-01-29 16:14:03 +0000
committerMichael Schroeder <mls@suse.de>2008-01-29 16:14:03 +0000
commit5bb97e51a00ec15f1cb6bd6b5f3b4befd0263e1d (patch)
treee70c1d84501ba17323588be5a6d6e0970155285e /src/util.h
parentcf2556872b850f5d9c26975b5e287a4bf7ef38ca (diff)
downloadlibsolv-5bb97e51a00ec15f1cb6bd6b5f3b4befd0263e1d.tar.gz
libsolv-5bb97e51a00ec15f1cb6bd6b5f3b4befd0263e1d.tar.bz2
libsolv-5bb97e51a00ec15f1cb6bd6b5f3b4befd0263e1d.zip
- add key filtering to repo_write
- change repo_write so that it combines all available data - integrate attr_store into repodata - write storage parameter with every key, bump solv revision to 5 - don't create system rules for atoms - change repo_susetags to use repodata interface
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h
index e38aa12..7c196e7 100644
--- a/src/util.h
+++ b/src/util.h
@@ -20,4 +20,33 @@ extern void *sat_realloc(void *, size_t);
extern void *sat_realloc2(void *, size_t, size_t);
extern void *sat_free(void *);
+static inline void *sat_extend(void *buf, size_t len, size_t nmemb, size_t size, size_t block)
+{
+ if (nmemb == 1)
+ {
+ if ((len & block) == 0)
+ buf = sat_realloc2(buf, len + (1 + block), size);
+ }
+ else
+ {
+ if (((len - 1) | block) != ((len + nmemb - 1) | block))
+ buf = sat_realloc2(buf, (len + (nmemb + block)) & ~block, size);
+ }
+ return buf;
+}
+
+static inline void *sat_extend_resize(void *buf, size_t len, size_t size, size_t block)
+{
+ if (len)
+ buf = sat_realloc2(buf, (len + block) & ~block, size);
+ return buf;
+}
+
+static inline void *sat_extend_cleanup(void *buf, size_t len, size_t size)
+{
+ if (len)
+ buf = sat_realloc2(buf, len, size);
+ return buf;
+}
+
#endif /* SATSOLVER_UTIL_H */