00001 /* Part of the culibs project, <http://www.eideticdew.org/culibs/>. 00002 * Copyright (C) 2007--2009 Petter Urkedal <urkedal@nbi.dk> 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_FWD_H 00019 #define CUOO_FWD_H 00020 00021 #include <cu/box.h> 00022 00023 CU_BEGIN_DECLARATIONS 00024 /** \defgroup cuoo_fwd_h cuoo/fwd.h: Forward Declarations 00025 ** @{ \ingroup cuoo_mod */ 00026 00027 /** An expression tree-code, representing either an operator, a type, or a 00028 ** special code used for variables. */ 00029 typedef uintptr_t cuex_meta_t; 00030 00031 /** A type which can hold the operator part of a metaword. */ 00032 typedef uint_fast32_t cuex_opr_t; 00033 00034 #define CUEX_META_C(c) CU_UINTPTR_C(c) 00035 #define CUEX_META_SIZE CUCONF_SIZEOF_INTPTR_T 00036 00037 /* The CUCONF_META_IN_OBJECT_STRUCT is not implemented, and may be dropped, 00038 * but it is still informative to prefix structs with dynamic-typed 00039 * constructors with CUOO_OBJ. */ 00040 #ifdef CUCONF_META_IN_OBJECT_STRUCT 00041 # define CUOO_OBJ cuex_meta_t cuex_meta_field; 00042 # define CUOO_OBJ_SHIFT sizeof(cuex_meta_t) 00043 # define CUOO_OBJ_NEEDED 1 00044 # define CUOO_OBJ_INIT 0 00045 #else 00046 # define CUOO_OBJ 00047 # define CUOO_OBJ_SHIFT 0 00048 # define CUOO_OBJ_INIT 00049 #endif 00050 00051 /** An integer which indicates the type and representation of a dynamic 00052 ** object. */ 00053 typedef uint_fast16_t cuoo_shape_t; 00054 00055 /** The type of expression trees which also works as a generic type of 00056 ** dynamically typed objects. */ 00057 typedef void *cuex_t; 00058 00059 typedef struct cuoo_layout *cuoo_layout_t; /* layout.h */ 00060 typedef struct cuoo_prop *cuoo_prop_t; /* prop.h */ 00061 typedef cu_box_t (*cuoo_impl_t)(cu_word_t, ...); /* type.h */ 00062 typedef unsigned int cuoo_propkey_t; /* type.h */ 00063 typedef struct cuoo_type *cuoo_type_t; /* type.h */ 00064 00065 /** Call this to initialise the \ref cuoo_mod "cuoo" modules before use. */ 00066 CU_SINLINE void cuoo_init(void) { cu_init(); } 00067 00068 /** @} */ 00069 CU_END_DECLARATIONS 00070 00071 #ifndef CU_NCOMPAT 00072 # include <cuoo/compat.h> 00073 #endif 00074 #endif