| 1 | #include "fd.h" |
| 2 | #include <glib.h> |
| 3 | |
| 4 | struct fd * fd_Init(){ |
| 5 | struct fd *this = (struct fd *) g_malloc(sizeof(struct fd)); |
| 6 | fdContext_Init(&this->_fsm, this); |
| 7 | this->pid=-1; |
| 8 | this->fd=-1; |
| 9 | return this; |
| 10 | } |
| 11 | |
| 12 | int test_args(struct fd *this, int pid, int fd){ |
| 13 | if(this->pid==pid && this->fd==fd) |
| 14 | return 1; |
| 15 | return 0; |
| 16 | } |
| 17 | |
| 18 | void fd_save_args(struct fd *this, int pid, int fd){ |
| 19 | this->pid=pid; |
| 20 | this->fd=fd; |
| 21 | } |
| 22 | |
| 23 | int my_process_exit(struct fd *this, int pid){ |
| 24 | if(this->pid==pid) |
| 25 | return 1; |
| 26 | return 0; |
| 27 | } |
| 28 | |
| 29 | void fd_destroy_scenario(struct fd *this, int i){ |
| 30 | //remove fsm from fsm_list... not yet implemented |
| 31 | |
| 32 | removefsm(i); |
| 33 | g_free(this); |
| 34 | } |
| 35 | void fd_skip_FSM(){ |
| 36 | skip_FSM(); |
| 37 | } |
| 38 | void fd_warning(struct fd *this, char *msg){ |
| 39 | printf("%s\n",msg); |
| 40 | } |
| 41 | void fd_print_ts(struct fd *this, long ts_sec, long ts_nsec){ |
| 42 | printf("ts=%ld.%09ld\n", ts_sec, ts_nsec); |
| 43 | |
| 44 | } |