-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkabilookup.h
More file actions
98 lines (88 loc) · 2.6 KB
/
Copy pathkabilookup.h
File metadata and controls
98 lines (88 loc) · 2.6 KB
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/* kabi-lookup.h
*
* Copyright (C) 2015 Red Hat Inc.
* Tony Camuso <tcamuso@redhat.com>
*
* This 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., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef KABILOOKUP_H
#define KABILOOKUP_H
#include <map>
#include <vector>
#include <dirent.h>
#include "kabi-map.h"
#include "options.h"
#include "error.h"
#include "rowman.h"
class lookup
{
public:
lookup(){}
lookup(int argc, char **argv);
int run();
static std::string get_helptext();
static std::string get_version();
private:
int process_args(int argc, char **argv);
bool check_flags();
int count_bits(unsigned mask);
int get_parents(cnode &cn);
int get_children(dnode& pdn, cnode &pcn);
int get_siblings(dnode& dn);
int get_siblings_up(dnode& dn);
int get_siblings_exported(dnode& dn);
int execute(std::string datafile);
int exe_count();
int exe_struct();
int exe_exports();
int exe_decl();
int get_file_of_export(dnode& dn);
int set_working_directory();
int set_start_directory() ;
void report_nopath(const char *name, const char *path);
void assure_trailing_slash(std::string& dirspec);
bool is_dup(crc_t crc);
bool is_whitelisted(std::string& ksym);
bool is_function_whitelisted(cnode& cn);
bool build_whitelist();
bool check_whitelist();
// member classes
dnodemap& m_dnmap = kb_get_public_dnodemap();
rowman m_rowman;
options m_opts;
error m_err;
// member basetypes
typedef std::pair<int, std::string> errpair;
//std::vector<errpair> m_errors;
std::vector<crc_t> m_dups;
std::vector<std::string> m_whitelist;
std::vector<std::string> m_errvec;
std::string m_declstr;
std::string m_maskstr;
std::string m_datafile = "../kabi-data.dat";
std::string m_filelist = "kabi-datafiles.list";
std::string m_startdir;
std::string m_userdir;
std::string m_kabidir = "redhat/kabi/";
DIR *m_kbdir;
crc_t m_crc;
bool m_isfound = false;
int m_count = 0;
int m_flags = KB_QUIET;
int m_errindex = 0;
int m_exemask = KB_COUNT | KB_DECL | KB_EXPORTS | KB_STRUCT;
};
#endif // KABILOOKUP_H