summaryrefslogtreecommitdiff
path: root/src/command.h
blob: 1ba0e2bd571fc00faff58a01f9e412b7c7a33bc7 (plain) (blame)
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
/*
 *  Copyright (C) 2015  Andrei Karas
 *
 *  This file is part of Paranoid null checker.
 *
 *  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 3 of the License, or
 *  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, see <http://www.gnu.org/licenses/>.
 */

#ifndef COMMAND_H
#define COMMAND_H

#define checkCommand(val) ((command & Command::val) == Command::val)
#define disableCommand(val) command = static_cast<Command>(static_cast<int>( \
    command | Command::val) ^ static_cast<int>(Command::val))
#define enableCommand(val) command = static_cast<Command>(static_cast<int>( \
    command | Command::val))

enum Command : int
{
    Parse              = 0,
    Dump               = 1,
    SmallDump          = 2,
    DumpUnsupported    = 4,
    MemoryUsage        = 8,
    FindArgs           = 16,
    DetectNullPointers = 32,
    DumpNullPointers   = 64,
    DetectUseless      = 128
};

extern Command command;
extern std::string dumpFile;

#endif  // COMMAND_H