xref: /minix3/external/bsd/file/dist/magic/magdir/c-lang (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1ef01931fSBen Gras#------------------------------------------------------------------------------
2*0a6a1f1dSLionel Sambuc# $File: c-lang,v 1.19 2014/06/03 19:17:27 christos Exp $
308ff44c4SLionel Sambuc# c-lang:  file(1) magic for C and related languages programs
4ef01931fSBen Gras#
5ef01931fSBen Gras
608ff44c4SLionel Sambuc# BCPL
708ff44c4SLionel Sambuc0	search/8192	"libhdr"	BCPL source text
808ff44c4SLionel Sambuc!:mime	text/x-bcpl
908ff44c4SLionel Sambuc0	search/8192	"LIBHDR"	BCPL source text
1008ff44c4SLionel Sambuc!:mime	text/x-bcpl
11ef01931fSBen Gras
1208ff44c4SLionel Sambuc# C
1308ff44c4SLionel Sambuc0	regex	\^#include	C source text
1408ff44c4SLionel Sambuc!:mime	text/x-c
15*0a6a1f1dSLionel Sambuc0	regex	\^char[\ \t\n]+	C source text
1608ff44c4SLionel Sambuc!:mime	text/x-c
17*0a6a1f1dSLionel Sambuc0	regex	\^double[\ \t\n]+		C source text
1808ff44c4SLionel Sambuc!:mime	text/x-c
19*0a6a1f1dSLionel Sambuc0	regex	\^extern[\ \t\n]+		C source text
2008ff44c4SLionel Sambuc!:mime	text/x-c
21*0a6a1f1dSLionel Sambuc0	regex	\^float[\ \t\n]+		C source text
2208ff44c4SLionel Sambuc!:mime	text/x-c
23*0a6a1f1dSLionel Sambuc0	regex	\^struct[\ \t\n]+		C source text
2408ff44c4SLionel Sambuc!:mime	text/x-c
25*0a6a1f1dSLionel Sambuc0	regex	\^union[\ \t\n]+		C source text
2608ff44c4SLionel Sambuc!:mime	text/x-c
2708ff44c4SLionel Sambuc0	search/8192	main(		C source text
2808ff44c4SLionel Sambuc!:mime	text/x-c
29ef01931fSBen Gras
3008ff44c4SLionel Sambuc# C++
3108ff44c4SLionel Sambuc# The strength of these rules is increased so they beat the C rules above
32*0a6a1f1dSLionel Sambuc0	regex	\^template[\ \t\n]+	C++ source text
3384d9c625SLionel Sambuc!:strength + 5
3408ff44c4SLionel Sambuc!:mime	text/x-c++
35*0a6a1f1dSLionel Sambuc0	regex	\^virtual[\ \t\n]+		C++ source text
3684d9c625SLionel Sambuc!:strength + 5
3708ff44c4SLionel Sambuc!:mime	text/x-c++
38*0a6a1f1dSLionel Sambuc0	regex	\^class[\ \t\n]+		C++ source text
3984d9c625SLionel Sambuc!:strength + 5
4008ff44c4SLionel Sambuc!:mime	text/x-c++
4108ff44c4SLionel Sambuc0	regex	\^public:		C++ source text
4284d9c625SLionel Sambuc!:strength + 5
4308ff44c4SLionel Sambuc!:mime	text/x-c++
4408ff44c4SLionel Sambuc0	regex	\^private:		C++ source text
4584d9c625SLionel Sambuc!:strength + 5
4608ff44c4SLionel Sambuc!:mime	text/x-c++
47ef01931fSBen Gras
48ef01931fSBen Gras# From: Mikhail Teterin <mi@aldan.algebra.com>
49ef01931fSBen Gras0	string		cscope		cscope reference data
50ef01931fSBen Gras>7	string		x		version %.2s
51ef01931fSBen Gras# We skip the path here, because it is often long (so file will
52ef01931fSBen Gras# truncate it) and mostly redundant.
53*0a6a1f1dSLionel Sambuc# The inverted index functionality was added some time between
54ef01931fSBen Gras# versions 11 and 15, so look for -q if version is above 14:
55ef01931fSBen Gras>7	string		>14
56ef01931fSBen Gras>>10	search/100	\ -q\ 		with inverted index
57ef01931fSBen Gras>10	search/100	\ -c\ 		text (non-compressed)
58