feat: cleanup and daemonization

This commit is contained in:
2024-08-04 12:45:32 +02:00
parent dcc25f88a7
commit 1bcdca9e21
11 changed files with 64 additions and 49 deletions

View File

@ -1,7 +1,7 @@
#ifndef SCI_CLI_H
#define SCI_CLI_H
#include <stdio.h>
#include "optional.h"
#include <stdio.h>
typedef struct {
optional_str config_file;

View File

@ -1,9 +1,7 @@
#ifndef SCI_LOG_H
#define SCI_LOG_H
#include <stdarg.h>
#include <stdio.h>
// TODO: Thread safety!
enum {
LOG_TRACE = 4,
LOG_INFO = 3,

View File

@ -2,7 +2,6 @@
#define SCI_PIPELINE_H
#include "optional.h"
#include <pthread.h>
#include <sys/inotify.h>
typedef struct {
char* name;

View File

@ -1,9 +1,8 @@
#ifndef SCI_THREADPOOL_H
#define SCI_THREADPOOL_H
#include <stdbool.h>
#include <stddef.h>
#include "optional.h"
#include <pthread.h>
// Very inspired by: https://nachtimwald.com/2019/04/12/thread-pool-in-c/
#include <stdbool.h>
// a work function
typedef void (*thread_func)(void *arg);
@ -14,6 +13,7 @@ typedef struct threadpool_work {
void* arg;
struct threadpool_work* next;
} threadpool_work;
typedef optional_type(threadpool_work*) optional_threadpool_work;
// thread pool object
typedef struct {