summaryrefslogtreecommitdiff
path: root/src/headers
diff options
context:
space:
mode:
Diffstat (limited to 'src/headers')
-rw-r--r--src/headers/bits-bendian4
-rw-r--r--src/headers/bits-footer2
-rw-r--r--src/headers/bits-lendian5
-rw-r--r--src/headers/bits-template1
-rw-r--r--src/headers/uint16-bswap2
-rw-r--r--src/headers/uint32-bswap2
-rw-r--r--src/headers/uint64-bswap2
-rw-r--r--src/headers/uint64-include1
8 files changed, 16 insertions, 3 deletions
diff --git a/src/headers/bits-bendian b/src/headers/bits-bendian
index ac1169f..19b4bff 100644
--- a/src/headers/bits-bendian
+++ b/src/headers/bits-bendian
@@ -1,3 +1,7 @@
+
+#define UINT@BITS@_LITTLE(u) UINT@BITS@_BSWAP(u)
+#define UINT@BITS@_BIG(u) (u)
+
#define uint@BITS@_little(u) uint@BITS@_bswap(u)
#define uint@BITS@_big(u) (u)
diff --git a/src/headers/bits-footer b/src/headers/bits-footer
index b6f75a9..ddd5dae 100644
--- a/src/headers/bits-footer
+++ b/src/headers/bits-footer
@@ -1,4 +1,2 @@
-typedef uint@BITS@_t uint@BITS@ ;
-
#endif
diff --git a/src/headers/bits-lendian b/src/headers/bits-lendian
index e2358d3..e0017f5 100644
--- a/src/headers/bits-lendian
+++ b/src/headers/bits-lendian
@@ -1,3 +1,7 @@
+
+#define UINT@BITS@_LITTLE(u) (u)
+#define UINT@BITS@_BIG(u) UINT@BITS@_BSWAP(u)
+
#define uint@BITS@_little(u) (u)
#define uint@BITS@_big(u) uint@BITS@_bswap(u)
@@ -6,4 +10,3 @@
#define uint@BITS@_littlen(array, n)
#define uint@BITS@_bign(array, n) uint@BITS@_bswapn(array, n)
-
diff --git a/src/headers/bits-template b/src/headers/bits-template
index 23222d6..f0b71df 100644
--- a/src/headers/bits-template
+++ b/src/headers/bits-template
@@ -1,3 +1,4 @@
+
extern void uint@BITS@_pack (char *, uint@BITS@_t) ;
extern void uint@BITS@_pack_big (char *, uint@BITS@_t) ;
extern void uint@BITS@_unpack (char const *, uint@BITS@_t *) ;
diff --git a/src/headers/uint16-bswap b/src/headers/uint16-bswap
new file mode 100644
index 0000000..2bf5c8e
--- /dev/null
+++ b/src/headers/uint16-bswap
@@ -0,0 +1,2 @@
+
+#define UINT16_BSWAP(a) (((a) & 0x00ffu) << 8 | ((a) & 0xff00u) >> 8)
diff --git a/src/headers/uint32-bswap b/src/headers/uint32-bswap
new file mode 100644
index 0000000..4ba4d9b
--- /dev/null
+++ b/src/headers/uint32-bswap
@@ -0,0 +1,2 @@
+
+#define UINT32_BSWAP(a) (((a) & 0x000000ffu) << 24 | ((a) & 0x0000ff00u) << 8 | ((a) & 0x00ff0000u) >> 8 | ((a) & 0xff000000u) >> 24)
diff --git a/src/headers/uint64-bswap b/src/headers/uint64-bswap
new file mode 100644
index 0000000..3ebd512
--- /dev/null
+++ b/src/headers/uint64-bswap
@@ -0,0 +1,2 @@
+
+#define UINT64_BSWAP(a) (((a) & 0x00000000000000ffull) << 56 | ((a) & 0x000000000000ff00ull) << 40 | ((a) & 0x0000000000ff0000ull) << 24 | ((a) & 0x00000000ff000000ull) << 8 | ((a) & 0x000000ff00000000ull) >> 8 | ((a) & 0x0000ff0000000000ull) >> 24 | ((a) & 0x00ff000000000000ull) >> 40 | ((a) & 0xff00000000000000ull) >> 56)
diff --git a/src/headers/uint64-include b/src/headers/uint64-include
index 12a0936..079bc2d 100644
--- a/src/headers/uint64-include
+++ b/src/headers/uint64-include
@@ -1 +1,2 @@
+
#include <skalibs/uint64.h>