diff options
author | Michael Schroeder <mls@suse.de> | 2008-01-29 16:14:03 +0000 |
---|---|---|
committer | Michael Schroeder <mls@suse.de> | 2008-01-29 16:14:03 +0000 |
commit | 5bb97e51a00ec15f1cb6bd6b5f3b4befd0263e1d (patch) | |
tree | e70c1d84501ba17323588be5a6d6e0970155285e /src/util.h | |
parent | cf2556872b850f5d9c26975b5e287a4bf7ef38ca (diff) | |
download | libsolv-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.h | 29 |
1 files changed, 29 insertions, 0 deletions
@@ -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 */ |