00001 /* 00002 libgr: library for graphs. 00003 Copyright (C) 2005 IPD Goos, Universit"at Karlsruhe, Germany 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Lesser General Public 00007 License as published by the Free Software Foundation; either 00008 version 2.1 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Lesser General Public License for more details. 00014 00015 You should have received a copy of the GNU Lesser General Public 00016 License along with this library; if not, write to the Free Software 00017 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00018 */ 00019 00020 00028 #ifndef __GR_GENERATION_H__ 00029 #define __GR_GENERATION_H__ 00030 00031 #include "graph.h" 00032 #include "actions.h" 00033 00034 #ifdef __cplusplus 00035 extern "C" { 00036 #endif 00037 00041 typedef enum _gr_generation_flags_t { 00042 GR_GENERATION_INC_ON_MATCH_FLAG = 0x00000001, 00043 GR_GENERATION_UPD_ON_MATCH_FLAG = 0x00000002, 00044 GR_GENERATION_INC_BEFORE_FINISH_FLAG = 0x00000004, 00045 GR_GENERATION_INC_AFTER_FINISH_FLAG = 0x00000008, 00047 GR_GENERATION_DEFAULT_FLAGS = GR_GENERATION_INC_ON_MATCH_FLAG | GR_GENERATION_UPD_ON_MATCH_FLAG | 00048 GR_GENERATION_INC_BEFORE_FINISH_FLAG 00049 } gr_generation_flags_t; 00050 00054 typedef struct _gr_generation_t { 00055 unsigned int magic; 00056 int generation; 00057 unsigned int flags; 00058 gr_id_t node_generation_attr; 00059 gr_id_t edge_generation_attr; 00060 void *add_node_listener; 00061 void *add_edge_listener; 00062 void *set_node_type_listener; 00063 void *action_match_listener; 00064 void *action_before_finish_listener; 00065 void *action_after_finish_listener; 00066 } gr_generation_t; 00067 00080 void gr_install_generations( 00081 gr_graph_t *gr, gr_actions_t *acts, 00082 gr_id_t node_gen_attr, gr_id_t edge_gen_attr, 00083 unsigned flags); 00084 00091 int gr_get_cur_generation(gr_graph_t *gr); 00092 00100 int gr_get_next_generation(gr_graph_t *gr); 00101 00108 void gr_set_cur_generation(gr_graph_t *gr, int count); 00109 00110 #ifdef __cplusplus 00111 } 00112 #endif 00113 00114 #endif /* __GR_GENERATION_H__ */
1.4.1