home *** CD-ROM | disk | FTP | other *** search
/ Oracle Video Server 3.0.3.1 / OVS_3031_NT.iso / win32 / medianet / server / include / ysl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-09-03  |  3.1 KB  |  104 lines

  1. /* Copyright (c) 1994, 1995 by Oracle Corporation.  All Rights Reserved.
  2.  *
  3.  * ysl.h - Console Operations
  4.  *
  5.  * DESCRIPTION
  6.  * The console manager provides access to the standard I/O equivalents
  7.  * of stdin, stdout, and stderr.   The guidelines for their usage are
  8.  * as follows:
  9.  *   libraries & servers - libraries should assume only the existence
  10.  *     of stderr.  Attempts to print to stdout may either be ignored or
  11.  *     sent to the stderr.  Attempts to read from stdin will usually
  12.  *     fail.
  13.  *   utilities - utilities may assume the existence of stdin, stdout,
  14.  *     and stderr.
  15.  *
  16.  * The mappings of the console may change over the lifetime of the
  17.  * program, but this should not affect program behavior or the semantics
  18.  * of when and how the console is used.
  19.  *
  20.  * ATTRS: public, internal
  21.  */
  22.  
  23. #ifndef YSL_ORACLE
  24. #define YSL_ORACLE
  25.  
  26. #ifndef SYSX_ORACLE
  27. #include <sysx.h>
  28. #endif
  29. #ifndef YS_ORACLE
  30. #include <ys.h>
  31. #endif
  32.  
  33. EXTC_START
  34.  
  35. /*
  36.  * yslPrint - print to stdout
  37.  *
  38.  * DESCRIPTION
  39.  * yslPrint() performs functionality equivalent to printf(fmt, ...).
  40.  */
  41. void yslPrint(CONST char *fmt, ...);
  42.  
  43. /*
  44.  * yslError - print to stderr
  45.  *
  46.  * DESCRIPTION
  47.  * yslError() performs functionality equivalent to fprintf(stderr, fmt, ...).
  48.  * It automatically appends a newline if none appears in the fmt string.
  49.  * If a process has called yslDetach(), output from subsequent yslError()
  50.  * calls will go to the "system" console or osd defined log file (see
  51.  * syslConsole).
  52.  */
  53. void yslError(CONST char *fmt, ...);
  54.  
  55. /*
  56.  * yslGets - get input from stdin
  57.  *
  58.  * DESCRIPTION
  59.  * yslGets() performs functionality similar to gets().  It reads from
  60.  * stdin until a newline or EOF is encountered.  The characters are
  61.  * transferred to buf (up to a maximum of max-1 characters).  The
  62.  * trailing newline or EOF is discarded and a null character is
  63.  * inserted into the buffer.
  64.  *
  65.  * yslGets() returns TRUE as long as characters continue to be read.
  66.  * If EOF is encountered and no characters were read, yslGets() will
  67.  * return FALSE.
  68.  */
  69. boolean yslGets(char *buf, size_t maximum);
  70.  
  71. /*
  72.  * yslDetach - detach the process from the console
  73.  *
  74.  * DESCRIPTION
  75.  * yslDetach() is used to detach the process from the console.  At
  76.  * process startup, the process is attached to a console (although
  77.  * it may only support standard error output).  yslDetach() forcibly
  78.  * detaches the process from the console.  This has several ramifications:
  79.  *    + yslPrint() and yslGets() may not be used following this call;
  80.  *    + If remote communication (ytInit()) has been started, output
  81.  *      from yslError() is redirected to a remote console.  Otherwise,
  82.  *      yslDetach() may attempt to open a logging file to record this
  83.  *      output.
  84.  *
  85.  * yslDetach() is idempotent.
  86.  */
  87. void yslDetach(void);
  88.  
  89. /*
  90.  * yslIsDetached - test detach status
  91.  *
  92.  * DESCRIPTION
  93.  * yslIsDetached() returns TRUE if yslDetach() has been called previously.
  94.  */
  95. boolean yslIsDetached(void);
  96.  
  97. /*
  98.  * Exceptions
  99.  */
  100. externref ysidDecl(YSL_EX_DETACHED);
  101.  
  102. EXTC_END
  103. #endif /* YSL_ORACLE */
  104.