00001 /* Part of the culibs project, <http://www.eideticdew.org/culibs/>. 00002 * Copyright (C) 2007--2010 Petter Urkedal <paurkedal@eideticdew.org> 00003 * 00004 * This program is free software: you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation, either version 3 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00016 */ 00017 00018 #ifndef CUOO_INTF_H 00019 #define CUOO_INTF_H 00020 00021 #include <cuoo/fwd.h> 00022 #include <stdio.h> 00023 00024 CU_BEGIN_DECLARATIONS 00025 /** \defgroup cuoo_intf_h cuoo/intf.h: Interface Numbers 00026 ** \ingroup cuoo_mod 00027 ** @{ */ 00028 00029 /** Value returned by interface dispatch functions to indicate that a requested 00030 ** interface has no implementation. */ 00031 #define CUOO_IMPL_NONE cu_box_fptr(void (*)(), NULL) 00032 00033 /* The range of interface numbers used culibs. */ 00034 #define CUOO_INTFRANGE_CULIBS_BEGIN 0x00000000 00035 #define CUOO_INTFRANGE_CULIBS_END 0x00000100 00036 00037 #define CUOO_INTF_FINALISE 0x11 00038 #define CUOO_INTF_SERIALISABLE 0x12 /* cuoo_serialisable_t */ 00039 00040 /** \deprecated Use \ref CUOO_INTF_FOPRINT_FN. */ 00041 #define CUOO_INTF_PRINT_FN 0x13 /* void (*)(void *, FILE *) */ 00042 #define CUOO_INTF_PRINT_FN_BOX(fn) cu_box_fptr(cuoo_intf_print_fn_t, fn) 00043 00044 /** A libcufo format function of type \ref cufo_print_ptr_fn_t. */ 00045 #define CUOO_INTF_FOPRINT_FN 0x14 00046 #define CUOO_INTF_FOPRINT_FN_BOX(fn) cu_box_fptr(cufo_print_ptr_fn_t, fn) 00047 00048 /** An object to \ref cu_str "cu_str_t" conversion function of type 00049 ** <tt>cu_str_t (*)(void *)</tt>. */ 00050 #define CUOO_INTF_TO_STR_FN 0x15 00051 #define CUOO_INTF_TO_STR_FN_BOX(fn) cu_box_fptr(cuoo_intf_to_str_fn_t, fn) 00052 00053 typedef void (*cuoo_intf_print_fn_t)(cuex_t, FILE *); 00054 typedef cu_str_t (*cuoo_intf_to_str_fn_t)(cuex_t); 00055 00056 /** An interface dispatch which conistently returns \ref CUOO_IMPL_NONE. */ 00057 cu_box_t cuoo_impl_none(cu_word_t intf_number, ...); 00058 00059 /* US Spelling */ 00060 #define CUOO_INTF_SERIALIZABLE CUOO_INTF_SERIALISABLE 00061 00062 /** @} */ 00063 CU_END_DECLARATIONS 00064 00065 #endif