diff options
author | Timo Teräs <timo.teras@iki.fi> | 2020-05-19 11:39:21 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2020-05-19 12:02:56 +0300 |
commit | d0edeec8fb8fa5abee8b3065cea5e4882d0c51c4 (patch) | |
tree | 10dbc6d72c9cef13a26cb539df43e92e4bf78d74 /src/apk_blob.h | |
parent | 12fdf6fc219321d22825042ae08efd322acc0310 (diff) | |
download | apk-tools-d0edeec8fb8fa5abee8b3065cea5e4882d0c51c4.tar.gz apk-tools-d0edeec8fb8fa5abee8b3065cea5e4882d0c51c4.tar.bz2 apk-tools-d0edeec8fb8fa5abee8b3065cea5e4882d0c51c4.tar.xz apk-tools-d0edeec8fb8fa5abee8b3065cea5e4882d0c51c4.zip |
make the atom functions not use global state
This greatly helps with memory management on applications that
may want to daemonize and open/close database several times.
Also the lifetime and "owner" of memory for all data is now
explicitly bound to owning struct apk_database, which might
be helpful when writing language bindings. As side effect, the
interned "atoms" are unique only within what apk_database, so
comparing packages from different apk_database may not work
as expected.
Fixes #10697
Diffstat (limited to 'src/apk_blob.h')
-rw-r--r-- | src/apk_blob.h | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/src/apk_blob.h b/src/apk_blob.h index 84bd143..008666e 100644 --- a/src/apk_blob.h +++ b/src/apk_blob.h @@ -25,7 +25,6 @@ struct apk_blob { }; typedef struct apk_blob apk_blob_t; typedef int (*apk_blob_cb)(void *ctx, apk_blob_t blob); -extern apk_blob_t apk_null_blob; #define BLOB_FMT "%.*s" #define BLOB_PRINTF(b) (int)(b).len, (b).ptr @@ -130,10 +129,6 @@ void apk_blob_pull_base64(apk_blob_t *b, apk_blob_t to); void apk_blob_pull_hexdump(apk_blob_t *b, apk_blob_t to); int apk_blob_pull_blob_match(apk_blob_t *b, apk_blob_t match); -void apk_atom_init(void); -apk_blob_t *apk_blob_atomize(apk_blob_t blob); -apk_blob_t *apk_blob_atomize_dup(apk_blob_t blob); - #if defined(__GLIBC__) && !defined(__UCLIBC__) extern size_t strlcpy(char *dest, const char *src, size_t size); #endif |