<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="ffi.cdef" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
 <refnamediv>
  <refname>FFI::cdef</refname>
  <refpurpose>Creates a new FFI object</refpurpose>
 </refnamediv>

 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis role="FFI">
   <modifier>public</modifier> <modifier>static</modifier> <type>FFI</type><methodname>FFI::cdef</methodname>
   <methodparam choice="opt"><type>string</type><parameter>code</parameter><initializer>""</initializer></methodparam>
   <methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>lib</parameter><initializer>&null;</initializer></methodparam>
  </methodsynopsis>
  <para>
   Creates a new FFI object.
  </para>
 </refsect1>

 <refsect1 role="parameters">
  &reftitle.parameters;
  <variablelist>
   <varlistentry>
    <term><parameter>code</parameter></term>
    <listitem>
     <para>
      A string containing a sequence of declarations in regular C language
      (types, structures, functions, variables, etc). Actually, this string may
      be copy-pasted from C header files.
     </para>
     <note>
      <para>
       C preprocessor directives are not supported, i.e. <code>#include</code>,
       <code>#define</code> and CPP macros do not work.
      </para>
     </note>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term><parameter>lib</parameter></term>
    <listitem>
     <para>
      The name of a shared library file, to be loaded and linked with the
      definitions.
     </para>
     <note>
      <para>
       If <parameter>lib</parameter> is omitted or &null;, platforms supporting <literal>RTLD_DEFAULT</literal>
       attempt to lookup symbols declared in <parameter>code</parameter> in the normal global
       scope. Other systems will fail to resolve these symbols.
      </para>
     </note>
    </listitem>
   </varlistentry>
  </variablelist>
 </refsect1>

 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   Returns the freshly created <classname>FFI</classname> object.
  </para>
 </refsect1>

 <refsect1 role="changelog"><!-- {{{ -->
  &reftitle.changelog;
  <informaltable>
   <tgroup cols="2">
    <thead>
     <row>
      <entry>&Version;</entry>
      <entry>&Description;</entry>
     </row>
    </thead>
    <tbody>
     <row>
      <entry>8.0.0</entry>
      <entry>
       <parameter>lib</parameter> is nullable now.
      </entry>
     </row>
    </tbody>
   </tgroup>
  </informaltable>
 </refsect1><!-- }}} -->

</refentry>
<!-- 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
-->
