summaryrefslogtreecommitdiff
path: root/array.h
diff options
context:
space:
mode:
authorFelix von Leitner <felix-libowfat@fefe.de>2010-06-03 22:46:59 +0000
committerFelix von Leitner <felix-libowfat@fefe.de>2010-06-03 22:46:59 +0000
commitd702d06774141eeb09a1a0504fea849b40b9f044 (patch)
tree99fa241aaa5711961757003fa36c8be8a83a97fd /array.h
parentefbb246c4d2c3d00005e96df5f12285d569b5939 (diff)
downloadlibowfat-d702d06774141eeb09a1a0504fea849b40b9f044.tar.gz
libowfat-d702d06774141eeb09a1a0504fea849b40b9f044.zip
for installed header files, add comment saying where they came from
Diffstat (limited to 'array.h')
-rw-r--r--array.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/array.h b/array.h
index 953ce14..a2bec14 100644
--- a/array.h
+++ b/array.h
@@ -1,6 +1,8 @@
+/* this header file comes from libowfat, http://www.fefe.de/libowfat/ */
#ifndef ARRAY_H
#define ARRAY_H
+#include <stddef.h>
#include "uint64.h"
typedef struct {
@@ -11,10 +13,12 @@ typedef struct {
/* p and allocated nonzero: array is allocated */
/* p and allocated zero: array is unallocated */
/* p zero and allocated < 0: array is failed */
+
+ size_t headroom; /* the actual pointer for free() and realloc() is p-headroom */
} array;
void* array_allocate(array* x,uint64 membersize,int64 pos);
-void* array_get(array* x,uint64 membersize,int64 pos);
+void* array_get(const array* const x,uint64 membersize,int64 pos);
void* array_start(const array* const x);
int64 array_length(const array* const x,uint64 membersize);
int64 array_bytes(const array* const x);
@@ -30,6 +34,9 @@ void array_cats0(array* to,const char* from);
void array_cat0(array* to);
void array_cate(array* to,const array* const from,int64 pos,int64 stop);
+void array_shift(array* x,uint64 membersize,uint64 members);
+void array_chop(array* x,uint64 membersize,uint64 members);
+
#define array_failed(x) (array_bytes(x)==-1)
#define array_unallocated(x) (array_bytes(x)==0)