* iface/gspn/gspnlib.h: Fit 80 columns.

[__cplusplus]: Wrap everything under extern "C".
This commit is contained in:
Alexandre Duret-Lutz 2003-07-07 12:37:45 +00:00
parent 5f55663ad3
commit aaeb297aed
2 changed files with 59 additions and 47 deletions

View file

@ -1,10 +1,13 @@
2003-07-07 Alexandre Duret-Lutz <aduret@src.lip6.fr> 2003-07-07 Alexandre Duret-Lutz <aduret@src.lip6.fr>
* src/tgba/succiterconcrete.hh * iface/gspn/gspnlib.h: Fit 80 columns.
[__cplusplus]: Wrap everything under extern "C".
* src/tgba/succiterconcrete.hh
(tgba_succ_iterator_concrete::current_acc_): New attribute. (tgba_succ_iterator_concrete::current_acc_): New attribute.
* src/tgba/succiterconcrete.cc * src/tgba/succiterconcrete.cc
(tgba_succ_iterator_concrete::next): Set current_acc_. (tgba_succ_iterator_concrete::next): Set current_acc_.
(tgba_succ_iterator_concrete::current_accepting_conditions): (tgba_succ_iterator_concrete::current_accepting_conditions):
Simply return it. Simply return it.
* configure.ac: Output iface/Makefile and iface/gspn/Makefile. * configure.ac: Output iface/Makefile and iface/gspn/Makefile.

View file

@ -1,24 +1,28 @@
#ifndef __GSPN_LIB_H__ #ifndef __GSPN_LIB_H__
#define __GSPN_LIB_H__ #define __GSPN_LIB_H__
#include "stdlib.h"
g
/* Header file defining functions for Spot API */ /* Header file defining functions for Spot API */
#include <stdlib.h>
#ifdef __cplusplus
extern "C" {
#endif
/* -------------- Interface type definitions -------------- */ /* -------------- Interface type definitions -------------- */
typedef unsigned long AtomicProp; typedef unsigned long AtomicProp;
typedef AtomicProp * pAtomicProp; typedef AtomicProp * pAtomicProp;
typedef enum {STATE_PROP,EVENT_PROP} AtomicPropKind; typedef enum {STATE_PROP,EVENT_PROP} AtomicPropKind;
typedef AtomicPropKind * pAtomicPropKind ; typedef AtomicPropKind * pAtomicPropKind;
typedef unsigned long State; typedef unsigned long State;
typedef State * pState ; typedef State * pState;
typedef struct EventPropSucc { typedef struct EventPropSucc {
State s; State s;
AtomicProp p; AtomicProp p;
} EventPropSucc ; } EventPropSucc;
#define EVENT_TRUE 0 #define EVENT_TRUE 0
@ -26,25 +30,25 @@ typedef struct EventPropSucc {
/* ----------------- Utility Functions --------------------*/ /* ----------------- Utility Functions --------------------*/
/* Initialize data structures to work with model and properties /* Initialize data structures to work with model and properties
MANDATORY : should be called before any other function in this library MANDATORY : should be called before any other function in this library
Non 0 return correspond to errors in initialization Non 0 return correspond to errors in initialization
Call with arguments similar to WNRG/WNSRG/WNERG Call with arguments similar to WNRG/WNSRG/WNERG
*/ */
int initialize (int argc, char **argv) ; int initialize (int argc, char **argv);
/* Close and cleanup after using the library */ /* Close and cleanup after using the library */
int finalize (void); int finalize (void);
/* ----------------- Property related Functions ----------------*/ /* ----------------- Property related Functions ----------------*/
/* Returns the index of the property given as "name" /* Returns the index of the property given as "name"
Non zero return = error codes */ Non zero return = error codes */
int prop_index (const char * name, pAtomicProp propindex) ; int prop_index (const char * name, pAtomicProp propindex);
/* Returns the type of "prop" in "kind" /* Returns the type of "prop" in "kind"
non zero return = error codes non zero return = error codes
*/ */
int prop_kind ( const AtomicProp prop, pAtomicPropKind kind) ; int prop_kind (const AtomicProp prop, pAtomicPropKind kind);
/* ------------------ State Space Exploration -----------------*/ /* ------------------ State Space Exploration -----------------*/
@ -52,44 +56,49 @@ int prop_kind ( const AtomicProp prop, pAtomicPropKind kind) ;
/* Returns the identifier of the initial marking state */ /* Returns the identifier of the initial marking state */
int initial_state (pState M0); int initial_state (pState M0);
/* Given a state "s" and a list of "props_size" property indexes "props" checks the truth value of /* Given a state "s" and a list of "props_size" property indexes
every atomic property in "props" and returns in "truth" the truth value of these properties "props" checks the truth value of every atomic property in "props"
in the same order as the input, ONE CHAR PER TRUTH VALUE (i.e. sizeof(truth[]) = props_size and returns in "truth" the truth value of these properties in the
NB : the vector "truth" is allocated in this function same order as the input, ONE CHAR PER TRUTH VALUE
*/ (i.e. sizeof(truth[]) = props_size).
int satisfy (const State s, const AtomicProp props [], unsigned char ** truth, size_t props_size);
/* free the "truth" vector allocated by satisfy NB : the vector "truth" is allocated in this function
*/
int satisfy (const State s, const AtomicProp props [],
unsigned char ** truth, size_t props_size);
/* free the "truth" vector allocated by satisfy
!!! NB: Don't forget to call me, or you will get a memory leak !!! !!! NB: Don't forget to call me, or you will get a memory leak !!!
*/ */
int satisfy_free (unsigned char * truth); int satisfy_free (unsigned char * truth);
/* Calculates successors of a state "s" that can be reached by verifying at least one /* Calculates successors of a state "s" that can be reached by
event property specified in "enabled_events". In our first implementation enabled verifying at least one event property specified in
events is discarded, and ALL successors will be returned. This behavior is also "enabled_events". In our first implementation enabled events is
obtained by giving "TRUE" in the list of enabled events. discarded, and ALL successors will be returned. This behavior is
Each successor is returned in a struct that gives the Event property verified by the transition also obtained by giving "TRUE" in the list of enabled events. Each
fired to reach this marking; successor is returned in a struct that gives the Event property
If a marking is reached by firing a transition observed by more than one event property, it will verified by the transition fired to reach this marking; If a
be returned in many copies: marking is reached by firing a transition observed by more than one
i.e. E1 and E2 observe different firngs of transition t1 ; M1 is reached from M0 by firing t1 with event property, it will be returned in many copies: i.e. E1 and E2
a binding observable by both E1 and E2 : observe different firngs of transition t1; M1 is reached from M0
succ (M0, [E1,E2] , ...) by firing t1 with a binding observable by both E1 and E2 : succ
will return {[M1,E1],[M1,E2]} (M0, [E1,E2] , ...) will return {[M1,E1],[M1,E2]}
NB : "succ" vector is allocated in the function, use succ_free for memory release NB : "succ" vector is allocated in the function, use succ_free for
memory release
*/ */
int succ (const State s, const AtomicProp enabled_events [], size_t enabled_events_size, int succ (const State s,
const AtomicProp enabled_events [], size_t enabled_events_size,
EventPropSucc ** succ, size_t * succ_size); EventPropSucc ** succ, size_t * succ_size);
/* free the "succ" vector allocated by succ /* free the "succ" vector allocated by succ
!!! NB: Don't forget to call me, or you will get a memory leak !!! !!! NB: Don't forget to call me, or you will get a memory leak !!!
*/ */
int succ_free ( EventPropSucc * succ ); int succ_free (EventPropSucc * succ);
#endif
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GSPN_LIB_H__ */