home *** CD-ROM | disk | FTP | other *** search
- /* Copyright (c) 1994, 1995 by Oracle Corporation. All Rights Reserved.
- *
- * ysl.h - Console Operations
- *
- * DESCRIPTION
- * The console manager provides access to the standard I/O equivalents
- * of stdin, stdout, and stderr. The guidelines for their usage are
- * as follows:
- * libraries & servers - libraries should assume only the existence
- * of stderr. Attempts to print to stdout may either be ignored or
- * sent to the stderr. Attempts to read from stdin will usually
- * fail.
- * utilities - utilities may assume the existence of stdin, stdout,
- * and stderr.
- *
- * The mappings of the console may change over the lifetime of the
- * program, but this should not affect program behavior or the semantics
- * of when and how the console is used.
- *
- * ATTRS: public, internal
- */
-
- #ifndef YSL_ORACLE
- #define YSL_ORACLE
-
- #ifndef SYSX_ORACLE
- #include <sysx.h>
- #endif
- #ifndef YS_ORACLE
- #include <ys.h>
- #endif
-
- EXTC_START
-
- /*
- * yslPrint - print to stdout
- *
- * DESCRIPTION
- * yslPrint() performs functionality equivalent to printf(fmt, ...).
- */
- void yslPrint(CONST char *fmt, ...);
-
- /*
- * yslError - print to stderr
- *
- * DESCRIPTION
- * yslError() performs functionality equivalent to fprintf(stderr, fmt, ...).
- * It automatically appends a newline if none appears in the fmt string.
- * If a process has called yslDetach(), output from subsequent yslError()
- * calls will go to the "system" console or osd defined log file (see
- * syslConsole).
- */
- void yslError(CONST char *fmt, ...);
-
- /*
- * yslGets - get input from stdin
- *
- * DESCRIPTION
- * yslGets() performs functionality similar to gets(). It reads from
- * stdin until a newline or EOF is encountered. The characters are
- * transferred to buf (up to a maximum of max-1 characters). The
- * trailing newline or EOF is discarded and a null character is
- * inserted into the buffer.
- *
- * yslGets() returns TRUE as long as characters continue to be read.
- * If EOF is encountered and no characters were read, yslGets() will
- * return FALSE.
- */
- boolean yslGets(char *buf, size_t maximum);
-
- /*
- * yslDetach - detach the process from the console
- *
- * DESCRIPTION
- * yslDetach() is used to detach the process from the console. At
- * process startup, the process is attached to a console (although
- * it may only support standard error output). yslDetach() forcibly
- * detaches the process from the console. This has several ramifications:
- * + yslPrint() and yslGets() may not be used following this call;
- * + If remote communication (ytInit()) has been started, output
- * from yslError() is redirected to a remote console. Otherwise,
- * yslDetach() may attempt to open a logging file to record this
- * output.
- *
- * yslDetach() is idempotent.
- */
- void yslDetach(void);
-
- /*
- * yslIsDetached - test detach status
- *
- * DESCRIPTION
- * yslIsDetached() returns TRUE if yslDetach() has been called previously.
- */
- boolean yslIsDetached(void);
-
- /*
- * Exceptions
- */
- externref ysidDecl(YSL_EX_DETACHED);
-
- EXTC_END
- #endif /* YSL_ORACLE */
-