Crinit -- Configurable Rootfs Init
crinit-client.h
Go to the documentation of this file.
1 // SPDX-License-Identifier: MIT
6 #ifndef __CRINIT_CLIENT_H__
7 #define __CRINIT_CLIENT_H__
8 
9 #include <bits/types/FILE.h>
10 #include <sched.h>
11 #include <stdarg.h>
12 #include <stdbool.h>
13 
14 #include "crinit-sdefs.h"
15 #include "version.h"
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
30 void crinitClientSetErrStream(FILE *errStream);
40 void crinitClientSetInfoStream(FILE *infoStream);
41 
60 
68 void crinitClientSetNotifyTaskName(const char *taskName);
76 void crinitClientSetSocketPath(const char *sockFile);
84 int crinitClientSetVerbose(bool v);
85 
105 int sd_notify(int unset_environment, const char *state); // NOLINT(readability-identifier-naming)
106  // Rationale: Naming determined by external API.
112 int sd_notifyf(int unset_environment, const char *format, ...); // NOLINT(readability-identifier-naming)
113  // Rationale: Naming determined by external API.
114 
138 int crinitClientTaskAdd(const char *configFilePath, bool overwrite, const char *forceDeps);
156 int crinitClientSeriesAdd(const char *seriesFilePath, bool overwriteTasks);
157 
168 int crinitClientTaskEnable(const char *taskName);
181 int crinitClientTaskDisable(const char *taskName);
192 int crinitClientTaskStop(const char *taskName);
203 int crinitClientTaskKill(const char *taskName);
218 int crinitClientTaskRestart(const char *taskName);
228 int crinitClientTaskGetStatus(crinitTaskState_t *s, pid_t *pid, const char *taskName);
259 
260 #ifdef __cplusplus
261 }
262 #endif
263 
264 #endif /* __CRINIT_CLIENT_H__ */
int crinitClientTaskDisable(const char *taskName)
Definition: crinit-client.c:245
void crinitClientSetErrStream(FILE *errStream)
Definition: crinit-client.c:82
void crinitClientSetSocketPath(const char *sockFile)
Definition: crinit-client.c:96
int crinitClientTaskAdd(const char *configFilePath, bool overwrite, const char *forceDeps)
Definition: crinit-client.c:162
int crinitClientTaskGetStatus(crinitTaskState_t *s, pid_t *pid, const char *taskName)
Definition: crinit-client.c:340
int crinitClientGetVersion(crinitVersion_t *v)
Definition: crinit-client.c:473
int sd_notify(int unset_environment, const char *state)
Definition: crinit-client.c:106
void crinitClientFreeTaskList(crinitTaskList_t *tl)
Definition: crinit-client.c:441
int crinitClientSetVerbose(bool v)
Definition: crinit-client.c:78
int crinitClientTaskEnable(const char *taskName)
Definition: crinit-client.c:221
int crinitClientTaskStop(const char *taskName)
Definition: crinit-client.c:268
int crinitClientGetTaskList(crinitTaskList_t **tl)
Definition: crinit-client.c:369
const crinitVersion_t * crinitClientLibGetVersion(void)
Definition: crinit-client.c:102
void crinitClientSetNotifyTaskName(const char *taskName)
Definition: crinit-client.c:90
int crinitClientSeriesAdd(const char *seriesFilePath, bool overwriteTasks)
Definition: crinit-client.c:195
int crinitClientTaskKill(const char *taskName)
Definition: crinit-client.c:292
int sd_notifyf(int unset_environment, const char *format,...)
Definition: crinit-client.c:135
void crinitClientSetInfoStream(FILE *infoStream)
Definition: crinit-client.c:86
int crinitClientTaskRestart(const char *taskName)
Definition: crinit-client.c:316
int crinitClientShutdown(crinitShutdownCmd_t sCmd)
Definition: crinit-client.c:452
Definitions shared between crinit's public and internal APIs.
crinitShutdownCmd_t
Definition: crinit-sdefs.h:39
unsigned long crinitTaskState_t
Type to store Task state bitmask.
Definition: crinit-sdefs.h:17
Definition: crinit-sdefs.h:33
Definition: version.h:19
Header definitions related to component versioning.