1 #------------------------------------------------------------------------------
2 # $File: c-lang,v 1.24 2016/07/01 23:31:13 christos Exp $
3 # c-lang: file(1) magic for C and related languages programs
5 # The strength is to beat standard HTML
8 0 search/8192 "libhdr" BCPL source text
10 0 search/8192 "LIBHDR" BCPL source text
14 0 regex \^#include C source text
17 0 regex \^char[\ \t\n]+ C source text
19 0 regex \^double[\ \t\n]+ C source text
21 0 regex \^extern[\ \t\n]+ C source text
23 0 regex \^float[\ \t\n]+ C source text
25 0 regex \^struct[\ \t\n]+ C source text
27 0 regex \^union[\ \t\n]+ C source text
29 0 search/8192 main( C source text
33 # The strength of these rules is increased so they beat the C rules above
34 0 regex \^template[\ \t]+<.*>[\ \t\n]+ C++ source text
37 0 regex \^virtual[\ \t\n]+ C++ source text
40 0 regex \^class[\ \t\n]+ C++ source text
41 # But class is reduced to avoid beating php (Jens Schleusener)
44 0 regex \^public: C++ source text
47 0 regex \^private: C++ source text
52 0 regex \^#import Objective-C source text
54 !:mime text/x-objective-c
56 # From: Mikhail Teterin <mi@aldan.algebra.com>
57 0 string cscope cscope reference data
58 >7 string x version %.2s
59 # We skip the path here, because it is often long (so file will
60 # truncate it) and mostly redundant.
61 # The inverted index functionality was added some time between
62 # versions 11 and 15, so look for -q if version is above 14:
64 >>10 search/100 \ -q\ with inverted index
65 >10 search/100 \ -c\ text (non-compressed)