v1-defs.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2002 Roberto Micarelli
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 2 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, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00017  */
00018 
00019 /*
00020  * best view tabstop=4
00021  */
00022 
00023 #define _DGL_V1         1
00024 #undef  _DGL_V2
00025 
00026 /*
00027  * Define function names
00028  */
00029 
00030 #if defined(DGL_DEFINE_TREE_PROCS) || defined(DGL_DEFINE_FLAT_PROCS)
00031 /* sp-template */
00032 #undef DGL_SP_DIJKSTRA_FUNC
00033 #undef DGL_SPAN_DEPTHFIRST_SPANNING_FUNC
00034 #undef DGL_SPAN_MINIMUM_SPANNING_FUNC
00035 #undef _DGL_OUTEDGESET
00036 #undef _DGL_INEDGESET
00037 #undef _DGL_EDGE_TAILNODE
00038 #undef _DGL_EDGE_HEADNODE
00039 #endif
00040 
00041 /*
00042  * TREE version algorithms
00043  */
00044 #if defined(DGL_DEFINE_TREE_PROCS)
00045 /* sp-template */
00046 #define DGL_SP_DIJKSTRA_FUNC                            dgl_dijkstra_V1_TREE
00047 /* span-template */
00048 #define DGL_SPAN_DEPTHFIRST_SPANNING_FUNC       dgl_span_depthfirst_spanning_V1_TREE
00049 #define DGL_SPAN_MINIMUM_SPANNING_FUNC  dgl_span_minimum_spanning_V1_TREE
00050 /* portable actions */
00051 #define _DGL_OUTEDGESET(pg,pn)                  DGL_GET_NODE_OUTEDGESET_FUNC(pg,pn)
00052 #define _DGL_INEDGESET(pg,pn)                   DGL_GET_NODE_INEDGESET_FUNC(pg,pn)
00053 #define _DGL_EDGE_HEADNODE(pg,pl)                       DGL_GET_NODE_FUNC(pg, DGL_EDGE_HEADNODE_OFFSET(pl))
00054 #define _DGL_EDGE_TAILNODE(pg,pl)                       DGL_GET_NODE_FUNC(pg, DGL_EDGE_TAILNODE_OFFSET(pl))
00055 #endif
00056 
00057 /*
00058  * FLAT version algorithms
00059  */
00060 #if defined(DGL_DEFINE_FLAT_PROCS)
00061 /* sp-template */
00062 #define DGL_SP_DIJKSTRA_FUNC                            dgl_dijkstra_V1_FLAT
00063 /* span-template */
00064 #define DGL_SPAN_DEPTHFIRST_SPANNING_FUNC       dgl_span_depthfirst_spanning_V1_FLAT
00065 #define DGL_SPAN_MINIMUM_SPANNING_FUNC  dgl_span_minimum_spanning_V1_FLAT
00066 /* portable actions */
00067 #define _DGL_OUTEDGESET(pg,pn)                  DGL_EDGEBUFFER_SHIFT(pg, DGL_NODE_EDGESET_OFFSET(pn))
00068 #define _DGL_INEDGESET(pg,pn)                   ((dglInt32_t*)(DGL_EDGEBUFFER_SHIFT(pg, DGL_NODE_EDGESET_OFFSET(pn))) + \
00069                                                                                         *(dglInt32_t*)(DGL_EDGEBUFFER_SHIFT(pg, DGL_NODE_EDGESET_OFFSET(pn))) + 1)
00070 #define _DGL_EDGE_HEADNODE(pg,pl)                       DGL_NODEBUFFER_SHIFT(pg, DGL_EDGE_HEADNODE_OFFSET(pl))
00071 #define _DGL_EDGE_TAILNODE(pg,pl)                       DGL_NODEBUFFER_SHIFT(pg, DGL_EDGE_TAILNODE_OFFSET(pl))
00072 #endif
00073 
00074 
00075 
00076 
00077 #if !defined(DGL_DEFINE_TREE_PROCS) && !defined(DGL_DEFINE_FLAT_PROCS)
00078 
00079 /* sp-template */
00080 #define DGL_SP_CACHE_INITIALIZE_FUNC            dgl_sp_cache_initialize_V1
00081 #define DGL_SP_CACHE_RELEASE_FUNC                       dgl_sp_cache_release_V1
00082 #define DGL_SP_CACHE_REPORT_FUNC                        dgl_sp_cache_report_V1
00083 #define DGL_SP_CACHE_DISTANCE_FUNC              dgl_sp_cache_distance_V1
00084 
00085 /* nodemgmt-template */
00086 #define DGL_ADD_NODE_FUNC                                       dgl_add_node_V1
00087 #define DGL_DEL_NODE_FUNC                                       dgl_del_node_V1
00088 #define DGL_GET_NODE_FUNC                                       dgl_get_node_V1
00089 #define DGL_GET_NODE_OUTEDGESET_FUNC            dgl_getnode_outedgeset_V1
00090 
00091 /* edgemgmt-template */
00092 #define DGL_ADD_EDGE_FUNC                                       dgl_add_edge_V1
00093 #define DGL_GET_EDGE_FUNC                                       dgl_get_edge_V1
00094 #define DGL_DEL_EDGE_FUNC                                       dgl_del_edge_V1
00095 
00096 /* misc-template */
00097 #define DGL_EDGE_T_INITIALIZE_FUNC              dgl_edge_t_initialize_V1
00098 #define DGL_EDGE_T_RELEASE_FUNC                 dgl_edge_t_release_V1
00099 #define DGL_EDGE_T_FIRST_FUNC                           dgl_edge_t_first_V1
00100 #define DGL_EDGE_T_NEXT_FUNC                            dgl_edge_t_next_V1
00101 #define DGL_NODE_T_INITIALIZE_FUNC              dgl_node_t_initialize_V1
00102 #define DGL_NODE_T_RELEASE_FUNC                 dgl_node_t_release_V1
00103 #define DGL_NODE_T_FIRST_FUNC                           dgl_node_t_first_V1
00104 #define DGL_NODE_T_NEXT_FUNC                            dgl_node_t_next_V1
00105 #define DGL_NODE_T_FIND_FUNC                            dgl_node_t_find_V1
00106 #define DGL_EDGESET_T_INITIALIZE_FUNC           dgl_edgeset_t_initialize_V1
00107 #define DGL_EDGESET_T_RELEASE_FUNC              dgl_edgeset_t_release_V1
00108 #define DGL_EDGESET_T_FIRST_FUNC                        dgl_edgeset_t_first_V1
00109 #define DGL_EDGESET_T_NEXT_FUNC                 dgl_edgeset_t_next_V1
00110 #define DGL_FLATTEN_FUNC                                        dgl_flatten_V1
00111 #define DGL_UNFLATTEN_FUNC                              dgl_unflatten_V1
00112 
00113 
00114 
00115 /*
00116  *
00117  */
00118 
00119 
00120 /* Node
00121  */
00122 #define DGL_NODE_ALLOC                                  DGL_NODE_ALLOC_v1
00123 #define DGL_NODE_SIZEOF                                 DGL_NODE_SIZEOF_v1
00124 #define DGL_NODE_WSIZE                                  DGL_NODE_WSIZE_v1
00125 #define DGL_NODE_STATUS                                 DGL_NODE_STATUS_v1
00126 #define DGL_NODE_ID                                             DGL_NODE_ID_v1
00127 #define DGL_NODE_ATTR_PTR                                       DGL_NODE_ATTR_PTR_v1
00128 #define DGL_NODE_EDGESET_OFFSET                 DGL_NODE_EDGESET_OFFSET_v1
00129 
00130 /* Edge
00131  */
00132 #define DGL_EDGE_ALLOC                                  DGL_EDGE_ALLOC_v1
00133 #define DGL_EDGE_SIZEOF                                 DGL_EDGE_SIZEOF_v1
00134 #define DGL_EDGE_WSIZE                                  DGL_EDGE_WSIZE_v1
00135 #define DGL_EDGE_STATUS(p)                              0
00136 #define DGL_EDGE_COST                                           DGL_EDGE_COST_v1
00137 #define DGL_EDGE_ID                                             DGL_EDGE_ID_v1
00138 #define DGL_EDGE_ATTR_PTR                                       DGL_EDGE_ATTR_PTR_v1
00139 #define DGL_EDGE_HEADNODE_OFFSET                        DGL_EDGE_HEADNODE_OFFSET_v1
00140 #define DGL_EDGE_TAILNODE_OFFSET                        DGL_EDGE_TAILNODE_OFFSET_v1
00141 
00142 /* Edgeset
00143  */
00144 #define DGL_ILA_TOARR                                           DGL_ILA_TOARR_v1
00145 #define DGL_EDGESET_OFFSET                              DGL_EDGESET_OFFSET_v1
00146 #define DGL_EDGESET_EDGEARRAY_PTR               DGL_EDGESET_EDGEARRAY_PTR_v1
00147 #define DGL_EDGESET_EDGECOUNT                   DGL_EDGESET_EDGECOUNT_v1
00148 #define DGL_EDGESET_EDGE_PTR                            DGL_EDGESET_EDGE_PTR_v1
00149 #define DGL_EDGESET_ALLOC                               DGL_EDGESET_ALLOC_v1
00150 #define DGL_EDGESET_REALLOC                             DGL_EDGESET_REALLOC_v1
00151 #define DGL_EDGESET_SIZEOF                              DGL_EDGESET_SIZEOF_v1
00152 #define DGL_EDGESET_WSIZE                               DGL_EDGESET_WSIZE_v1
00153 
00154 /* Misc
00155  */
00156 #define DGL_NODEBUFFER_SHIFT                            DGL_NODEBUFFER_SHIFT_v1
00157 #define DGL_NODEBUFFER_OFFSET                           DGL_NODEBUFFER_OFFSET_v1
00158 #define DGL_EDGEBUFFER_SHIFT                            DGL_EDGEBUFFER_SHIFT_v1
00159 #define DGL_EDGEBUFFER_OFFSET                           DGL_EDGEBUFFER_OFFSET_v1
00160 
00161 #define DGL_FOREACH_NODE                                        DGL_FOREACH_NODE_v1
00162 #define DGL_FOREACH_EDGE                                        DGL_FOREACH_EDGE_v1
00163 
00164 
00165 /*
00166  * Tree-node portability
00167  */
00168 #define DGL_T_NODEITEM_TYPE                                     dglTreeNode_s
00169 #define DGL_T_NODEITEM_NodePTR(p)                               ((p)->pv)
00170 #define DGL_T_NODEITEM_Set_NodePTR(p,ptr)               ((p)->pv=(ptr))
00171 #define DGL_T_NODEITEM_OutEdgesetPTR(p)         ((p)->pv2)
00172 #define DGL_T_NODEITEM_Set_OutEdgesetPTR(p,ptr) ((p)->pv2=(ptr))
00173 #define DGL_T_NODEITEM_InEdgesetPTR(p)          NULL
00174 #define DGL_T_NODEITEM_Set_InEdgesetPTR(p,ptr)
00175 #define DGL_T_NODEITEM_Compare                          dglTreeNodeCompare
00176 #define DGL_T_NODEITEM_Cancel                                   dglTreeNodeCancel
00177 #define DGL_T_NODEITEM_Add                                      dglTreeNodeAdd
00178 #define DGL_T_NODEITEM_Alloc                                    dglTreeNodeAlloc
00179 
00180 
00181 
00182 #endif

Generated on Sun Apr 6 17:32:44 2008 for GRASS by  doxygen 1.5.5