Created
March 25, 2016 17:03
-
-
Save isacdaavid/1c14bc8fed56d3cf7d3a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# CCExtractor Sample Exercise No. 1 for GSoC 2016: | |
# Find all functions in CCExtractor. | |
#!/bin/sh | |
SRCDIR="../ccextractor/src/" | |
types="(const|volatile|restrict|atomic|_Atomic|static|extern|inline|signed|unsigned|void|char|short|int|long|float|double|bool|_Bool|size_t|ssize_t|ptrdiff_t|([u]?int(_least|_fast|ptr|max)?[0-9]+_t))+" | |
identifiers="([[:alnum:]]|_)+" | |
for file in $(find "$SRCDIR" -name '*.c' -o -name '*.h'); do | |
#grep PNG_FUNCTION "$file" | |
grep -E --color=always "^[[:space:]]*${types}[[:space:]]${identifiers}[[:space:]]*[(]" "$file" | |
done | |
# repeated | |
# deal with comments | |
# macros? | |
# complex and user-defined data types |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment