summaryrefslogtreecommitdiff
path: root/dviware/umddvi/h/search.h
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /dviware/umddvi/h/search.h
Initial commit
Diffstat (limited to 'dviware/umddvi/h/search.h')
-rw-r--r--dviware/umddvi/h/search.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/dviware/umddvi/h/search.h b/dviware/umddvi/h/search.h
new file mode 100644
index 0000000000..1ba492d414
--- /dev/null
+++ b/dviware/umddvi/h/search.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 1987 University of Maryland Department of Computer Science.
+ * All rights reserved. Permission to copy for any purpose is hereby granted
+ * so long as this copyright notice remains intact.
+ */
+
+/* search structures and routines for 32-bit key, arbitrary data */
+
+struct search {
+ unsigned s_dsize; /* data object size (includes key size) */
+ unsigned s_space; /* space left (in terms of objects) */
+ unsigned s_n; /* number of objects in the table */
+ char *s_data; /* data area */
+};
+
+/* returns a pointer to the search table (for future search/installs) */
+struct search *SCreate(); /* create a search table */
+
+/* returns a pointer to the data object found or created */
+char *SSearch(); /* search for a data object */
+
+/* the third argument to SSearch controls operation as follows: */
+#define S_LOOKUP 0x00 /* pseudo flag */
+#define S_CREATE 0x01 /* create object if not found */
+#define S_EXCL 0x02 /* complain if already exists */
+
+/* in addition, it is modified before return to hold status: */
+#define S_COLL 0x04 /* collision (occurs iff S_EXCL set) */
+#define S_FOUND 0x08 /* found (occurs iff existed already) */
+#define S_NEW 0x10 /* created (occurs iff S_CREATE && !S_EXCL) */
+#define S_ERROR 0x20 /* problem creating (out of memory) */