066562760a5112eb7240baa361f1edca58c9dbba
[dragonfly.git] / contrib / file / magic / Magdir / c-lang
1 #------------------------------------------------------------------------------
2 # $File: c-lang,v 1.16 2011/12/09 08:02:16 rrt Exp $
3 # c-lang:  file(1) magic for C and related languages programs
4 #
5
6 # BCPL
7 0       search/8192     "libhdr"        BCPL source text
8 !:mime  text/x-bcpl
9 0       search/8192     "LIBHDR"        BCPL source text
10 !:mime  text/x-bcpl
11
12 # C
13 0       regex   \^#include      C source text
14 !:mime  text/x-c
15 0       regex   \^char          C source text
16 !:mime  text/x-c
17 0       regex   \^double                C source text
18 !:mime  text/x-c
19 0       regex   \^extern                C source text
20 !:mime  text/x-c
21 0       regex   \^float         C source text
22 !:mime  text/x-c
23 0       regex   \^struct                C source text
24 !:mime  text/x-c
25 0       regex   \^union         C source text
26 !:mime  text/x-c
27 0       search/8192     main(           C source text
28 !:mime  text/x-c
29
30 # C++
31 # The strength of these rules is increased so they beat the C rules above
32 0       regex   \^template      C++ source text
33 !:strength + 10
34 !:mime  text/x-c++
35 0       regex   \^virtual               C++ source text
36 !:strength + 10
37 !:mime  text/x-c++
38 0       regex   \^class         C++ source text
39 !:strength + 10
40 !:mime  text/x-c++
41 0       regex   \^public:               C++ source text
42 !:strength + 10
43 !:mime  text/x-c++
44 0       regex   \^private:              C++ source text
45 !:strength + 10
46 !:mime  text/x-c++
47
48 # From: Mikhail Teterin <mi@aldan.algebra.com> 
49 0       string          cscope          cscope reference data
50 >7      string          x               version %.2s
51 # We skip the path here, because it is often long (so file will
52 # truncate it) and mostly redundant.
53 # The inverted index functionality was added some time betwen
54 # versions 11 and 15, so look for -q if version is above 14:
55 >7      string          >14
56 >>10    search/100      \ -q\           with inverted index
57 >10     search/100      \ -c\           text (non-compressed)