@@ -47,6 +47,21 @@ extern "C" {
#define min(a, b) MIN(a, b) /* glue for linux kernel source */
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
+#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1)
+#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask))
+
+#define min_t(t,x,y) ({ \
+ typeof((x)) _x = (x); \
+ typeof((y)) _y = (y); \
+ (_x < _y) ? _x : _y; \
+})
+
+#define max_t(t,x,y) ({ \
+ typeof((x)) _x = (x); \
+ typeof((y)) _y = (y); \
+ (_x > _y) ? _x : _y; \
+})
+
#ifndef O_CLOEXEC
#define O_CLOEXEC 0
#endif
@@ -20,6 +20,8 @@
* Zoltan Sogor
*/
+#define PROGRAM_NAME "compr"
+
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
@@ -29,21 +29,6 @@
#define le32_to_cpu(x) (t32((x)))
#define le64_to_cpu(x) (t64((x)))
-#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1)
-#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask))
-
-#define min_t(t,x,y) ({ \
- typeof((x)) _x = (x); \
- typeof((y)) _y = (y); \
- (_x < _y) ? _x : _y; \
-})
-
-#define max_t(t,x,y) ({ \
- typeof((x)) _x = (x); \
- typeof((y)) _y = (y); \
- (_x > _y) ? _x : _y; \
-})
-
#define unlikely(x) (x)
#define ubifs_assert(x) ({})
@@ -44,6 +44,8 @@
* for more information about what the device table is.
*/
+#define PROGRAM_NAME "devtable"
+
#include "mkfs.ubifs.h"
#include "hashtable/hashtable.h"
#include "hashtable/hashtable_itr.h"
@@ -20,6 +20,8 @@
* Artem Bityutskiy
*/
+#define PROGRAM_NAME "lpt"
+
#include "mkfs.ubifs.h"
/**
@@ -51,6 +51,7 @@
#include "crc16.h"
#include "ubifs-media.h"
#include "ubifs.h"
+#include "common.h"
#include "key.h"
#include "lpt.h"
#include "compr.h"