source: icGREP/icgrep-devel/icgrep/grep_engine.h @ 5400

Last change on this file since 5400 was 5400, checked in by cameron, 2 years ago

Eliminate struct/class and unused variable warnings

File size: 2.0 KB
Line 
1/*
2 *  Copyright (c) 2016 International Characters.
3 *  This software is licensed to the public under the Open Software License 3.0.
4 *  icgrep is a trademark of International Characters.
5 */
6#ifndef DO_GREP_H
7#define DO_GREP_H
8#include <grep_type.h>  // for GrepType, GrepType::Normal
9#include <string>       // for string
10#include <vector>
11namespace llvm { class ExecutionEngine; }
12namespace llvm { class Module; }
13namespace re { class CC; }
14namespace re { class RE; }
15
16class GrepEngine {
17    typedef void (*GrepFunctionType)(char * byte_data, size_t filesize, const int fileIdx);
18    typedef uint64_t (*GrepFunctionType_CountOnly)(char * byte_data, size_t filesize, const int fileIdx);
19    typedef void (*GrepFunctionType_CPU)(char * rslt, char * LineBreak, char * byte_data, size_t filesize, const int fileIdx);
20public:
21
22    GrepEngine();
23    ~GrepEngine();
24 
25    void grepCodeGen(std::string moduleName, re::RE * re_ast, bool CountOnly, bool UTF_16 = false, GrepType grepType = GrepType::Normal, const bool usingStdIn = false);
26
27    void multiGrepCodeGen(std::string moduleName, std::vector<re::RE *> REs, bool CountOnly, bool UTF_16 = false, GrepType grepType = GrepType::Normal, const bool usingStdIn = false);
28     
29    void doGrep(const std::string & fileName, const int fileIdx, bool CountOnly, std::vector<size_t> & total_CountOnly);
30
31    void doGrep(const int fileIdx, bool CountOnly, std::vector<size_t> & total_CountOnly);
32   
33    re::CC *  grepCodepoints();
34
35    const std::vector<std::string> & grepPropertyValues(const std::string & propertyName);
36   
37private:
38   
39    GrepFunctionType mGrepFunction;
40    GrepFunctionType_CountOnly mGrepFunction_CountOnly;
41#ifdef CUDA_ENABLED
42    GrepFunctionType_CPU mGrepFunction_CPU;
43#endif
44    llvm::ExecutionEngine * mEngine;
45};
46
47void icgrep_Linking(llvm::Module * m, llvm::ExecutionEngine * e);
48
49
50re::CC * getParsedCodePointSet();
51void setParsedCodePointSet();
52
53void setParsedPropertyValues();
54
55void initFileResult(std::vector<std::string> filenames);
56void PrintResult(bool CountOnly, std::vector<size_t> & total_CountOnly);
57
58#endif
Note: See TracBrowser for help on using the repository browser.