#ifndef SRVCTRL_H
#define SRVCTRL_H
#include "../public/nsapi.h"
#include "../../ucx/string.h"
#include "config.h"
#ifdef __cplusplus
extern "C" {
#endif
#define SRV_MSG_RESPONSE 0
#define SRV_MSG_LOG 1
typedef struct {
int fd;
} SrvCtrlClient;
int srvctrl_init(ServerConfiguration *cfg);
int srvctrl_wait();
void srvctrl_shutdown();
SrvCtrlClient* srvctrl_create_client(
int fd);
void* srvctrl_thread(SrvCtrlClient *client);
int srvctrl_handle_cmd(SrvCtrlClient *client,
sstr_t cmd);
void srvctrl_log(SrvCtrlClient *client,
char *msg,
size_t len);
#ifdef __cplusplus
}
#endif
#endif