summaryrefslogtreecommitdiffstats
path: root/ecc/src/main.h
blob: c4f04a0530eba9353095ad40f005b489b78162af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/*
 *   Copyright (c) International Business Machines Corp., 2012
 *
 *   This program is free software;  you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
 *   the GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program;  if not, write to the Free Software
 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 */

/*
 *    File: main.h
 *  Author: Shaun Wetzstein <shaun@us.ibm.com>
 *   Descr: cmdline tool for ECC
 *    Date: 08/30/2012
 */

#ifndef __MAIN_H__
#define __MAIN_H__

#include <stdio.h>

typedef enum {
    c_ERROR = 0,
    c_INJECT = 'I',
    c_REMOVE = 'R',
    c_HEXDUMP = 'H',
} cmd_t;

typedef enum {
    o_ERROR = 0,
    o_OUTPUT = 'o',
} option_t;

typedef enum {
    f_ERROR = 0,
    f_FORCE = 'f',
    f_P8 = 'p',
    f_VERBOSE = 'v',
    f_HELP = 'h',
} flag_t;

typedef struct {
    const char * short_name;

    /* target */
    const char * path;

    /* command */
    cmd_t cmd;

    /* options */
    const char * file;

    /* flags */
    flag_t force, p8, verbose;

    const char ** opt;
    int opt_sz, opt_nr;
} args_t;

extern args_t args;

#define ECC_MAJOR	0x02
#define ECC_MINOR	0x00
#define ECC_PATCH	0x00

#define ECC_EXT		".ecc"

#endif /* __MAIN_H__ */
OpenPOWER on IntegriCloud