Callbacks | |
Macros | |
_bad_key | Command prompt unknown key callback. |
_chg_properties | Property change event. |
_default | Default extension handler. |
_extension | Buffer load handler. |
_fatal_error | Fatal condition callback. |
_init | Internal macro initialisation. |
_invalid_key | Invalid key event. |
_prompt_begin | Command prompt session begin callback. |
_prompt_end | Command prompt session end callback. |
_startup_complete | Startup event callback. |
main | Macro entry point. |
string _bad_key()
Command prompt unknown key callback.
The _bad_key() callback is executed by GRIEF upon an unknown key being pressed during a command prompt session.
none
The _bad_key() callback should return the replacement string otherwise NULL.
n/a
get_parm, _prompt_begin, _prompt_end, inq_command, inq_cmd_line
void _default( string ext )
Default extension handler.
The _default() callback is executed whenever GRIEF edits a file via the edit_file primitive and a extension specific macro of the format _ext was not available to be executed.
It is provided to allow macros to hooks buffer loads, for example to setup defaults tabs on a file extension basis.
The extension case shall be preserved on case sensitive file-systems otherwise the extension is converted to lower case.
This interface is considered defunct; register_macro is the preferred method of capturing buffer edit events.
ext | File extension. |
nothing
n/a
void _extension( string ext )
Buffer load handler.
The _extension() callback is executed whenever GRIEF edits a file via the edit_file primitive.
It is provided to allow macros to hooks buffer loads, for example to setup defaults tabs before any extension specific settings are applied.
Once executed if defined the extension specific handler shall be executed, which should be named as _ext. If not available the default extension _default handler is executed.
The extension case shall be preserved on case sensitive file-systems otherwise the extension is converted to lower case.
This interface is considered defunct; register_macro is the preferred method of capturing buffer edit events.
ext | File extension. |
nothing
The ext parameter is a GriefEdit extension.
void _fatal_error( int signo, string desc )
Fatal condition callback.
The _fatal_error callback is executed by GriefEdit upon a fatal signal condition being thrown by the operating system; these generally represent editor bugs or possible macro usage violations.
The list of trapped condition is very system dependent, yet the following are generally included.
Constant |
Description |
---|---|
SIGBUS |
Bus error |
SIGSEGV |
Segmentation violation. |
SIGILL |
Illegal instruction. |
SIGFPE |
Floating point error. |
The macro implementation should utilise as few GriefEdit facilities as possible to avoid re-triggering the same condition.
Refer to the core macro for an example.
signo | Integer signal number. |
desc | String containing the signal description. |
The _start_complete should return nothing
n/a
void _init()
Internal macro initialisation.
The _init macro is utilised by the Compiler to set-up file level variables (See: global).
This interface is an internal primitive, reserved for exclusive use by the GRIEF Macro Compiler and may change without notice. Management of variable scoping and argument binding shall be handled automatically by the compiler.
nothing
n/a
void _invalid_key()
Invalid key event.
The _invalid_key callback is a legacy BRIEF interface.
This interface is provided for BRIEF compatibility, if the macro _invalid_key exists, it shall be called instead of any registered macros. When invoked the keystroke awaiting is the invalid key.
none
The _invalid_key callback should return an integer value.
BRIEF compatibility.
void _prompt_begin( string prompt )
Command prompt session begin callback.
The _prompt_begin() callback is executed at the beginning of a command prompt session.
The interface allows the command line history and abbreviations mechanisms to be implemented.
prompt | String containing the prompt. |
nothing
n/a
void _prompt_end()
Command prompt session end callback.
The _prompt_end() callback is executed at the termination of a command prompt session.
none
nothing
n/a
get_parm, _prompt_begin, _bad_key, inq_command, inq_cmd_line
void _startup_complete( int mode )
Startup event callback.
The _startup_complete() callback is executed by GRIEF upon startup.
It is executed after all command line switches have been process, after all command line files have been read in, and after the startup() macro has been called.
The specified mode states the command line status as follows.
0 | No command line files were specified. |
1 | Command line file were specified. |
This callback is utilised by the restore macro to avoid restoring the state of buffers and files when files have been specified on the command line.
mode | Command line operational mode. |
The _start_complete() callback should return the nothing.
n/a
void main()
Macro entry point.
The main macro is an optional callback which may be defined within each macro source module.
Upon a macro load, the macro main is executed if it is present within the macro object. This macro can be used to initialise and perform load-time specific variable initialisation and/or functions.
The main function is indirectly executed on the successful loading of a macro object by the _init entry point.
nothing
n/a
$Id: $
To send feedback on this topic email: grie@gmai l.com fedit
Copyright © Adam Young All Rights Reserved.
Command prompt unknown key callback.
string _bad_key()
Property change event.
void _chg_properties()
Default extension handler.
void _default( string ext )
Buffer load handler.
void _extension( string ext )
Fatal condition callback.
void _fatal_error( int signo, string desc )
Internal macro initialisation.
void _init()
Invalid key event.
void _invalid_key()
Command prompt session begin callback.
void _prompt_begin( string prompt )
Command prompt session end callback.
void _prompt_end()
Startup event callback.
void _startup_complete( int mode )
Macro entry point.
void main()
Retrieve the value of a macro parameter.
int get_parm( [int argument], declare & symbol, [string prompt], [int length = MAXPROMPT], [declare default], [int one = FALSE] )
Retrieve name of last keyboard command.
string inq_command()
Retrieve the command line message.
string inq_cmd_line()
Set window border status.
int borders( [int borders] )
Edit a file.
int edit_file( ... )
Register a callback procedure.
int register_macro( int type, string macro, [int local = FALSE] )
Declare a global variable.
global sym1, sym2, ..;
Load a macro object.
int load_macro( string filename, [int reload = 1] )