.\"edit a file
.DT
ed
$MUDNAME$ driver help
ed

.SH Name
.SI 5
ed() - edit a file
.EI

.SH Synopsis
.SI 5
void ed( string file, string exit_fn, int restricted );
void ed( string file, string write_fn, string exit_fn, int restricted );
.EI

.SH Description
.SP 5 5
This is a funny function. It will start a local editor on an optional
file.  This editor is almost UNIX ed compatible.  When in the editor
type 'h' for help.

The `write_fn' function allows the mudlib to handle file locks and
administrative logging of files modified.  When the editor writes to a
file, the driver will callback the `write_fn' function twice.  The first
time, the function is called before the
write takes place -- `flag' will be 0.  If the function returns 1,
the write will continue,
otherwise it will abort.  The second time, the function is called
after the write has completed -- `flag' will be non-zero.
This callback function should have the form:
.EP

.SI 5
int write_fn( string fname, int flag )
.EI

.SP 5 5
When the editor is exited, the driver will callback the `exit_fn'
function.  This function allows the mudlib to clean up.  This
callback function has the form:
.EP

.SI 5
void exit_fn( void )
.EI

.SP 5 5
The optional `restricted' flag limits the editor's
capabilities, such as inserting a file, and saving using an alternate
file name.
.EP

.SH See also
.SI 5
regexp(), valid_read(), valid_write(), get_save_file_name()
.EI
