summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2020-07-17 11:51:07 +0200
committerTyge Løvset <[email protected]>2020-07-17 11:51:07 +0200
commitda4d127cbd65c35fee03411df66eadd34e7a999b (patch)
treefc5dddc3ec7232597c6d471698c6e91ae9af470c
parent7cda97c127076acbbaa7b472cf5a89357c1d9a84 (diff)
downloadSTC-modified-da4d127cbd65c35fee03411df66eadd34e7a999b.tar.gz
STC-modified-da4d127cbd65c35fee03411df66eadd34e7a999b.zip
Renamed chash.h to cmap.h and added cset.h
-rw-r--r--examples/advanced.c2
-rw-r--r--examples/benchmark.c6
-rw-r--r--examples/complex.c8
-rw-r--r--examples/demos.c10
-rw-r--r--examples/geek1.c2
-rw-r--r--examples/geek2.c2
-rw-r--r--examples/geek3.c2
-rw-r--r--examples/geek4.c2
-rw-r--r--examples/geek5.c2
-rw-r--r--examples/geek6.c2
-rw-r--r--examples/mapmap.c2
-rw-r--r--examples/rngtest.c2
-rw-r--r--stc/cmap.h (renamed from stc/chash.h)4
-rw-r--r--stc/crandom.h23
-rw-r--r--stc/cset.h28
15 files changed, 74 insertions, 23 deletions
diff --git a/examples/advanced.c b/examples/advanced.c
index e6b4ad2a..bd06c95d 100644
--- a/examples/advanced.c
+++ b/examples/advanced.c
@@ -11,7 +11,7 @@
* of the Viking struct first.
*/
#include <stdio.h>
-#include <stc/chash.h>
+#include <stc/cmap.h>
#include <stc/cstr.h>
// Viking view struct -----------------------
diff --git a/examples/benchmark.c b/examples/benchmark.c
index 31b36b1a..cadb220c 100644
--- a/examples/benchmark.c
+++ b/examples/benchmark.c
@@ -1,6 +1,6 @@
-#include "../stc/crandom.h"
-#include "../stc/cstr.h"
-#include "../stc/chash.h"
+#include <stc/crandom.h>
+#include <stc/cstr.h>
+#include <stc/cmap.h>
#include "others/khash.h"
#include <stdio.h>
diff --git a/examples/complex.c b/examples/complex.c
index feb01db2..6cfed90c 100644
--- a/examples/complex.c
+++ b/examples/complex.c
@@ -1,7 +1,7 @@
-#include "../stc/cstr.h"
-#include "../stc/chash.h"
-#include "../stc/clist.h"
-#include "../stc/carray.h"
+#include <stc/cstr.h>
+#include <stc/cmap.h>
+#include <stc/clist.h>
+#include <stc/carray.h>
void check_destroy(float* v) {printf("destroy %g\n", *v);}
diff --git a/examples/demos.c b/examples/demos.c
index 037983e0..c10cace9 100644
--- a/examples/demos.c
+++ b/examples/demos.c
@@ -1,8 +1,8 @@
-#include "../stc/cvec.h"
-#include "../stc/clist.h"
-#include "../stc/carray.h"
-#include "../stc/chash.h"
-#include "../stc/cstr.h"
+#include <stc/cvec.h>
+#include <stc/clist.h>
+#include <stc/carray.h>
+#include <stc/cmap.h>
+#include <stc/cstr.h>
void stringdemo1()
diff --git a/examples/geek1.c b/examples/geek1.c
index 2aecaa8d..a8cf5b7b 100644
--- a/examples/geek1.c
+++ b/examples/geek1.c
@@ -10,7 +10,7 @@ int a[] = { 1, 2, 2, 3, 2, 4, 10 };
#ifndef __cplusplus
// C program to implement the above approach
#include <stdio.h>
-#include <stc/chash.h>
+#include <stc/cmap.h>
declare_CMap(ii, int, int);
diff --git a/examples/geek2.c b/examples/geek2.c
index 7ce4fd2d..38916243 100644
--- a/examples/geek2.c
+++ b/examples/geek2.c
@@ -1,6 +1,6 @@
#ifndef __cplusplus
-#include <stc/chash.h>
+#include <stc/cmap.h>
#include <stc/cstr.h>
declare_CMap_str(ss, CStr, cstr_destroy);
diff --git a/examples/geek3.c b/examples/geek3.c
index 4db84d13..3ea93fe5 100644
--- a/examples/geek3.c
+++ b/examples/geek3.c
@@ -1,6 +1,6 @@
// xx3.c
-#include <stc/chash.h>
+#include <stc/cmap.h>
#include <stc/cstr.h>
declare_CMap_str(si, int);
diff --git a/examples/geek4.c b/examples/geek4.c
index 3f0f7f79..243301f9 100644
--- a/examples/geek4.c
+++ b/examples/geek4.c
@@ -33,7 +33,7 @@ Efficient Approach: For all the words of the first sentence, we can check if it
#ifndef __cplusplus
// C implementation of the approach
-#include <stc/chash.h>
+#include <stc/cmap.h>
#include <stc/cvec.h>
#include <stc/cstr.h>
diff --git a/examples/geek5.c b/examples/geek5.c
index 0af114b7..2dbd0adb 100644
--- a/examples/geek5.c
+++ b/examples/geek5.c
@@ -17,7 +17,7 @@ Output: 0
#ifndef __cplusplus
-#include <stc/chash.h>
+#include <stc/cmap.h>
#include <stc/cvec.h>
#include <stc/cstr.h>
diff --git a/examples/geek6.c b/examples/geek6.c
index 369867e9..ef86c3e8 100644
--- a/examples/geek6.c
+++ b/examples/geek6.c
@@ -29,7 +29,7 @@ operation in almost O(1) time complexity.
// positive missing number
#include <stdio.h>
-#include <stc/chash.h>
+#include <stc/cmap.h>
declare_CSet(i, int);
// Function to find the smallest positive
diff --git a/examples/mapmap.c b/examples/mapmap.c
index 77c71fe9..35b5f510 100644
--- a/examples/mapmap.c
+++ b/examples/mapmap.c
@@ -1,6 +1,6 @@
#include <stdio.h>
-#include <stc/chash.h>
+#include <stc/cmap.h>
static void test_destr(int* x) {
printf("destroy int: %d\n", *x);
diff --git a/examples/rngtest.c b/examples/rngtest.c
index ed3bed08..c465b5c3 100644
--- a/examples/rngtest.c
+++ b/examples/rngtest.c
@@ -1,6 +1,6 @@
#include <stdio.h>
#include <time.h>
-#include "../stc/crandom.h"
+#include <stc/crandom.h>
#ifdef __cplusplus
#include <random>
#endif
diff --git a/stc/chash.h b/stc/cmap.h
index dc18d77d..a823b9ff 100644
--- a/stc/chash.h
+++ b/stc/cmap.h
@@ -46,8 +46,8 @@ int main(void) {
cmap_mx_destroy(&m);
}
*/
-#ifndef CHASH__H__
-#define CHASH__H__
+#ifndef CMAP__H__
+#define CMAP__H__
#include <stdlib.h>
#include "cdefs.h"
diff --git a/stc/crandom.h b/stc/crandom.h
index ff2e03d3..1cf3fb2d 100644
--- a/stc/crandom.h
+++ b/stc/crandom.h
@@ -1,3 +1,26 @@
+/* MIT License
+ *
+ * Copyright (c) 2020 Tyge Løvset, NORCE, www.norceresearch.no
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
#ifndef CRANDOM__H__
#define CRANDOM__H__
diff --git a/stc/cset.h b/stc/cset.h
new file mode 100644
index 00000000..630771c7
--- /dev/null
+++ b/stc/cset.h
@@ -0,0 +1,28 @@
+/* MIT License
+ *
+ * Copyright (c) 2020 Tyge Løvset, NORCE, www.norceresearch.no
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+#ifndef CSET__H__
+#define CSET__H__
+
+#include "cmap.h"
+
+#endif