File: ffi.xml

package info (click to toggle)
php-doc 20241205~git.dfcbb86%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 70,956 kB
  • sloc: xml: 968,269; php: 23,883; javascript: 671; sh: 177; makefile: 37
file content (99 lines) | stat: -rw-r--r-- 3,494 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<reference xml:id="class.ffi" role="class" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">

 <title>Main interface to C code and data</title>
 <titleabbrev>FFI</titleabbrev>

 <partintro>

<!-- {{{ FFI intro -->
  <section xml:id="ffi.intro">
   &reftitle.intro;
   <para>
    Objects of this class are created by the factory methods <methodname>FFI::cdef</methodname>,
    <methodname>FFI::load</methodname> or <methodname>FFI::scope</methodname>. Defined C variables
    are made available as properties of the FFI instance, and defined C functions are made available
    as methods of the FFI instance. Declared C types can be used to create new C data structures
    using <methodname>FFI::new</methodname> and <methodname>FFI::type</methodname>.
   </para>
   <para>
    FFI definition parsing and shared library loading may take significant time. It is not useful
    to do it on each HTTP request in a Web environment. However, it is possible to preload FFI definitions
    and libraries at PHP startup, and to instantiate FFI objects when necessary. Header files
    may be extended with special <literal>FFI_SCOPE</literal> defines (e.g. <code>#define FFI_SCOPE "foo"</code>;
    the default scope is "C") and then loaded by <methodname>FFI::load</methodname> during preloading.
    This leads to the creation of a persistent binding, that will be available to all the following
    requests through <methodname>FFI::scope</methodname>.
    Refer to the <link linkend="ffi.examples-complete">complete PHP/FFI/preloading example</link>
    for details.
   </para>
   <para>
    It is possible to preload more than one C header file into the same scope.
   </para>
  </section>
<!-- }}} -->

  <section xml:id="ffi.synopsis">
   &reftitle.classsynopsis;

<!-- {{{ Synopsis -->
   <classsynopsis class="class">
    <ooclass>
     <modifier>final</modifier>
     <classname>FFI</classname>
    </ooclass>

    <classsynopsisinfo role="comment">&Constants;</classsynopsisinfo>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="ffi.constants.biggest-alignment">FFI::__BIGGEST_ALIGNMENT__</varname>
    </fieldsynopsis>

    <classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
    <xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.ffi')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[@role='FFI'])">
     <xi:fallback/>
    </xi:include>
   </classsynopsis>
<!-- }}} -->

  </section>

  <section xml:id="class.ffi.constants">
   &reftitle.constants;
   <variablelist>
    <varlistentry xml:id="ffi.constants.biggest-alignment">
     <term><constant>FFI::__BIGGEST_ALIGNMENT__</constant></term>
     <listitem>
      <para/>
     </listitem>
    </varlistentry>
   </variablelist>
  </section>
 </partintro>

 &reference.ffi.entities.ffi;

</reference>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->