projects
/
silc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
SILC FSM API changes.
[silc.git]
/
lib
/
silcutil
/
tests
/
test_silcasync.c
diff --git
a/lib/silcutil/tests/test_silcasync.c
b/lib/silcutil/tests/test_silcasync.c
index 0a1fecc8a1478d55a1cdebf68ea0c0de3868c865..96210e08df50431c2286fb000f8070e5b5163841 100644
(file)
--- a/
lib/silcutil/tests/test_silcasync.c
+++ b/
lib/silcutil/tests/test_silcasync.c
@@
-10,7
+10,7
@@
SilcSchedule schedule;
typedef struct {
SilcFSM fsm;
typedef struct {
SilcFSM fsm;
- SilcFSM
Sema
Struct sema;
+ SilcFSM
Event
Struct sema;
SilcAsyncOperation op;
Callback cb;
void *cb_context;
SilcAsyncOperation op;
Callback cb;
void *cb_context;
@@
-59,7
+59,7
@@
static void async_call_cb(void *context)
Foo f = context;
SILC_LOG_DEBUG(("*******Callback, signal and continue to next state"));
f->op = NULL;
Foo f = context;
SILC_LOG_DEBUG(("*******Callback, signal and continue to next state"));
f->op = NULL;
- SILC_FSM_
SEMA_POST
(&f->sema);
+ SILC_FSM_
EVENT_SIGNAL
(&f->sema);
SILC_FSM_CALL_CONTINUE(f->fsm);
}
SILC_FSM_CALL_CONTINUE(f->fsm);
}
@@
-69,7
+69,7
@@
SILC_FSM_STATE(test_st_start)
SILC_LOG_DEBUG(("test_st_start"));
SILC_LOG_DEBUG(("test_st_start"));
- silc_fsm_
sema_init(&f->sema, fsm, 0
);
+ silc_fsm_
event_init(&f->sema, fsm
);
/** Wait async callback */
SILC_LOG_DEBUG(("Call async call"));
/** Wait async callback */
SILC_LOG_DEBUG(("Call async call"));
@@
-84,7
+84,7
@@
SILC_FSM_STATE(test_st_second)
SILC_LOG_DEBUG(("test_st_second"));
SILC_LOG_DEBUG(("test_st_second"));
- SILC_FSM_
SEMA
_TIMEDWAIT(&f->sema, 0, 1, &timedout);
+ SILC_FSM_
EVENT
_TIMEDWAIT(&f->sema, 0, 1, &timedout);
if (timedout == TRUE) {
SILC_LOG_DEBUG(("Sema timedout, aborting async operation"));
if (timedout == TRUE) {
SILC_LOG_DEBUG(("Sema timedout, aborting async operation"));
@@
-94,7
+94,7
@@
SILC_FSM_STATE(test_st_second)
/** Finish */
silc_fsm_next_later(fsm, test_st_finish, 2, 0);
/** Finish */
silc_fsm_next_later(fsm, test_st_finish, 2, 0);
-
return
SILC_FSM_WAIT;
+ SILC_FSM_WAIT;
}
SILC_FSM_STATE(test_st_finish)
}
SILC_FSM_STATE(test_st_finish)
@@
-102,7
+102,7
@@
SILC_FSM_STATE(test_st_finish)
SILC_LOG_DEBUG(("test_st_finish"));
SILC_LOG_DEBUG(("Finish machine"));
SILC_LOG_DEBUG(("test_st_finish"));
SILC_LOG_DEBUG(("Finish machine"));
-
return
SILC_FSM_FINISH;
+ SILC_FSM_FINISH;
}
static void destructor(SilcFSM fsm, void *fsm_context,
}
static void destructor(SilcFSM fsm, void *fsm_context,