summary refs log tree commit diff
path: root/ring.c
diff options
context:
space:
mode:
Diffstat (limited to 'ring.c')
-rw-r--r--ring.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/ring.c b/ring.c
index 40fb7df..ff83cea 100644
--- a/ring.c
+++ b/ring.c
@@ -38,3 +38,28 @@ void ringWrite(const char *line) {
 	ring.lines[i] = strdup(line);
 	if (!ring.lines[i]) err(EX_OSERR, "strdup");
 }
+
+static struct {
+	char **names;
+	size_t *reads;
+	size_t cap, len;
+} reader;
+
+size_t ringReader(const char *name) {
+	for (size_t i = 0; i < reader.len; ++i) {
+		if (!strcmp(reader.names[i], name)) return i;
+	}
+
+	if (reader.len == reader.cap) {
+		reader.cap = (reader.cap ? reader.cap * 2 : 8);
+		reader.names = realloc(reader.names, sizeof(*reader.names) * reader.cap);
+		if (!reader.names) err(EX_OSERR, "realloc");
+		reader.reads = realloc(reader.reads, sizeof(*reader.reads) * reader.cap);
+		if (!reader.reads) err(EX_OSERR, "realloc");
+	}
+
+	reader.names[reader.len] = strdup(name);
+	if (!reader.names[reader.len]) err(EX_OSERR, "strdup");
+	reader.reads[reader.len] = 0;
+	return reader.len++;
+}
021-08-24 13:23:55 -0400'>2021-08-24Import LibreSSL 3.3.4June McEnroe 2021-05-25Bump version to 3.3.3p1 3.3.3p1June McEnroe 2021-05-25build: Add scripts to EXTRA_DISTJune McEnroe 2021-05-25import: Add missing scripts/wrap-compiler-for-flag-checkJune McEnroe 2021-05-08Import LibreSSL 3.3.3June McEnroe 2021-04-18build: Remove added x509_verify.3 links 3.3.2June McEnroe 2021-04-18tls: Use EC_KEY_set_ex_dataJune McEnroe 2021-04-18Import LibreSSL 3.3.2June McEnroe 2021-03-05Bump version to 3.3.1p1 3.3.1p1June McEnroe 2021-03-05build: Add OpenSSL includes to libcompatJune McEnroe 2020-12-15Import LibreSSL 3.3.1June McEnroe 2020-11-24Import LibreSSL 3.3.0June McEnroe 2020-10-22Import LibreSSL 3.2.2June McEnroe 2020-09-29Import LibreSSL 3.2.1June McEnroe 2020-09-29import: Add m4/ax_add_fortify_source.m4June McEnroe 2020-08-05build: Add README.7 to EXTRA_DIST 3.2.0June McEnroe 2020-08-03doc: Indicate that only OpenSSL 1.1.1b and newer workJune McEnroe