Port I/O


Functions

muse_cell fn_port_p (muse_env *env, void *context, muse_cell args)
 (port? p).
muse_cell fn_close (muse_env *env, void *context, muse_cell args)
 (close port).
muse_cell fn_eof_p (muse_env *env, void *context, muse_cell args)
 (eof? port).
muse_cell fn_print (muse_env *env, void *context, muse_cell args)
 (print -expressions-).
muse_cell fn_write (muse_env *env, void *context, muse_cell args)
 (write -expressions-).
muse_cell fn_read (muse_env *env, void *context, muse_cell args)
 (read [port])
muse_cell fn_flush (muse_env *env, void *context, muse_cell args)
 (flush [port]).
muse_cell fn_load (muse_env *env, void *context, muse_cell args)
 (load "file.lisp")
muse_cell fn_write_xml (muse_env *env, void *context, muse_cell args)
 (write-xml [port] xml-node [flags]).
muse_cell fn_exit (muse_env *env, void *context, muse_cell args)
 (exit).

Function Documentation

muse_cell fn_port_p ( muse_env env,
void *  context,
muse_cell  args 
)

(port? p).

Returns p if it is a port indeed, and () otherwise.

muse_cell fn_close ( muse_env env,
void *  context,
muse_cell  args 
)

(close port).

Closes the given port.

muse_cell fn_eof_p ( muse_env env,
void *  context,
muse_cell  args 
)

(eof? port).

Returns T if the port has reached end of stream. Returns () if it hasn't reached end of stream.

muse_cell fn_print ( muse_env env,
void *  context,
muse_cell  args 
)

(print -expressions-).

Prints each expression to the standard output in sequence. Strings are printed without the quotes, so print can be used to print out messages for the user.

muse_cell fn_write ( muse_env env,
void *  context,
muse_cell  args 
)

(write -expressions-).

Writes the s-expressions to the standard output in sequence. Tries to write an s-expression such that it can be read back in using read, meaning strings will be enclosed in double quotes.

muse_cell fn_read ( muse_env env,
void *  context,
muse_cell  args 
)

(read [port])

Reads a single sexpr from the standard input stream.

muse_cell fn_flush ( muse_env env,
void *  context,
muse_cell  args 
)

(flush [port]).

Flushes the accumulated output on the given port. If no port is given, flushes stdout.

muse_cell fn_load ( muse_env env,
void *  context,
muse_cell  args 
)

(load "file.lisp")

Reads and evaluates all expressions in the given file and returns the value of the last expression.

muse_cell fn_write_xml ( muse_env env,
void *  context,
muse_cell  args 
)

(write-xml [port] xml-node [flags]).

Converts an s-expr representation of an XML node (a tag, not an arbitrary node such as attribute nodes) into XML form and writes it out to the given port. The XML node representation is as follows -

 (tag ((attr1 value1) (attr2 value2) ...)
    body1
    body2
    ...
    )

The flags is a list of symbols that indicate features to use. The only one feature you can indicate is 'with-header which will cause

 <?xml version="1.0" encoding="UTF-8"?>
 
to be written out before the node is written out.

muse_cell fn_exit ( muse_env env,
void *  context,
muse_cell  args 
)

(exit).

Exits the process.


Generated on Mon Sep 25 23:12:50 2006 for muSE by  doxygen 1.4.7