summaryrefslogtreecommitdiffstats
path: root/common.h
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2000-12-16 18:22:32 +0000
committerPascal Rigaux <pixel@mandriva.com>2000-12-16 18:22:32 +0000
commit1f8893a6cd761f9ef87d4cb9c8d8baecf17b4352 (patch)
tree9db1d895d506145757dff083c0f75ec3252d30f2 /common.h
parent9f8ce02a3814161d80ae8430282eeb58ae75cbb8 (diff)
downloadldetect-1f8893a6cd761f9ef87d4cb9c8d8baecf17b4352.tar
ldetect-1f8893a6cd761f9ef87d4cb9c8d8baecf17b4352.tar.gz
ldetect-1f8893a6cd761f9ef87d4cb9c8d8baecf17b4352.tar.bz2
ldetect-1f8893a6cd761f9ef87d4cb9c8d8baecf17b4352.tar.xz
ldetect-1f8893a6cd761f9ef87d4cb9c8d8baecf17b4352.zip
now detect usb
Diffstat (limited to 'common.h')
-rw-r--r--common.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/common.h b/common.h
new file mode 100644
index 0000000..10fa22b
--- /dev/null
+++ b/common.h
@@ -0,0 +1,10 @@
+#define psizeof(a) (sizeof(a) / sizeof(*(a)))
+
+static inline void *memdup(void *src, size_t size) {
+ void *r = malloc(size);
+ memcpy(r, src, size);
+ return r;
+}
+static inline void ifree(void *p) {
+ if (p) { free(p); p = NULL; }
+}