File: parseargs.h

package info (click to toggle)
ceccomp 3.5-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,528 kB
  • sloc: ansic: 3,154; python: 653; makefile: 240; sh: 226
file content (66 lines) | stat: -rw-r--r-- 982 bytes parent folder | download
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
#ifndef PARSEARGS
#define PARSEARGS

#include <argp.h>
#include <stdbool.h>
#include <stdint.h>
#include <sys/types.h>

typedef enum
{
  ASM_MODE = 0,
  DISASM_MODE = 1,
  EMU_MODE = 2,
  TRACE_MODE = 3,
  TRACE_PID_MODE = 4,
  TRACE_PROG_MODE = 5,
  PROBE_MODE = 6,
  HELP_MODE = 7,
  VERSION_MODE = 8,
  HELP_ABNORMAL = 9,
} subcommand;

typedef enum
{
  HEXLINE = 0,
  HEXFMT = 1,
  RAW = 2
} print_mode;

typedef enum
{
  ALWAYS = 0,
  AUTO = 1,
  NEVER = 2
} color_mode;

struct ceccomp_args
{
  subcommand mode;

  uint32_t arch_token;
  FILE *read_fp;
  FILE *output_fp;
  char *file_name;

  print_mode fmt_mode;

  bool quiet;
  color_mode color;
  char *syscall_nr;
  uint64_t sys_args[6];
  uint64_t ip;

  uint64_t program_idx;
  pid_t pid;
};

typedef struct ceccomp_args ceccomp_args;

#define ARG_INIT_VAL (uint64_t)-1

extern uint64_t strtoull_check (char *num, int base, char *err);

extern error_t parse_opt (int key, char *arg, struct argp_state *state);

#endif