72 lines
No EOL
1.5 KiB
C
72 lines
No EOL
1.5 KiB
C
#pragma once
|
|
#include "util.h"
|
|
#include <stdio.h>
|
|
#include <sys/types.h>
|
|
|
|
#include "klist.h"
|
|
|
|
enum klist_command {
|
|
USER,
|
|
LIST,
|
|
TASK,
|
|
};
|
|
|
|
struct klist_app {
|
|
enum klist_command cmd;
|
|
void *cmd_ctx;
|
|
int error;
|
|
klist_logging_ctx *log_ctx;
|
|
klist *handle;
|
|
};
|
|
typedef struct klist_app klist_app;
|
|
|
|
klist_app *klist_app_init(char *db);
|
|
void klist_app_deinit(klist_app *app);
|
|
|
|
enum klist_user_command { USER_GET, USER_CREATE, USER_DELETE };
|
|
struct klist_user_context {
|
|
enum klist_user_command cmd;
|
|
};
|
|
typedef struct klist_user_context klist_user_context;
|
|
|
|
klist_user_context *klist_user_context_init(void);
|
|
void klist_user_context_deinit(klist_user_context *ctx);
|
|
|
|
enum klist_list_command {
|
|
LIST_ADD,
|
|
LIST_EDIT,
|
|
LIST_GET,
|
|
LIST_DELETE,
|
|
};
|
|
struct klist_list_context {
|
|
enum klist_list_command cmd;
|
|
char *name;
|
|
char *desc;
|
|
char **stages;
|
|
size_t stages_len;
|
|
char *preset;
|
|
};
|
|
typedef struct klist_list_context klist_list_context;
|
|
|
|
klist_list_context *klist_list_context_init(void);
|
|
klist_list_context *klist_list_context_get_by_id(klist_list_context *ctx,
|
|
u_int id);
|
|
void klist_list_context_deinit(klist_list_context *ctx);
|
|
|
|
enum klist_task_command {
|
|
TASK_ADD,
|
|
TASK_EDIT,
|
|
TASK_GET,
|
|
TASK_DELETE,
|
|
};
|
|
struct klist_task_context {
|
|
enum klist_task_command cmd;
|
|
char *list;
|
|
char *name;
|
|
char *desc;
|
|
char *stage;
|
|
};
|
|
typedef struct klist_task_context klist_task_context;
|
|
|
|
klist_task_context *klist_task_context_init(void);
|
|
void klist_task_context_deinit(klist_task_context *ctx); |