arc.h

Go to the documentation of this file.
00001 #ifndef __ARC_H__
00002 #define __ARC_H__
00003 
00004 /*
00005  Copyright (c) 2006-2010 Trevor Williams
00006 
00007  This program is free software; you can redistribute it and/or modify
00008  it under the terms of the GNU General Public License as published by the Free Software
00009  Foundation; either version 2 of the License, or (at your option) any later version.
00010 
00011  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
00012  without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00013  See the GNU General Public License for more details.
00014 
00015  You should have received a copy of the GNU General Public License along with this program;
00016  if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00017 */
00018 
00026 #include <stdio.h>
00027 
00028 #include "defines.h"
00029 
00030 
00034 fsm_table* arc_create();
00035 
00037 void arc_add(
00038   fsm_table*    table,
00039   const vector* fr_st,
00040   const vector* to_st,
00041   int           hit,
00042   bool          exclude
00043 );
00044 
00046 int arc_find_from_state(
00047             const fsm_table* table,
00048             const vector*    st
00049 );
00050 
00052 int arc_find_to_state(
00053             const fsm_table* table,
00054             const vector*    st
00055 );
00056 
00058 int arc_find_arc(
00059   const fsm_table* table,
00060   unsigned int     fr_index,
00061   unsigned int     to_index
00062 );
00063 
00065 int arc_find_arc_by_exclusion_id(
00066   const fsm_table* table,
00067   int              id
00068 );
00069 
00071 void arc_get_stats(
00072             const fsm_table* table,
00073   /*@out@*/ int*             state_hits,
00074   /*@out@*/ int*             state_total,
00075   /*@out@*/ int*             arc_hits,
00076   /*@out@*/ int*             arc_total,
00077   /*@out@*/ int*             arc_excluded
00078 );
00079 
00081 void arc_db_write(
00082   const fsm_table* table,
00083   FILE*            file
00084 );
00085 
00087 void arc_db_read(
00088   fsm_table** table,
00089   char**      line
00090 );
00091 
00093 void arc_db_merge(
00094   fsm_table* table,
00095   char**     line
00096 );
00097 
00099 void arc_merge(
00100   fsm_table*       base,
00101   const fsm_table* other
00102 );
00103 
00105 void arc_get_states(
00106   char***          fr_states,
00107   unsigned int*    fr_state_size,
00108   char***          to_states,
00109   unsigned int*    to_state_size,
00110   const fsm_table* table,
00111   bool             hit,
00112   bool             any,
00113   unsigned int     fr_width,
00114   unsigned int     to_width 
00115 );
00116 
00118 void arc_get_transitions(
00119   /*@out@*/ char***          from_states,
00120   /*@out@*/ char***          to_states,
00121   /*@out@*/ int**            ids,
00122   /*@out@*/ int**            excludes,
00123   /*@out@*/ char***          reasons,
00124   /*@out@*/ int*             arc_size,
00125             const fsm_table* table,
00126             func_unit*       funit,
00127             bool             hit,
00128             bool             any,
00129             unsigned int     fr_width,
00130             unsigned int     to_width
00131 );
00132 
00134 bool arc_are_any_excluded(
00135   const fsm_table* table
00136 );
00137 
00139 void arc_dealloc(
00140   /*@only@*/ fsm_table* table
00141 );
00142 
00143 #endif
00144 
Generated on Sun Nov 21 00:55:34 2010 for Covered by  doxygen 1.6.3