1 /****************************************************************************
2  * Copyright (C) 2012 by Matteo Franchin                                    *
3  *                                                                          *
4  * This file is part of Box.                                                *
5  *                                                                          *
6  *   Box is free software: you can redistribute it and/or modify it         *
7  *   under the terms of the GNU Lesser General Public License as published  *
8  *   by the Free Software Foundation, either version 3 of the License, or   *
9  *   (at your option) any later version.                                    *
10  *                                                                          *
11  *   Box is distributed in the hope that it will be useful,                 *
12  *   but WITHOUT ANY WARRANTY; without even the implied warranty of         *
13  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
14  *   GNU Lesser General Public License for more details.                    *
15  *                                                                          *
16  *   You should have received a copy of the GNU Lesser General Public       *
17  *   License along with Box.  If not, see <http://www.gnu.org/licenses/>.   *
18  ****************************************************************************/
19 
20 /**
21  * @file callable_priv.h
22  * @brief Private declarations for the callable object.
23  */
24 
25 #ifndef _BOX_CALLABLE_PRIV_H
26 #  define _BOX_CALLABLE_PRIV_H
27 
28 #  include <box/types.h>
29 #  include <box/callable.h>
30 
31 
32 /**
33  * @brief Implementation of @c BoxCallable.
34  */
35 struct BoxCallable_struct {
36   char             *uid;     /**< Unique identifier for the function. */
37   BoxCallableKind  kind;     /**< Callable internal implementation. */
38   BoxPtr           context;  /**< Pointer to callable private data. */
39   union {
40     BoxCCall1      c_call_1; /**< BoxCCall1 implementation of the callable. */
41     BoxCCall2      c_call_2; /**< BoxCCall2 implementation of the callable. */
42     BoxCCall3      c_call_3; /**< BoxCCall3 implementation of the callable. */
43     BoxCCallOld    c_old;    /**< BoxCCallOld implementation of the
44                                   callable. */
45     struct {
46       BoxVM        *vm;      /**< Virtual Machine. */
47       BoxVMCallNum call_num; /**< Call number. */
48     }              vm_call;  /**< VM implementation of the callable. */
49   }                implem;   /**< Implementation data. */
50 };
51 
52 #endif /* _BOX_CALLABLE_PRIV_H */
53