X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=contrib%2Ffsm_checker%2FFD_CHECK%2Ffd.c;fp=contrib%2Ffsm_checker%2FFD_CHECK%2Ffd.c;h=f0df174fb535813d97a0bf8c38a2a39afc3726fb;hb=e09e518ebf18d490dbeb72c6358968af7d05d675;hp=0000000000000000000000000000000000000000;hpb=58f53b56557577b64911d0e7a2bba3fbb521d71d;p=lttv.git diff --git a/contrib/fsm_checker/FD_CHECK/fd.c b/contrib/fsm_checker/FD_CHECK/fd.c new file mode 100755 index 00000000..f0df174f --- /dev/null +++ b/contrib/fsm_checker/FD_CHECK/fd.c @@ -0,0 +1,44 @@ +#include "fd.h" +#include + +struct fd * fd_Init(){ + struct fd *this = (struct fd *) g_malloc(sizeof(struct fd)); + fdContext_Init(&this->_fsm, this); + this->pid=-1; + this->fd=-1; + return this; +} + +int test_args(struct fd *this, int pid, int fd){ + if(this->pid==pid && this->fd==fd) + return 1; + return 0; +} + +void fd_save_args(struct fd *this, int pid, int fd){ + this->pid=pid; + this->fd=fd; +} + +int my_process_exit(struct fd *this, int pid){ + if(this->pid==pid) + return 1; + return 0; +} + +void fd_destroy_scenario(struct fd *this, int i){ + //remove fsm from fsm_list... not yet implemented + + removefsm(i); + g_free(this); +} +void fd_skip_FSM(){ + skip_FSM(); +} +void fd_warning(struct fd *this, char *msg){ + printf("%s\n",msg); +} +void fd_print_ts(struct fd *this, long ts_sec, long ts_nsec){ + printf("ts=%ld.%09ld\n", ts_sec, ts_nsec); + +}