summaryrefslogtreecommitdiff
path: root/mk.sh
diff options
context:
space:
mode:
Diffstat (limited to 'mk.sh')
-rw-r--r--mk.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/mk.sh b/mk.sh
new file mode 100644
index 00000000..f1cce2c8
--- /dev/null
+++ b/mk.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+classify_source () {
+ NAME=$(basename $1 .c)
+
+ if grep -q "^REFERENCE(" $1; then
+ echo REFERENCE
+ elif grep -q "define ${NAME}[ (]" $1; then
+ echo MACRO
+ elif grep -q "typedef.* ${NAME}.*;" $1; then
+ echo TYPE
+ elif grep -q "typedef.*{$" $1; then
+ echo TYPE_LONG
+ elif grep -q "struct.*${NAME} {" $1; then
+ echo STRUCT
+ elif grep -q "union.* ${NAME} {" $1; then
+ echo UNION
+ elif grep -q "^[A-Za-z_].* ${NAME};" $1; then
+ echo EXTERN
+ elif grep -q 'TGFN' $1; then
+ echo TGFN
+ else
+ echo FUNCTION
+ fi
+}