From 4aacfe1fc536e7ddd581462b8327de7fd1d89293 Mon Sep 17 00:00:00 2001
From: Andre Anjos <andre.anjos@idiap.ch>
Date: Wed, 15 Jan 2014 12:37:04 +0100
Subject: [PATCH] Fix C-API

---
 doc/c_cpp_api.rst                             | 33 ++++++++++---------
 .../include/xbob.learn.activation/api.h       |  2 +-
 2 files changed, 18 insertions(+), 17 deletions(-)

diff --git a/doc/c_cpp_api.rst b/doc/c_cpp_api.rst
index 10ef594..b5c37a3 100644
--- a/doc/c_cpp_api.rst
+++ b/doc/c_cpp_api.rst
@@ -6,11 +6,12 @@
  C++ API
 =========
 
-The C++ API of ``xbob.machine`` allows users to leverage from automatic
-converters for classes in :py:class:`xbob.machine`.  To use the C API, clients
-should first, include the header file ``<xbob.machine/api.h>`` on their
-compilation units and then, make sure to call once ``import_xbob_machine()`` at
-their module instantiation, as explained at the `Python manual
+The C++ API of ``xbob.learn.activation`` allows users to leverage from
+automatic converters for classes in :py:class:`xbob.learn.activation`.  To use
+the C API, clients should first, include the header file
+``<xbob.learn.activation/api.h>`` on their compilation units and then, make
+sure to call once ``import_xbob_learn_activation()`` at their module
+instantiation, as explained at the `Python manual
 <http://docs.python.org/2/extending/extending.html#using-capsules>`_.
 
 Here is a dummy C example showing how to include the header and where to call
@@ -18,7 +19,7 @@ the import function:
 
 .. code-block:: c++
 
-   #include <xbob.machine/api.h>
+   #include <xbob.learn.activation/api.h>
 
    PyMODINIT_FUNC initclient(void) {
 
@@ -35,20 +36,20 @@ the import function:
      // imports xbob.io C-API
      import_xbob_io();
 
-     // imports xbob.machine C-API
-     import_xbob_machine();
+     // imports xbob.learn.activation C-API
+     import_xbob_learn_activation();
 
    }
 
 .. note::
 
   The include directory can be discovered using
-  :py:func:`xbob.machine.get_include`.
+  :py:func:`xbob.learn.activation.get_include`.
 
 Activation Functors
 -------------------
 
-.. cpp:type:: PyBobMachineActivationObject
+.. cpp:type:: PyBobLearnActivationObject
 
    The pythonic object representation for a ``bob::machine::Activation``
    object. It is the base class of all activation functors available in
@@ -60,16 +61,16 @@ Activation Functors
       typedef struct {
         PyObject_HEAD
         bob::machine::Activation* base;
-      } PyBobMachineActivationObject;
+      } PyBobLearnActivationObject;
 
    .. cpp:member:: bob::machine::Activation* base
 
       A pointer to the activation functor virtual implementation.
 
 
-.. cpp:function:: int PyBobMachineActivation_Check(PyObject* o)
+.. cpp:function:: int PyBobLearnActivation_Check(PyObject* o)
 
-   Checks if the input object ``o`` is a ``PyBobMachineActivationObject``.
+   Checks if the input object ``o`` is a ``PyBobLearnActivationObject``.
    Returns ``1`` if it is, and ``0`` otherwise.
 
 
@@ -84,9 +85,9 @@ Activation Functors
    .. code-block:: c++
 
       typedef struct {
-        PyBobMachineActivationObject parent;
+        PyBobLearnActivationObject parent;
         bob::machine::<Subtype>Activation* base;
-      } PyBobMachine<Subtype>ActivationObject;
+      } PyBobLearn<Subtype>ActivationObject;
 
    Presently, ``<Subtype>`` can be one of:
 
@@ -97,6 +98,6 @@ Activation Functors
      * MultipliedHyperbolicTangent
 
    Type objects are also named consistently like
-   ``PyBobMachine<Subtype>_Type``.
+   ``PyBobLearn<Subtype>Activation_Type``.
 
 .. include:: links.rst
diff --git a/xbob/learn/activation/include/xbob.learn.activation/api.h b/xbob/learn/activation/include/xbob.learn.activation/api.h
index aed9d14..c96962a 100644
--- a/xbob/learn/activation/include/xbob.learn.activation/api.h
+++ b/xbob/learn/activation/include/xbob.learn.activation/api.h
@@ -230,7 +230,7 @@ typedef struct {
    * Returns -1 on error, 0 on success. PyCapsule_Import will set an exception
    * if there's an error.
    */
-  static int import_xbob_io(void) {
+  static int import_xbob_learn_activation(void) {
 
     PyObject *c_api_object;
     PyObject *module;
-- 
GitLab