summaryrefslogtreecommitdiff
path: root/src/ivyloop.c
diff options
context:
space:
mode:
authorfcolin2002-04-04 08:50:07 +0000
committerfcolin2002-04-04 08:50:07 +0000
commit0804a5e035f41c70db089ccec7d06c6ebec09a56 (patch)
tree91e3f3a6f2abbb88a15c1804968f8569d07f152f /src/ivyloop.c
parent866c546f6a438e7f7cbc15aaa189f7afaac99d10 (diff)
downloadivy-c-0804a5e035f41c70db089ccec7d06c6ebec09a56.zip
ivy-c-0804a5e035f41c70db089ccec7d06c6ebec09a56.tar.gz
ivy-c-0804a5e035f41c70db089ccec7d06c6ebec09a56.tar.bz2
ivy-c-0804a5e035f41c70db089ccec7d06c6ebec09a56.tar.xz
replace LIST_ IVY_LIST_ collision macro
Diffstat (limited to 'src/ivyloop.c')
-rw-r--r--src/ivyloop.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/ivyloop.c b/src/ivyloop.c
index 07206a9..2ba0608 100644
--- a/src/ivyloop.c
+++ b/src/ivyloop.c
@@ -35,7 +35,6 @@
#include <signal.h>
#endif
-
#include "list.h"
#include "ivychannel.h"
#include "ivyloop.h"
@@ -50,13 +49,10 @@ struct _channel {
ChannelHandleRead handle_read;
};
-
-
ChannelInit channel_init = IvyChannelInit;
ChannelSetUp channel_setup = IvyChannelSetUp;
ChannelClose channel_close = IvyChannelClose;
-
static Channel channels_list = NULL;
static int channel_initialized = 0;
@@ -81,14 +77,14 @@ IvyChannelDelete (Channel channel)
(*channel->handle_delete) (channel->data);
FD_CLR (channel->fd, &open_fds);
- LIST_REMOVE (channels_list, channel);
+ IVY_LIST_REMOVE (channels_list, channel);
}
static void
ChannelDefferedDelete ()
{
Channel channel, next;
- LIST_EACH_SAFE (channels_list, channel,next) {
+ IVY_LIST_EACH_SAFE (channels_list, channel,next) {
if (channel->tobedeleted ) {
IvyChannelDelete (channel);
}
@@ -102,7 +98,7 @@ Channel IvyChannelSetUp (HANDLE fd, void *data,
{
Channel channel;
- LIST_ADD (channels_list, channel);
+ IVY_LIST_ADD (channels_list, channel);
if (!channel) {
fprintf(stderr,"NOK Memory Alloc Error\n");
exit(0);
@@ -123,7 +119,7 @@ IvyChannelHandleRead (fd_set *current)
{
Channel channel, next;
- LIST_EACH_SAFE (channels_list, channel, next) {
+ IVY_LIST_EACH_SAFE (channels_list, channel, next) {
if (FD_ISSET (channel->fd, current)) {
(*channel->handle_read)(channel,channel->fd,channel->data);
}
@@ -134,7 +130,7 @@ static void
IvyChannelHandleExcpt (fd_set *current)
{
Channel channel,next;
- LIST_EACH_SAFE (channels_list, channel, next) {
+ IVY_LIST_EACH_SAFE (channels_list, channel, next) {
if (FD_ISSET (channel->fd, current)) {
if (channel->handle_delete)
(*channel->handle_delete)(channel->data);
@@ -164,7 +160,6 @@ void IvyChannelInit (void)
channel_initialized = 1;
}
-
void IvyStop (void)
{
MainLoop = 0;
@@ -177,8 +172,6 @@ void IvyMainLoop(void(*hook)(void))
fd_set exset;
int ready;
-
-
while (MainLoop) {
ChannelDefferedDelete();
if (hook) (*hook)();