#------------------------------------------------------------------------------
# Changes:
# 10.06.98 Made "{" a shortcut, which expands to brace set and places caret in the middle. (hmm)
# 16.06.98 Made "*/" a Syntaxword (group4), so it sticks out if the "/*" is missing.
# 29.06.98 Changed ListOfC button to not sort (since functions are often grouped logically)
#          In addition, Select now only searches *this* text, and adjust searches *all* texts.
# 29.06.98 Removed the ^H key binding for the 'load headerfile' function. This is now better
#          catered for by the clicklist (ctrl-Home or just doubleclick with mouse)
# 04.07.98 Dropped the ()'s from include1/2. Can now write A * @5 B
# 09.07.98 Removed the "{" shortcut again. Too damn annoying.
#          Added an "i(" shortcut
# 26.07.98 ctrl-Return will include any "/*" in its auto-indent.
# 22.10.98 Removed "*/" as reserved word. Clashed with " .. (char */*parm_name*/)
# 03.01.99 Removed duplicate 'do' and 'default' from Group1
# 21.07.00 Added #warning and #elif to the directives group (carl) 
#------------------------------------------------------------------------------

HelpPath	C-manuals,

#-------------------------------------------

Search
	include1	[_spct] "#include" _spct "<" [_spct] @0 * @9 ".H" [_spct] ">"
	include2	[_spct] "#include" _spct '"' [_spct] @0 * @9 ".H" [_spct] '"'
	iscomment	"/*"
	wholecomment	"/*" ** "*/"
	isblock		inblock .
	_Indent2	{" "} [ "/*" | "//" ] {" "}
End

Foldparm1 ("/*{{{","/*}}}",startspace,case)

ClickList
	include1	LoadOne ("C:H.<tmp$word>")
	include2	LoadOne ("<tmp$path>.^.H.<tmp$word>")
	iscomment	NoIndent MarkWord(WholeComment) GotoBlock_End CaretLeft CaretLeft DeleteRight DeleteRight GotoBlock_Start DeleteRight DeleteRight BlockClear
	isblock		NoIndent GotoBlock_Start "/*" GotoBlock_End "*/"
End

#-------------------------------------------

ID_FirstChar	A-Za-z_
ID_Middle	A-Za-z_0-9

SyntaxOptions
	SingleQuote	Yes
	DoubleQuote	Yes
	QuoteChar	\
	QuoteQuote	No
	SplitString	Yes
	HexPrefix	0x
End

SyntaxComment 1
	Type		MultiLine
	StartWith	/*
	EndWith		*/
End

SyntaxComment 2
	Type		OneLine
	StartWith	//
End

SyntaxWords Group1 case
	continue
	for while break return goto
	if else switch do default
End

SyntaxWords Group2 case
	auto register static extern typedef
	void char short int long float double signed unsigned
	const volatile
	struct union
End

SyntaxWords Group3 nocase EndOfLine
	#include #if #ifdef #ifndef #else #endif
	#pragma #line #error #define #undef #warning #elif
End

## Make sure superfluous comment-end's stick out
#
#SyntaxWords Group4 nocase
#	"*/"
#End

#----------------------------------------------------------

KeyList
	^[		InsertStr("/*")
	^]		InsertStr("*/")
#	Return		Clicklist("indent")
	^Return		NewLine(indent,_Indent2)
End

#----------------------------------------------------------

Functions

	Key	F2
	Menu	List of functions F2
	Icon	LoF
	Select	ListOfC (Text)
	Help	HCM_lof

	Adjust	ListOfC (All)

	Key 	PgUp
	Icon	up
	Select	GotoPrevC (Text)
	Help	HCM_up

	Key 	PgDown
	Icon	down
	Select	GotoNextC (Text)
	Help	HCM_dn

#	Key	^H
	Menu	Load H.*
	Icon	save
	Help	HCM_ld
	Select	SetTmp() LoadOne ("<tmp$path>.^.H.<tmp$word>","C:H.<tmp$word>")

	Key	F10
	Menu	Save & Compile      F10
	Icon	Run
#	Select	SaveDrag ("cc")
	Select	SetTmp() SaveRun("taskwindow \"gcc <tmp$path>.<tmp$leaf> -mthrowback\" -wimpslot 8000K")
	Help	HCM_run

	Key	^F10
	Menu	Save & Make      ^F10
	Icon	brick
	Select	SetTmp() SaveDClick ("<tmp$path>.^.Makefile")
	Help	HCM_mak

	Key	^G 1
	Menu	Goto function definition
	Icon	goto
	Select	Push GotoFoundC (all)
	Help	HCM_go

	Key	^G 2
	Select	Pop

End

Shortcuts
	w(	while (\@) {\n\i  \@\n\i}
	f(	for (\@;\@;\@) {\n\i  \@\n\i}
	s(	switch (\@) {\n\i  case \@\n\i}
	p(	printf("\@");
	i(	if(\@) \@
	#<	#include <\@.h>\n\@
	#"	#include "\@.h"\n\@
	``-	/*----------------------------------------------------------------------------*/
	``/	/*--- \@  */
	``*	/* \@  */
End
