1
// -*- mode: C; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-
2
// vim: set softtabstop=4 shiftwidth=4 tabstop=4 expandtab:
11
#include <sys/stat.h> // mode_t
16
struct _imager_command;
18
typedef struct _imager_param {
23
typedef struct _imager_request {
24
struct _imager_command * cmd;
25
imager_param * params;
26
int index; // of this command in a sequence
30
typedef struct _imager_command {
32
char ** (* parameters) (); // returns valid parameter names and info for each
33
int (* validate) (imager_request *); // verifies parameters, returning 0 if all is well
34
artifact * (* requirements) (imager_request *, artifact * prev_art); // checks on inputs, records outputs
35
int (* cleanup) (imager_request *, boolean);
38
// common functions used by commands
40
void err (const char *format, ...);
41
void print_req (imager_request * req);
42
char parse_boolean (const char * s);
43
char * strduplc (const char * s);
44
char * parse_loginpassword (const char * s);
45
long long parse_bytes (const char * s);
46
int verify_readability (const char * path);
47
char * get_euca_home (void);
48
map * get_artifacts_map (void);
49
int ensure_path_exists (const char * path, mode_t mode);
50
int ensure_dir_exists (const char * path, mode_t mode);
51
artifact * skip_sentinels (artifact * a);