summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorwens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-06-15 22:34:06 +0800
committerwens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-06-15 22:34:06 +0800
commitddcba43d911f6a5faae9130073820e4442b9d4c8 (patch)
treefb06899708c9cc92654fcca8d298ef61419f886f /include
parent2b17144356fc625165400e7a856ad76cae4bf4b2 (diff)
downloadpttbbs-ddcba43d911f6a5faae9130073820e4442b9d4c8.tar
pttbbs-ddcba43d911f6a5faae9130073820e4442b9d4c8.tar.gz
pttbbs-ddcba43d911f6a5faae9130073820e4442b9d4c8.tar.bz2
pttbbs-ddcba43d911f6a5faae9130073820e4442b9d4c8.tar.lz
pttbbs-ddcba43d911f6a5faae9130073820e4442b9d4c8.tar.xz
pttbbs-ddcba43d911f6a5faae9130073820e4442b9d4c8.tar.zst
pttbbs-ddcba43d911f6a5faae9130073820e4442b9d4c8.zip
General vector-like list
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4357 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'include')
-rw-r--r--include/cmsys.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/cmsys.h b/include/cmsys.h
index 1e866630..2a219324 100644
--- a/include/cmsys.h
+++ b/include/cmsys.h
@@ -147,4 +147,25 @@ int delete_records(const char *fpath, size_t size, int id, size_t num);
#define delete_record(fpath, size, id) delete_records(fpath, size, id, 1)
int apply_record(const char *fpath, int (*fptr) (void *item, void *optarg), size_t size, void *arg);
+/* vector.c */
+struct Vector {
+ int size;
+ int length;
+ int capacity;
+ char *base;
+};
+
+void Vector_init(struct Vector *self, const int size);
+void Vector_delete(struct Vector *self);
+void Vector_clear(struct Vector *self, const int size);
+int Vector_length(struct Vector *self);
+void Vector_resize(struct Vector *self, const int length);
+void Vector_add(struct Vector *self, const char *name);
+const char* Vector_get(struct Vector *self, const int idx);
+int Vector_MaxLen(const struct Vector *list, const int offset, const int count);
+int Vector_match(const struct Vector *src, struct Vector *dst, const int key, const int pos);
+void Vector_sublist(struct Vector *src, struct Vector *dst, const char *tag);
+int Vector_remove(struct Vector *self, const char *name);
+int Vector_search(const struct Vector *self, const char *name);
+
#endif