From 5203ffb335095327793b3b2d6bdadfb657fda52a Mon Sep 17 00:00:00 2001 From: chatty Date: Tue, 22 Dec 1998 10:16:42 +0000 Subject: Mise au propre --- src/ivy.h | 13 +++++++++++++ src/ivychannel.h | 14 ++++++++++++++ src/ivyloop.c | 15 +++++++++++++++ src/ivyloop.h | 14 ++++++++++++++ src/ivysocket.c | 16 ++++++++++++++++ src/ivysocket.h | 14 ++++++++++++++ src/ivyxtloop.c | 14 ++++++++++++++ src/ivyxtloop.h | 14 ++++++++++++++ src/timer.c | 14 ++++++++++++++ src/timer.h | 15 ++++++++++++++- 10 files changed, 142 insertions(+), 1 deletion(-) diff --git a/src/ivy.h b/src/ivy.h index 7b450d0..911f830 100644 --- a/src/ivy.h +++ b/src/ivy.h @@ -1,3 +1,16 @@ +/* + * + * Ivy, C interface + * + * Copyright 1997-1998 + * Centre d'Etudes de la Navigation Aerienne + * + * Main functions + * + * $Id$ + * + */ + #ifndef _IVY_H #define _IVY_H diff --git a/src/ivychannel.h b/src/ivychannel.h index 3c893b4..b92ee93 100644 --- a/src/ivychannel.h +++ b/src/ivychannel.h @@ -1,3 +1,16 @@ +/* + * + * Ivy, C interface + * + * Copyright 1997-1998 + * Centre d'Etudes de la Navigation Aerienne + * + * Basic I/O handling + * + * $Id$ + * + */ + #ifndef _IVYCHANNEL_H #define _IVYCHANNEL_H @@ -41,3 +54,4 @@ void BusSetChannelManagement( ChannelInit init_chan, ChannelSetUp setup_chan, Ch #endif #endif + diff --git a/src/ivyloop.c b/src/ivyloop.c index e02800c..92f6301 100644 --- a/src/ivyloop.c +++ b/src/ivyloop.c @@ -1,3 +1,16 @@ +/* + * + * Ivy, C interface + * + * Copyright 1997-1998 + * Centre d'Etudes de la Navigation Aerienne + * + * Main loop handling around select + * + * $Id$ + * + */ + #ifdef WIN32 #include #endif @@ -108,6 +121,7 @@ static void BusLoopChannelHandleRead(fd_set *current) } } } + static void BusLoopChannelHandleExcpt(fd_set *current) { Channel channel,next; @@ -147,6 +161,7 @@ void BusLoopChannelStop(void) { MainLoop = 0; } + void BusLoopChannelMainLoop(void(*hook)(void)) { diff --git a/src/ivyloop.h b/src/ivyloop.h index 1eb7166..9dbb52d 100644 --- a/src/ivyloop.h +++ b/src/ivyloop.h @@ -1,3 +1,16 @@ +/* + * + * Ivy, C interface + * + * Copyright 1997-1998 + * Centre d'Etudes de la Navigation Aerienne + * + * Main loop based on select + * + * $Id$ + * + */ + #ifndef _IVYLOOP_H #define _IVYLOOP_H @@ -37,3 +50,4 @@ extern void BusLoopChannelClose( Channel channel ); #endif #endif + diff --git a/src/ivysocket.c b/src/ivysocket.c index 131813d..c785de2 100644 --- a/src/ivysocket.c +++ b/src/ivysocket.c @@ -1,3 +1,16 @@ +/* + * + * Ivy, C interface + * + * Copyright 1997-1998 + * Centre d'Etudes de la Navigation Aerienne + * + * Sockets + * + * $Id$ + * + */ + #ifdef WIN32 #include #endif @@ -142,6 +155,7 @@ static void HandleSocket( Channel channel, HANDLE fd, void *data) client->ptr = client->buffer; } } + static void HandleServer(Channel channel, HANDLE fd, void *data) { Server server = ( Server ) data; @@ -172,6 +186,7 @@ static void HandleServer(Channel channel, HANDLE fd, void *data) client->data = (*server->create)( client ); } + Server SocketServer(unsigned short port, void*(*create)(Client client), void(*handle_delete)(Client client, void *data), @@ -527,3 +542,4 @@ void SocketSendBroadcast( Client client, unsigned long host, unsigned short port perror( "*** send ***"); } va_end ( ap ); } + diff --git a/src/ivysocket.h b/src/ivysocket.h index e1dd1f4..4641bfa 100644 --- a/src/ivysocket.h +++ b/src/ivysocket.h @@ -1,3 +1,16 @@ +/* + * + * Ivy, C interface + * + * Copyright 1997-1998 + * Centre d'Etudes de la Navigation Aerienne + * + * Sockets + * + * $Id$ + * + */ + #ifndef _IVYSOCKET_H #define _IVYSOCKET_H @@ -73,3 +86,4 @@ extern void SocketSendBroadcast( Client client, unsigned long host, unsigned sho #endif #endif + diff --git a/src/ivyxtloop.c b/src/ivyxtloop.c index e2620aa..3a17b61 100644 --- a/src/ivyxtloop.c +++ b/src/ivyxtloop.c @@ -1,3 +1,17 @@ +/* + * + * Ivy, C interface + * + * Copyright 1997-1998 + * Centre d'Etudes de la Navigation Aerienne + * + * Main loop based on X Toolkit + * + * $Id$ + * + */ + + #ifdef WIN32 #include #endif diff --git a/src/ivyxtloop.h b/src/ivyxtloop.h index 17e053f..0784714 100644 --- a/src/ivyxtloop.h +++ b/src/ivyxtloop.h @@ -1,3 +1,16 @@ +/* + * + * Ivy, C interface + * + * Copyright 1997-1998 + * Centre d'Etudes de la Navigation Aerienne + * + * Main loop based on X Toolkit + * + * $Id$ + * + */ + #ifndef _IVYXTLOOP_H #define _IVYXTLOOP_H @@ -38,3 +51,4 @@ extern void BusXtChannelAppContext( XtAppContext cntx ); #endif #endif + diff --git a/src/timer.c b/src/timer.c index dfa10bd..7d23b43 100644 --- a/src/timer.c +++ b/src/timer.c @@ -1,3 +1,17 @@ +/* + * + * Ivy, C interface + * + * Copyright 1997-1998 + * Centre d'Etudes de la Navigation Aerienne + * + * Timers used in select based main loop + * + * $Id$ + * + */ + + /* Module de gestion des timers autour d'un select */ #include #include diff --git a/src/timer.h b/src/timer.h index 7aa425f..b36838c 100644 --- a/src/timer.h +++ b/src/timer.h @@ -1,9 +1,22 @@ +/* + * + * Ivy, C interface + * + * Copyright 1997-1998 + * Centre d'Etudes de la Navigation Aerienne + * + * Timers for select-based main loop + * + * $Id$ + * + */ + /* Module de gestion des timers autour d'un select */ typedef struct _timer *TimerId; typedef void (*TimerCb)( TimerId id , void *user_data, unsigned long delta ); -/* API le temp est en milli secondes */ +/* API le temps est en millisecondes */ #define TIMER_LOOP -1 /* timer en boucle infinie */ TimerId TimerRepeatAfter( int count, long time, TimerCb cb, void *user_data ); -- cgit v1.1