oggpack_writecheck.html 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <html>
  2. <head>
  3. <title>libogg - function - oggpack_writecheck</title>
  4. <link rel=stylesheet href="style.css" type="text/css">
  5. </head>
  6. <body bgcolor=white text=black link="#5555ff" alink="#5555ff" vlink="#5555ff">
  7. <table border=0 width=100%>
  8. <tr>
  9. <td><p class=tiny>libogg documentation</p></td>
  10. <td align=right><p class=tiny>libogg release 1.3.4 - 20190830</p></td>
  11. </tr>
  12. </table>
  13. <h1>oggpack_writecheck</h1>
  14. <p><i>declared in "ogg/ogg.h";</i></p>
  15. <p>This function checks the readiness status of
  16. an <a href="oggpack_buffer.html">oggpack_buffer</a> previously
  17. initialized for writing using the
  18. Ogg <a href="bitpacking.html">bitpacking</a> functions. A write
  19. buffer that encounters an error (such as a failed malloc) will clear
  20. its internal state and release any in-use memory, flagging itself as
  21. 'not ready'. Subsequent attempts to write using the buffer will
  22. silently fail. This error state may be detected at any later time by
  23. using oggpack_writecheck(). It is safe but not necessary to
  24. call <a href="oggpack_writeclear.html">oggpack_writeclear()</a> on a buffer that
  25. has flagged an error and released its resources.
  26. <p><em>Important note to developers: Although libogg checks the
  27. results of memory allocations, these checks are only useful on a
  28. narrow range of embedded platforms. Allocation checks perform no
  29. useful service on a general purpose desktop OS where pages are
  30. routinely overallocated and all allocations succeed whether memory is
  31. available or not. The only way to detect an out of memory condition
  32. on the vast majority of OSes is to watch for and capture segmentation
  33. faults. This function is useful only to embedded developers.</em>
  34. <br><br>
  35. <table border=0 color=black cellspacing=0 cellpadding=7>
  36. <tr bgcolor=#cccccc>
  37. <td>
  38. <pre><b>
  39. int oggpack_writecheck(<a href="oggpack_buffer.html">oggpack_buffer</a> *b);
  40. </b></pre>
  41. </td>
  42. </tr>
  43. </table>
  44. <h3>Parameters</h3>
  45. <dl>
  46. <dt><i>b</i></dt>
  47. <dd>An <a href="oggpack_buffer.html">oggpack_buffer</a> previously initialized for writing.</dd>
  48. </dl>
  49. <h3>Return Values</h3>
  50. <blockquote>
  51. <li><i>zero</i>: buffer is ready for writing</li>
  52. <li><i>nonzero</i>: buffer is not ready or encountered an error</li>
  53. </blockquote>
  54. <p>
  55. <br><br>
  56. <hr noshade>
  57. <table border=0 width=100%>
  58. <tr valign=top>
  59. <td><p class=tiny>copyright &copy; 2000-2019 Xiph.Org Foundation</p></td>
  60. <td align=right><p class=tiny><a href="http://www.xiph.org/ogg/">Ogg Container Format</a></p></td>
  61. </tr><tr>
  62. <td><p class=tiny>libogg documentation</p></td>
  63. <td align=right><p class=tiny>libogg release 1.3.4 - 20190830</p></td>
  64. </tr>
  65. </table>
  66. </body>
  67. </html>