summaryrefslogtreecommitdiffstats
path: root/contrib/file/magic/Magdir/c-lang
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2014-06-26 06:03:39 +0000
committerdelphij <delphij@FreeBSD.org>2014-06-26 06:03:39 +0000
commitcd5514ba3b318b16aa00b1048bf9160a9f28fb35 (patch)
tree5b4f7850752944df750e0c678951b78d9484b67e /contrib/file/magic/Magdir/c-lang
parent8b39363d0d5f3d274de63dac41aaba59cdf00cdb (diff)
parent02573f2d7154bbe159ba99728d5db9be8a29bd9b (diff)
downloadFreeBSD-src-cd5514ba3b318b16aa00b1048bf9160a9f28fb35.zip
FreeBSD-src-cd5514ba3b318b16aa00b1048bf9160a9f28fb35.tar.gz
MFV r267843: update file/libmagic to 5.19.
MFC after: 2 weeks
Diffstat (limited to 'contrib/file/magic/Magdir/c-lang')
-rw-r--r--contrib/file/magic/Magdir/c-lang57
1 files changed, 57 insertions, 0 deletions
diff --git a/contrib/file/magic/Magdir/c-lang b/contrib/file/magic/Magdir/c-lang
new file mode 100644
index 0000000..39889ec
--- /dev/null
+++ b/contrib/file/magic/Magdir/c-lang
@@ -0,0 +1,57 @@
+#------------------------------------------------------------------------------
+# $File: c-lang,v 1.19 2014/06/03 19:17:27 christos Exp $
+# c-lang: file(1) magic for C and related languages programs
+#
+
+# BCPL
+0 search/8192 "libhdr" BCPL source text
+!:mime text/x-bcpl
+0 search/8192 "LIBHDR" BCPL source text
+!:mime text/x-bcpl
+
+# C
+0 regex \^#include C source text
+!:mime text/x-c
+0 regex \^char[\ \t\n]+ C source text
+!:mime text/x-c
+0 regex \^double[\ \t\n]+ C source text
+!:mime text/x-c
+0 regex \^extern[\ \t\n]+ C source text
+!:mime text/x-c
+0 regex \^float[\ \t\n]+ C source text
+!:mime text/x-c
+0 regex \^struct[\ \t\n]+ C source text
+!:mime text/x-c
+0 regex \^union[\ \t\n]+ C source text
+!:mime text/x-c
+0 search/8192 main( C source text
+!:mime text/x-c
+
+# C++
+# The strength of these rules is increased so they beat the C rules above
+0 regex \^template[\ \t\n]+ C++ source text
+!:strength + 5
+!:mime text/x-c++
+0 regex \^virtual[\ \t\n]+ C++ source text
+!:strength + 5
+!:mime text/x-c++
+0 regex \^class[\ \t\n]+ C++ source text
+!:strength + 5
+!:mime text/x-c++
+0 regex \^public: C++ source text
+!:strength + 5
+!:mime text/x-c++
+0 regex \^private: C++ source text
+!:strength + 5
+!:mime text/x-c++
+
+# From: Mikhail Teterin <mi@aldan.algebra.com>
+0 string cscope cscope reference data
+>7 string x version %.2s
+# We skip the path here, because it is often long (so file will
+# truncate it) and mostly redundant.
+# The inverted index functionality was added some time between
+# versions 11 and 15, so look for -q if version is above 14:
+>7 string >14
+>>10 search/100 \ -q\ with inverted index
+>10 search/100 \ -c\ text (non-compressed)
OpenPOWER on IntegriCloud