summaryrefslogtreecommitdiff
path: root/src/til_setup.c
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2023-05-29 13:31:47 -0700
committerVito Caputo <vcaputo@pengaru.com>2023-05-30 08:30:55 -0700
commitc975ca1063f85d77fb2dae10d8de7c991863c32e (patch)
tree3b5eaeea922aee9248521952708014ec01847276 /src/til_setup.c
parentb9acfa6ab04d05d9ad34f3e203bfc498a1bf2f11 (diff)
til_setup: hash til_setup_t.path
Preparatory commit for deprecating til_module_context_t.path in favor of mandatory til_module_context_t.setup providing the settings-derived context path. Future commit will drop til_module_context_t.{path,path_hash}
Diffstat (limited to 'src/til_setup.c')
-rw-r--r--src/til_setup.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/til_setup.c b/src/til_setup.c
index c1198fd..68728fb 100644
--- a/src/til_setup.c
+++ b/src/til_setup.c
@@ -3,6 +3,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include "til_jenkins.h"
#include "til_settings.h"
#include "til_setup.h"
@@ -23,6 +24,7 @@
void * til_setup_new(const til_settings_t *settings, size_t size, void (*free_func)(til_setup_t *setup))
{
char *path_buf = NULL;
+ size_t path_sz;
til_setup_t *setup;
assert(settings);
@@ -30,7 +32,6 @@ void * til_setup_new(const til_settings_t *settings, size_t size, void (*free_fu
{ /* TODO FIXME: more unportable memstream use! */
FILE *path_fp;
- size_t path_sz;
int r;
path_fp = open_memstream(&path_buf, &path_sz);
@@ -52,6 +53,7 @@ void * til_setup_new(const til_settings_t *settings, size_t size, void (*free_fu
}
setup->path = path_buf;
+ setup->path_hash = til_jenkins((uint8_t *)path_buf, path_sz);
setup->refcount = 1;
setup->free = free_func;
© All Rights Reserved