]> git.sesse.net Git - freerainbowtables/blob - Server Applications/rtperfecter0.0/RTRead.h
initial
[freerainbowtables] / Server Applications / rtperfecter0.0 / RTRead.h
1 /*
2         Copyright (C) 2008 Steve Thomas <SMT837784@yahoo.com>
3
4         This file is part of RT Perfecter v0.0.
5
6         RT Perfecter v0.0 is free software: you can redistribute it and/or modify
7         it under the terms of the GNU General Public License as published by
8         the Free Software Foundation, either version 3 of the License, or
9         (at your option) any later version.
10
11         RT Perfecter v0.0 is distributed in the hope that it will be useful,
12         but WITHOUT ANY WARRANTY; without even the implied warranty of
13         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14         GNU General Public License for more details.
15
16         You should have received a copy of the GNU General Public License
17         along with RT Perfecter v0.0.  If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #ifndef RTREAD_H
21 #define RTREAD_H
22
23 #include <sys/types.h>
24 #include "RTCommon.h"
25
26 struct FileList
27 {
28         char *name;
29         unsigned int chains;
30         FILE *pFile;
31         FileList *next;
32 };
33
34 struct PriorityQueueNode
35 {
36         RTChain chain;
37         FILE *pFile;
38         char *fName;
39 };
40
41 class RTRead
42 {
43 public:
44          RTRead(char *dir, uint64 maxIndex, int verbose);
45         ~RTRead();
46
47         int readChain(RTChain *c);
48         void printStatus();
49
50 private:
51         int getInfo(char *file, int len, FileList *ret);
52         int readGoodChain(FILE *pFile, RTChain *chain);
53
54         uint64 m_chains, m_chainsRead, m_maxIndex;
55         PriorityQueueNode *m_pq;
56         clock_t m_startTime;
57         unsigned int m_pqSize;
58         int m_verbose;
59 };
60
61 #endif
62