# C mode

colorize C {
    SyntaxParser = 'C';

    color {
	{ 'Normal',	   'Editor_Default' },
	{ 'Number',	   'Lang_DecimalNumber' },
	{ 'HexNumber',	   'Lang_HexNumber' },
	{ 'Punctuation',   'Lang_Punctuation' },
	{ 'String',	   'Lang_String' },
	{ 'Comment',	   'Lang_Comment' },
	{ 'CPreprocessor', 'Lang_Preprocessor' },
	{ 'Function',	   'Lang_Function' },
	{ 'Label',	   'Lang_Label' },
    };

    keyword 'Editor_Keywords' { # any missing ?
	# standard C keywords
	'asm',
	'break',
	'case',
	'const',
	'continue',
	'default',
	'do',
	'else',
	'enum',
	'extern',
	'for',
	'goto',
	'if',
	'inline',
	'return',
	'sizeof',
	'struct',
	'switch',
	'typedef',
	'union',
	'while',

	# C++ keywords
	'and',
	'and_eq',
	'bad_cast',
	'bad_typeid',
	'bitand',
	'bitor',
	'catch',
	'class',
	'compl',
	'const_cast',
	'delete',
	'dynamic_cast',
	'except',
	'explicit',
	'export',
	'finally',
	'friend',
	'namespace',
	'new',
	'not',
	'not_eq',
	'operator',
	'or',
	'or_eq',
	'private',
	'protected',
	'public',
	'reinterpret_cast',
	'static_cast',
	'template',
	'this',
	'throw',
	'try',
	'typeid',
	'typename',
	'typeof',
	'type_info',
	'using',
	'virtual',
	'xor',
	'xor_eq',

	# types
	'auto',
	'char',
	'double',
	'float',
	'int',
	'int16_t',
	'int32_t',
	'int64_t',
	'int8_t',
	'long',
	'register',
	'short',
	'signed',
	'static',
	'uint',
	'uint16_t',
	'uint32_t',
	'uint64_t',
	'uint8_t',
	'unsigned',
	'u_char',
	'u_int16_t',
	'u_int32_t',
	'u_int64_t',
	'u_int8_t',
	'void',
	'volatile',

	# types C++
	'bool',
	'mutable',

	# wide char (from new C/C++ 1998/1999 standards):
	'wchar_t',

	'cdecl',
	'pascal',
	'_asm',
	'_cdecl',
	'_export',
	'_far16',
	'_fastcall',
	'_pascal',
	'_stdcall',
	'_syscall',
	'__asm',
	'__cdecl',
	'__export',
	'__far16',
	'__fastcall',
	'__pascal',
	'__stdcall',
	'__syscall',
	# some gcc extensions
	'__asm__',
	'__attribute__',
	'__format__',
	'__printf__',
    };
    # show these as numbers
    # True, TRUE, False, FALSE, NULL are commonly defined values
    # but they are not part of C lang
    keyword 'Lang_DecimalNumber' {
	'true',
	'True',
	'TRUE',
	'false',
	'False',
	'FALSE',
	'NULL',
    };

}

mode C: PLAIN {      # C/C++ Mode
    FileNameRx		= /\.\c{c|h|{cpp}|{cxx}|{hpp}|{cc}|{xs}}$/;
    HilitOn		= 1;
    Colorizer		= 'C';
    AutoIndent		= 1;
    IndentMode		= 'C';
    MatchCase		= 1;
    Trim		= 1;
    MultiLineHilit	= 1;
    AutoHilitParen	= 1;

#    RoutineRegexp	 = /^\w[\w_:*&~]+[\w\\s_:*&~]@\(.*\){\s*\{}?\s*$/;
    RoutineRegexp	= /^\w[\w_:*&~]+[\w\s_:*&~]@\([^;]*$/;
#	RoutineRx      ^\w[\w_:*&]+[\w\s_:*&]@\(
#	RoutineRx      ^{[a-zA-Z0-9_:*&]#\s*}+\(

    SaveFolds		= 2;	  # save fold info at end of line
    CommentStart	= ' /*';
    CommentEnd		= '*/';
%if(UI_KB)
    TabSize		= 8; # think twice before changing this, historically
			     # it's been known to cause a mess in sources ;-)
    SpaceTabs		= 0;
    IndentWithTabs	= 1;
    CursorThroughTabs	= 1;
    DeleteKillTab	= 0;
    DeleteKillBlock	= 0;
    BackSpKillTab	= 0;
    BackSpUnindents	= 0;
    Abbreviations	= 1;
    UndoMoves		= 0;
%endif
}
