Inept-excess-verbiage.html 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
  2. <html>
  3. <!-- Created on November 8, 2012 by texi2html 1.82
  4. texi2html was written by:
  5. Lionel Cons <[email protected]> (original author)
  6. Karl Berry <[email protected]>
  7. Olaf Bachmann <[email protected]>
  8. and many others.
  9. Maintained by: Many creative people.
  10. Send bugs and suggestions to <[email protected]>
  11. -->
  12. <head>
  13. <title>avram - a virtual machine code interpreter: 3.9.3.1 Inept excess verbiage</title>
  14. <meta name="description" content="avram - a virtual machine code interpreter: 3.9.3.1 Inept excess verbiage">
  15. <meta name="keywords" content="avram - a virtual machine code interpreter: 3.9.3.1 Inept excess verbiage">
  16. <meta name="resource-type" content="document">
  17. <meta name="distribution" content="global">
  18. <meta name="Generator" content="texi2html 1.82">
  19. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  20. <style type="text/css">
  21. <!--
  22. a.summary-letter {text-decoration: none}
  23. blockquote.smallquotation {font-size: smaller}
  24. pre.display {font-family: serif}
  25. pre.format {font-family: serif}
  26. pre.menu-comment {font-family: serif}
  27. pre.menu-preformatted {font-family: serif}
  28. pre.smalldisplay {font-family: serif; font-size: smaller}
  29. pre.smallexample {font-size: smaller}
  30. pre.smallformat {font-family: serif; font-size: smaller}
  31. pre.smalllisp {font-size: smaller}
  32. span.roman {font-family:serif; font-weight:normal;}
  33. span.sansserif {font-family:sans-serif; font-weight:normal;}
  34. ul.toc {list-style: none}
  35. -->
  36. </style>
  37. </head>
  38. <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
  39. <a name="Inept-excess-verbiage"></a>
  40. <table cellpadding="1" cellspacing="1" border="0">
  41. <tr><td valign="middle" align="left">[<a href="Working-around-library-misfeatures.html#Working-around-library-misfeatures" title="Previous section in reading order"> &lt; </a>]</td>
  42. <td valign="middle" align="left">[<a href="Memory-leaks.html#Memory-leaks" title="Next section in reading order"> &gt; </a>]</td>
  43. <td valign="middle" align="left"> &nbsp; </td>
  44. <td valign="middle" align="left">[<a href="Library-Reference.html#Library-Reference" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
  45. <td valign="middle" align="left">[<a href="Working-around-library-misfeatures.html#Working-around-library-misfeatures" title="Up section"> Up </a>]</td>
  46. <td valign="middle" align="left">[<a href="Character-Table.html#Character-Table" title="Next chapter"> &gt;&gt; </a>]</td>
  47. <td valign="middle" align="left"> &nbsp; </td>
  48. <td valign="middle" align="left"> &nbsp; </td>
  49. <td valign="middle" align="left"> &nbsp; </td>
  50. <td valign="middle" align="left"> &nbsp; </td>
  51. <td valign="middle" align="left">[<a href="avram.html#Top" title="Cover (top) of document">Top</a>]</td>
  52. <td valign="middle" align="left">[<a href="avram_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
  53. <td valign="middle" align="left">[<a href="Function-Index.html#Function-Index" title="Index">Index</a>]</td>
  54. <td valign="middle" align="left">[<a href="avram_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
  55. </tr></table>
  56. <hr size="1">
  57. <a name="Inept-excess-verbiage-1"></a>
  58. <h4 class="subsubsection">3.9.3.1 Inept excess verbiage</h4>
  59. <p>Although the author of a library function may take pride in putting
  60. its activities on display, it should be assumed that virtual code
  61. applications running on <code>avram</code> have other agendas for the
  62. console, so the library interface module should prevent direct output
  63. from the external library.
  64. </p>
  65. <p>More thoughtful API&rsquo;s may have a verbosity setting, which should be
  66. <a name="index-verbosity-setting"></a>
  67. used in preference to this workaround, but failing that, it is easy to
  68. dispense with console output generated by calls to external library
  69. functions by using some combination of the following functions.
  70. </p>
  71. <dl>
  72. <dt><a name="index-avm_005fturn_005foff_005fstdout"></a><u>Function:</u> void <b>avm_turn_off_stdout</b><i> ()</i></dt>
  73. <dd><p>Calling this function will suppress all output to the standard output
  74. stream until the next time <code>avm_turn_on_stdout</code> is called.
  75. Additional calls to this function without intervening calls to
  76. <code>avm_turn_on_stdout</code> may be made safely with no effect. The
  77. standard output stream is flushed as a side effect of calling this
  78. function.
  79. </p></dd></dl>
  80. <dl>
  81. <dt><a name="index-avm_005fturn_005fon_005fstdout"></a><u>Function:</u> void <b>avm_turn_on_stdout</b><i> ()</i></dt>
  82. <dd><p>Calling this function will allow output to the standard output
  83. stream to resume if it has been suppressed previously by a call to
  84. <code>avm_turn_off_stdout</code>. If <code>avm_turn_off_stdout</code> has not been
  85. previously called, this function has no effect. Any output that would
  86. have been sent to <code>stdout</code> during the time it was turned off will
  87. be lost.
  88. </p></dd></dl>
  89. <dl>
  90. <dt><a name="index-avm_005fturn_005foff_005fstderr"></a><u>Function:</u> void <b>avm_turn_off_stderr</b><i> ()</i></dt>
  91. <dd><p>This function performs a similar service to that of
  92. <code>avm_turn_off_stdout</code> but pertains to the standard error stream.
  93. The standard error and the standard output streams are controlled
  94. independently even if both of them are piped to the same console.
  95. </p></dd></dl>
  96. <dl>
  97. <dt><a name="index-avm_005fturn_005fon_005fstderr"></a><u>Function:</u> void <b>avm_turn_on_stderr</b><i> ()</i></dt>
  98. <dd><p>This function performs a similar service to that of
  99. <code>avm_turn_on_stdout</code> but pertains to the standard error stream.
  100. </p></dd></dl>
  101. <p>As an example, the following code fragment will prevent any output to
  102. standard output taking place as a side effect of <code>blather</code>, but
  103. will allow error messages to standard error. Note that ouput should
  104. not be left permanently turned off.
  105. </p>
  106. <table><tr><td>&nbsp;</td><td><pre class="example">...
  107. #include &lt;avm/mwrap.h&gt;
  108. ...
  109. x = y + z;
  110. avm_turn_off_stdout ();
  111. w = blather (foo, bar, baz);
  112. avm_turn_on_stdout ();
  113. return w;
  114. ...
  115. </pre></td></tr></table>
  116. <p>One possible issue with these functions is that they rely on a
  117. feature of the GNU C library that might not be portable to non-GNU
  118. <a name="index-portability"></a>
  119. systems and has not been widely tested on other platforms.
  120. </p>
  121. <p>Another issue is that a library function could be both careless enough
  122. to clutter the console unconditionally and meticulous enough to check
  123. for I/O errors after each attempted write. Writing while the output
  124. stream is disabled will return an I/O error to the caller (i.e., to
  125. the verbose library function) for appropriate action, which could
  126. include terminating the process.
  127. </p>
  128. <hr size="1">
  129. <table cellpadding="1" cellspacing="1" border="0">
  130. <tr><td valign="middle" align="left">[<a href="Working-around-library-misfeatures.html#Working-around-library-misfeatures" title="Previous section in reading order"> &lt; </a>]</td>
  131. <td valign="middle" align="left">[<a href="Memory-leaks.html#Memory-leaks" title="Next section in reading order"> &gt; </a>]</td>
  132. <td valign="middle" align="left"> &nbsp; </td>
  133. <td valign="middle" align="left">[<a href="Library-Reference.html#Library-Reference" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
  134. <td valign="middle" align="left">[<a href="Working-around-library-misfeatures.html#Working-around-library-misfeatures" title="Up section"> Up </a>]</td>
  135. <td valign="middle" align="left">[<a href="Character-Table.html#Character-Table" title="Next chapter"> &gt;&gt; </a>]</td>
  136. <td valign="middle" align="left"> &nbsp; </td>
  137. <td valign="middle" align="left"> &nbsp; </td>
  138. <td valign="middle" align="left"> &nbsp; </td>
  139. <td valign="middle" align="left"> &nbsp; </td>
  140. <td valign="middle" align="left">[<a href="avram.html#Top" title="Cover (top) of document">Top</a>]</td>
  141. <td valign="middle" align="left">[<a href="avram_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
  142. <td valign="middle" align="left">[<a href="Function-Index.html#Function-Index" title="Index">Index</a>]</td>
  143. <td valign="middle" align="left">[<a href="avram_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
  144. </tr></table>
  145. <p>
  146. <font size="-1">
  147. This document was generated on <i>November 8, 2012</i> using <a href="http://www.nongnu.org/texi2html/"><i>texi2html 1.82</i></a>.
  148. </font>
  149. <br>
  150. </p>
  151. </body>
  152. </html>