\ThisIsLanguage{C}
\input highlighting_common.tex

%%%%%%%%%%*******    Definition of colours and styles for each category    *******%%%%%%%%%%

\DefineColor{comment}{0, .5, 0}
\DefineColor{blue}{0,0,1} % Keyword
\DefineColor{typedef}{0, 0, .68}
\DefineColor{constant}{0.17, 0.57, 0.69} %enum constants and constexpr identifiers
\DefineColor{function}{0.31, 0.22, 0.08}
\DefineColor{tgfunction}{0.28, .1, 0.1}
\DefineColor{macro}{.5, 0, .5}
\DefineColor{pragma}{1, 0.5, 0.5}
\DefineColor{tag}{.4, 0.3, 0} %Struct, union and enum tags
\DefineColor{red}{1,0,0} %Strings
\DefineColor{orange}{0.8, 0.3, 0} %Character literals
\DefineGray{gray4}{0.33} %For obsolescent
\DefineColor{deprecated}{0.66, 0.66, 0.35} %For [deprecated] and the splice char

\TcodeEdefFormat{SpliceChar}{\ColFill{deprecated}} %A \ at end of line

%We use \color for comments and string instead of \ColFill because they may contain hand crafted rules.
\TcodeEdefFormat{Comment}{\color{comment}}
\TcodeEdefFormat{String}{\color{red}}
\TcodeEdefFormat{CharLit}{\color{orange}}

\TCopyFormat{IntegerSuffix}{Number} %Tcode's default does nothing
\TCopyFormat{FloatingSuffix}{Number}

\TcodeEdefFormat{PPDirective}{\ColFill{blue}}
\TCopyFormat{PPOperator}{PPDirective}
\TcodeEdefFormat{Pragma}{\ColFill{pragma}}
\TcodeEdefFormat{PragmaValue}{\ColFill{pragma}}
\TcodeEdefFormat{PPParameter}{\ColFill{pragma}}

\TcodeEdefFormat{Keyword}{\ColFill{blue}}

\TcodeEdefFormat{Function}{\ColFill{function}}
\TcodeEdefFormat{TGFunction}{\ColFill{tgfunction}} %type generic functions
		\TCopyFormat{QGFunction}{TGFunction}

%Identifiers that are both function and TG-function, like acos, may be defined to either of them or to
%\FormatFuncTGFunc. But this is not defined. The user must redirect them to Function or to TGFunction.
%We route them by default to TGFunction.
\TcodeRedirect{FuncTGFunc}{TGFunction}

\TcodeEdefFormat{Typedef}{\ColFill{typedef}}
\TcodeEdefFormat{StandsForType}{\ColFill{typedef}}
\TcodeEdefFormat{Macro}{\ColFill{macro}}
\TCopyFormat{NamedIdent}{Macro} %__func__, errno, stdin...

\TcodeEdefFormat{Attribute}{\ColFill{tag}}
\TcodeEdefFormat{Struct}{\ColFill{tag}} %Struct tag
\TcodeEdefFormat{Union}{\ColFill{tag}} %Union tag
\TcodeEdefFormat{Enum}{\ColFill{tag}} %Enum tag
\TcodeEdefFormat{StrMember}{\ColFill{member}}
\TcodeEdefFormat{UnionMember}{\ColFill{member}}
\TcodeEdefFormat{EnumConst}{\ColFill{constant}}

\TcodeEdefFormat{Obsolete}{\ColFill{gray4}} %Obsolescent
\TcodeEdefFormat{Deprecated}{\ColFill{deprecated}} %Identifiers marked [deprecated]

\input C_subcategories.tex