mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-09-29 11:16:29 +03:00
Windows porting: port hyperscan and chimera tools to windows.
This commit is contained in:
@@ -68,8 +68,9 @@ struct ScanCHContext {
|
||||
* "echo matches" is off.
|
||||
*/
|
||||
static
|
||||
int onMatch(unsigned int, unsigned long long, unsigned long long, unsigned int,
|
||||
unsigned int, const ch_capture_t *, void *ctx) {
|
||||
int HS_CDECL onMatch(unsigned int, unsigned long long, unsigned long long,
|
||||
unsigned int, unsigned int, const ch_capture_t *,
|
||||
void *ctx) {
|
||||
ScanCHContext *sc = static_cast<ScanCHContext *>(ctx);
|
||||
assert(sc);
|
||||
sc->result.matches++;
|
||||
@@ -82,8 +83,9 @@ int onMatch(unsigned int, unsigned long long, unsigned long long, unsigned int,
|
||||
* matches" is enabled.
|
||||
*/
|
||||
static
|
||||
int onMatchEcho(unsigned int id, unsigned long long, unsigned long long to,
|
||||
unsigned int, unsigned int, const ch_capture_t *, void *ctx) {
|
||||
int HS_CDECL onMatchEcho(unsigned int id, unsigned long long,
|
||||
unsigned long long to, unsigned int, unsigned int,
|
||||
const ch_capture_t *, void *ctx) {
|
||||
ScanCHContext *sc = static_cast<ScanCHContext *>(ctx);
|
||||
assert(sc);
|
||||
sc->result.matches++;
|
||||
@@ -166,12 +168,23 @@ void EngineChimera::printStats() const {
|
||||
}
|
||||
printf("Signatures: %s\n", compile_stats.signatures.c_str());
|
||||
printf("Chimera info: %s\n", compile_stats.db_info.c_str());
|
||||
#ifndef _WIN32
|
||||
printf("Expression count: %'zu\n", compile_stats.expressionCount);
|
||||
printf("Bytecode size: %'zu bytes\n", compile_stats.compiledSize);
|
||||
#else
|
||||
printf("Expression count: %zu\n", compile_stats.expressionCount);
|
||||
printf("Bytecode size: %zu bytes\n", compile_stats.compiledSize);
|
||||
#endif
|
||||
printf("Database CRC: 0x%x\n", compile_stats.crc32);
|
||||
#ifndef _WIN32
|
||||
printf("Scratch size: %'zu bytes\n", compile_stats.scratchSize);
|
||||
printf("Compile time: %'0.3Lf seconds\n", compile_stats.compileSecs);
|
||||
printf("Peak heap usage: %'u bytes\n", compile_stats.peakMemorySize);
|
||||
#else
|
||||
printf("Scratch size: %zu bytes\n", compile_stats.scratchSize);
|
||||
printf("Compile time: %0.3Lf seconds\n", compile_stats.compileSecs);
|
||||
printf("Peak heap usage: %u bytes\n", compile_stats.peakMemorySize);
|
||||
#endif
|
||||
}
|
||||
|
||||
void EngineChimera::sqlStats(SqlDB &sqldb) const {
|
||||
|
Reference in New Issue
Block a user