Library-Reference.html 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <html lang="en">
  2. <head>
  3. <title>Library Reference - avram - a virtual machine code interpreter</title>
  4. <meta http-equiv="Content-Type" content="text/html">
  5. <meta name="description" content="avram - a virtual machine code interpreter">
  6. <meta name="generator" content="makeinfo 4.13">
  7. <link title="Top" rel="start" href="index.html#Top">
  8. <link rel="prev" href="Virtual-Machine-Specification.html#Virtual-Machine-Specification" title="Virtual Machine Specification">
  9. <link rel="next" href="Character-Table.html#Character-Table" title="Character Table">
  10. <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
  11. <meta http-equiv="Content-Style-Type" content="text/css">
  12. <style type="text/css"><!--
  13. pre.display { font-family:inherit }
  14. pre.format { font-family:inherit }
  15. pre.smalldisplay { font-family:inherit; font-size:smaller }
  16. pre.smallformat { font-family:inherit; font-size:smaller }
  17. pre.smallexample { font-size:smaller }
  18. pre.smalllisp { font-size:smaller }
  19. span.sc { font-variant:small-caps }
  20. span.roman { font-family:serif; font-weight:normal; }
  21. span.sansserif { font-family:sans-serif; font-weight:normal; }
  22. --></style>
  23. </head>
  24. <body>
  25. <div class="node">
  26. <a name="Library-Reference"></a>
  27. <p>
  28. Next:&nbsp;<a rel="next" accesskey="n" href="Character-Table.html#Character-Table">Character Table</a>,
  29. Previous:&nbsp;<a rel="previous" accesskey="p" href="Virtual-Machine-Specification.html#Virtual-Machine-Specification">Virtual Machine Specification</a>,
  30. Up:&nbsp;<a rel="up" accesskey="u" href="index.html#Top">Top</a>
  31. <hr>
  32. </div>
  33. <h2 class="chapter">3 Library Reference</h2>
  34. <p>Much of the code developed for <code>avram</code> may be reusable in other
  35. projects, so it has been packaged into a library and documented in this
  36. chapter. For ease of reference, this chapter is organized with a
  37. separate section for each source file. For the most part, each source
  38. file encapsulates an abstract type and a number of related functions,
  39. except for a few cases where C makes such a design awkward. An attempt
  40. has been made to present the sections in a readable order as far as
  41. possible.
  42. <p>The documentation in this chapter is confined to the application program
  43. interface (API), and does not delve unnecessarily into any details of the
  44. <a name="index-API-392"></a>implementation. A reader wishing to extend, modify, or troubleshoot the
  45. library itself can find additional information in the source code
  46. comments. These are more likely to be in sync with the code than this
  47. document may be, and are more readily accessible to someone working with
  48. the code.
  49. <p>Some general points pertaining to the library are the following.
  50. <ul>
  51. <li>Unlike the previous chapter, this chapter uses the word
  52. &ldquo;function&rdquo; in the C sense rather than the mathematical sense of the word.
  53. <li>Internal errors are internal from the user's point of view, not
  54. the developer's (<a href="Internal-Errors.html#Internal-Errors">Internal Errors</a>). Invoking these functions in
  55. ways that are contrary to their specifications can certainly cause
  56. internal errors (not to mention segfaults).
  57. <li>The library is definitely not thread safe, and thread safety is
  58. <a name="index-threads-393"></a>not a planned enhancement. The amount of locking required to make it
  59. thread safe would probably incur an objectionable performance penalty
  60. due to the complexity of the shared data structures involved, in
  61. addition to being very difficult to get right. If you need these
  62. facilities in a concurrent application, consider spawning a process for
  63. <a name="index-spawning-processes-394"></a>each client of the library so as to keep their address spaces separate.
  64. <li>The library files are built from the standard source
  65. distribution using GNU <samp><span class="command">libtool</span></samp>. In the default directory
  66. hierarchy, they will be found
  67. either in <samp><span class="file">/usr/lib/libavram.*</span></samp> or in <samp><span class="file">/usr/local/lib/libavram.*</span></samp>.
  68. These directories will differ in a non-standard installation.
  69. <li>The header files will probably be
  70. located in either <samp><span class="file">/usr/include/avm/*.h</span></samp> or
  71. <samp><span class="file">/usr/local/include/avm/*.h</span></samp> for a standard installation.
  72. <li>All exported functions, macros and constants are
  73. preceded with <code>avm_</code>, so as to reduce the chance of name clashes
  74. with other libraries. Not all type declarations or field identifiers
  75. follow this convention, because that would be far too tedious.
  76. <li>The library header files are designed to be compatible with C++
  77. <a name="index-C_002b_002b-395"></a>but have been tested only with C. Please refer to platform specific
  78. documentation for further information on how to link library modules
  79. with your own code.
  80. </ul>
  81. <ul class="menu">
  82. <li><a accesskey="1" href="Lists.html#Lists">Lists</a>
  83. <li><a accesskey="2" href="Characters-and-Strings.html#Characters-and-Strings">Characters and Strings</a>
  84. <li><a accesskey="3" href="File-Manipulation.html#File-Manipulation">File Manipulation</a>
  85. <li><a accesskey="4" href="Invocation.html#Invocation">Invocation</a>
  86. <li><a accesskey="5" href="Version-Management.html#Version-Management">Version Management</a>
  87. <li><a accesskey="6" href="Error-Reporting.html#Error-Reporting">Error Reporting</a>
  88. <li><a accesskey="7" href="Profiling.html#Profiling">Profiling</a>
  89. <li><a accesskey="8" href="Emulation-Primitives.html#Emulation-Primitives">Emulation Primitives</a>
  90. <li><a accesskey="9" href="External-Library-Maintenance.html#External-Library-Maintenance">External Library Maintenance</a>
  91. </ul>
  92. </body></html>