aboutsummaryrefslogtreecommitdiffstats
path: root/src/apk_defines.h
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2008-11-14 14:26:59 +0200
committerTimo Teras <timo.teras@iki.fi>2008-11-14 14:26:59 +0200
commit8e23a2ba4eb7f6192c6bce8a6da81004803eca3f (patch)
tree1450b08f0e2818a4bc12206081b6777b3e92b7f8 /src/apk_defines.h
parent86676ac8c40a96880f323c2b1a09a5714d85705e (diff)
downloadapk-tools-8e23a2ba4eb7f6192c6bce8a6da81004803eca3f.tar.gz
apk-tools-8e23a2ba4eb7f6192c6bce8a6da81004803eca3f.tar.bz2
apk-tools-8e23a2ba4eb7f6192c6bce8a6da81004803eca3f.tar.xz
db: checksum installed files, protect config files
Checksum of installed is computed on the fly when extracting them and it'll be saved to fdb. When installing config files those are diverted with suffix .apk-new if earlier version of same file with local changes exist.
Diffstat (limited to 'src/apk_defines.h')
-rw-r--r--src/apk_defines.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/apk_defines.h b/src/apk_defines.h
index d6557a2..64abe72 100644
--- a/src/apk_defines.h
+++ b/src/apk_defines.h
@@ -12,6 +12,8 @@
#ifndef APK_DEFINES_H
#define APK_DEFINES_H
+#include <malloc.h>
+
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
#define BIT(x) (1 << (x))
@@ -36,12 +38,15 @@
#if 1
#include "md5.h"
+typedef unsigned char *csum_p;
typedef md5sum_t csum_t;
typedef struct md5_ctx csum_ctx_t;
+extern csum_t bad_checksum;
#define csum_init(ctx) md5_init(ctx)
#define csum_process(ctx, buf, len) md5_process(ctx, buf, len)
#define csum_finish(ctx, buf) md5_finish(ctx, buf)
+#define csum_valid(buf) memcmp(buf, bad_checksum, sizeof(csum_t))
#endif
extern int apk_cwd_fd, apk_quiet;
@@ -76,6 +81,8 @@ void apk_log(const char *prefix, const char *format, ...);
return &(*a)->item[size-1]; \
}
+APK_ARRAY(apk_string_array, char *);
+
#define LIST_END (void *) 0xe01
#define LIST_POISON1 (void *) 0xdeadbeef
#define LIST_POISON2 (void *) 0xabbaabba