diff options
Diffstat (limited to 'src/dbx.h')
| -rw-r--r-- | src/dbx.h | 35 |
1 files changed, 26 insertions, 9 deletions
@@ -9,6 +9,30 @@ #include <stddef.h> #include <stdint.h> +#define COUNTOF(x) ((sizeof(x)) / (sizeof(*x))) + +void dbx_printerr(const char *format, ...); +void dbx_perror(const char *s, int e); + +enum dbx_proc_output { + DBXP_NONE = 0, + DBXP_STDOUT = 1, + DBXP_STDERR = 2, + DBXP_ALL = 3, +}; +bool dbx_proc_find(const char *name, char path[PATH_MAX]); +int dbx_proc_run(const char *const command[], enum dbx_proc_output out); +bool dbx_proc_exec(const char *const command[]); + +bool dbx_ssh_init(const char *name); +bool dbx_ssh_set_hostname(const char *name, const char *hostname); + +struct dbx_engine; +struct dbx_engine *dbx_engine_init(void); +bool dbx_engine_create(struct dbx_engine *engine, const char *image, + const char *name, uint16_t sshd_port); +void dbx_engine_destroy(struct dbx_engine *engine); + struct dbx_options { char *command; char *name; @@ -17,15 +41,8 @@ struct dbx_options { uint16_t container; uint16_t host; } ports; + char *post_install; }; - -#define COUNTOF(x) ((sizeof(x)) / (sizeof(*x))) - -void dbx_printerr(const char *format, ...); -void dbx_perror(const char *s, int e); - -bool dbx_proc_find(const char *name, char path[PATH_MAX]); -int dbx_proc_run(char *const command[]); -bool dbx_proc_exec(char *const command[]); +int dbx_create(struct dbx_engine *engine, struct dbx_options const *options); #endif |
