Files
yara/tests/convention-portable-modifiers
T
Victor M. AlvarezandSimon Hardy-Francis cba6932759 Implement non-blocking API (#1428)
With this change the yr_scanner_scan_mem_blocks function can return ERROR_BLOCK_NOT_READY when the YR_MEMORY_BLOCK_ITERATOR that provides memory blocks to the function is not ready to return the next block. After this error the caller can retry the call to yr_scanner_scan_mem_blocks multiple times until the function succeeds or fails with some other error code.

Co-authored-by: Simon Hardy-Francis <[email protected]>
2020-12-24 10:46:09 +01:00

23 lines
681 B
Bash
Executable File

#!/bin/sh
# pseudo code:
# - find all .[ch] files in libyara/
# - grep for non-portable modifiers
set -e
find . -type f | egrep "\.[ch]$" | xargs egrep --line-number "\%\'{0,1}l[dux]" | perl -lane '
printf qq[- convention: non-portable modifier: %s\n], $_;
$single_quote = chr(0x27);
s~\%$single_quote{0,1}l([dux])~\%" PRI${1}64 "~g;
printf qq[- convention: portable modifier: %s\n], $_;
$violation_count ++;
sub END {
if ($violation_count > 0) {
printf qq[- convention: non-portable modifier: %u instances found above; please fix\n], $violation_count;
exit(1);
}
printf qq[- convention: non-portable modifier: none found\n];
}'
exit 0