mirror of
https://github.com/log-chipper/chipper.git
synced 2026-06-11 09:13:23 -05:00
feat: first init
- Simple unix daemon - Python, Go, and C client
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* @file chipper_common.h
|
||||
* @brief Common definitions and small helpers
|
||||
*/
|
||||
|
||||
#ifndef CHIPPER_COMMON_H
|
||||
#define CHIPPER_COMMON_H
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#define CHIPPER_BUFFER_SIZE 4096
|
||||
|
||||
typedef struct {
|
||||
const char *socket_path;
|
||||
const char *log_path;
|
||||
} ChipperOptions;
|
||||
|
||||
void chipper_die(const char *msg);
|
||||
|
||||
#endif // CHIPPER_COMMON_H
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* @file chipper_daemon
|
||||
*/
|
||||
|
||||
#ifndef CHIPPER_DAEMON_H
|
||||
#define CHIPPER_DAEMON_H
|
||||
|
||||
#include "chipper_common.h"
|
||||
|
||||
int chipper_run_daemon(const ChipperOptions *opts);
|
||||
|
||||
#endif // CHIPPER_DAEMON_H
|
||||
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* @file chipper_log.h
|
||||
* @brief Low-level log output
|
||||
*/
|
||||
|
||||
#ifndef CHIPPER_LOG_H
|
||||
#define CHIPPER_LOG_H
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
typedef struct {
|
||||
const char *path;
|
||||
FILE *file;
|
||||
} ChipperLog;
|
||||
|
||||
int chipper_log_open(ChipperLog *log, const char *path);
|
||||
void chipper_log_close(ChipperLog *log);
|
||||
int chipper_log_write(ChipperLog *log, const char *timestamp, const char *line);
|
||||
|
||||
#endif // CHIPPER_LOG_H
|
||||
Reference in New Issue
Block a user