~ubuntu-branches/ubuntu/raring/eucalyptus/raring

« back to all changes in this revision

Viewing changes to storage/imager.h

  • Committer: Package Import Robot
  • Author(s): Brian Thomason
  • Date: 2011-11-29 13:17:52 UTC
  • mfrom: (1.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 185.
  • Revision ID: package-import@ubuntu.com-20111129131752-rq31al3ntutv2vvl
Tags: upstream-3.0.999beta1
ImportĀ upstreamĀ versionĀ 3.0.999beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -*- mode: C; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-
 
2
// vim: set softtabstop=4 shiftwidth=4 tabstop=4 expandtab:
 
3
 
 
4
/*
 
5
 * imager header file
 
6
 */
 
7
 
 
8
#ifndef _IMAGER_H_
 
9
#define _IMAGER_H_
 
10
 
 
11
#include <sys/stat.h> // mode_t
 
12
#include "misc.h"
 
13
#include "map.h"
 
14
#include "vbr.h"
 
15
 
 
16
struct _imager_command;
 
17
 
 
18
typedef struct _imager_param {
 
19
    char * key;
 
20
    char * val;
 
21
} imager_param;
 
22
 
 
23
typedef struct _imager_request {
 
24
    struct _imager_command * cmd;
 
25
    imager_param * params;
 
26
    int index; // of this command in a sequence
 
27
    void * internal;
 
28
} imager_request;
 
29
 
 
30
typedef struct _imager_command {
 
31
    char * name;
 
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);
 
36
} imager_command;
 
37
 
 
38
// common functions used by commands
 
39
 
 
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);
 
52
 
 
53
#endif // _IMAGER_H_