Enlightenment CVS committal Author : raster Project : e17 Module : libs/ecore
Dir : e17/libs/ecore/src/lib/ecore Modified Files: Tag: SPLIT Ecore.h ecore_main.c Log Message: ecore_con module is there... what does this do? con is short for.. CONNECT! :) ecore_con is a generic ipc/communications/socket/event/loop/buffering layer. it uses the ecore event loop and infrastructure to get data from a socket and send it, handle connections of clients etc. it handles buffering all data so if you send mroe data than your os socket buffers will allow your pgoram does NOT block waiting for the os to flush its buffers... nor does it fail. ecore just buffers it for you in ram and flushes it whenever the socket is ready for more data. (basically what xlib does internally). this means you can happily send MASSES of data and the time it takes is a memcpy(). the rest gets quietly flushed in the background. Recieving data is done on demand when it arrives. It makes it EASY for a program to advertise a socket serivce - setup is trivial. a program just sets up a server on a named service and ecore does the rest for you. this will make it brain-dead for ecore using programs to talk to eachother later on. this is structured to be able to add tcp/ip in with no api changes (which i will add later). this will let ecore apps talk over networks... in fact ecore will let you write arbitary client/server programs talking any protocol, new or existing, as long as its tcp :) you could write a webserver using it, or a ftp server or an ftp client... take your pick... NB: this is NOT complete. work is underway on it. it's just up and running now with some basics working. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore/Attic/Ecore.h,v retrieving revision 1.1.2.5 retrieving revision 1.1.2.6 diff -u -3 -r1.1.2.5 -r1.1.2.6 --- Ecore.h 20 Feb 2003 06:56:40 -0000 1.1.2.5 +++ Ecore.h 12 Mar 2003 23:53:33 -0000 1.1.2.6 @@ -113,6 +113,7 @@ void *ecore_main_fd_handler_del(Ecore_Fd_Handler *fd_handler); int ecore_main_fd_handler_fd_get(Ecore_Fd_Handler *fd_handler); int ecore_main_fd_handler_active_get(Ecore_Fd_Handler *fd_handler, Ecore_Fd_Handler_Flags flags); + void ecore_main_fd_handler_active_set(Ecore_Fd_Handler *fd_handler, Ecore_Fd_Handler_Flags flags); double ecore_time_get(void); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore/Attic/ecore_main.c,v retrieving revision 1.1.2.9 retrieving revision 1.1.2.10 diff -u -3 -r1.1.2.9 -r1.1.2.10 --- ecore_main.c 27 Feb 2003 01:58:11 -0000 1.1.2.9 +++ ecore_main.c 12 Mar 2003 23:53:34 -0000 1.1.2.10 @@ -12,7 +12,7 @@ static int _ecore_main_fd_handlers_buf_call(void); static int in_main_loop = 0; -static int quit = 0; +static int do_quit = 0; static Ecore_Fd_Handler *fd_handlers = NULL; static int fd_handlers_delete_me = 0; @@ -29,7 +29,7 @@ ecore_main_loop_begin(void) { in_main_loop = 1; - for (;quit == 0;) + for (;do_quit == 0;) { double next_time; int have_event; @@ -144,7 +144,7 @@ } while (_ecore_main_fd_handlers_buf_call()); } - quit = 0; + do_quit = 0; in_main_loop = 0; } @@ -159,7 +159,7 @@ void ecore_main_loop_quit(void) { - quit = 1; + do_quit = 1; } /** @@ -287,6 +287,25 @@ if ((flags & ECORE_FD_READ) && (fd_handler->read_active)) ret = 1; if ((flags & ECORE_FD_WRITE) && (fd_handler->write_active)) ret = 1; return ret; +} + +/** + * Set what active stream the fd should be monitoring + * @param fd_handler The handler to modify + * @param flags The flags to be watching + * + * This function changes if an fd shoudl be watched for read, write or both. + */ +void +ecore_main_fd_handler_active_set(Ecore_Fd_Handler *fd_handler, Ecore_Fd_Handler_Flags flags) +{ + if (!ECORE_MAGIC_CHECK(fd_handler, ECORE_MAGIC_FD_HANDLER)) + { + ECORE_MAGIC_FAIL(fd_handler, ECORE_MAGIC_FD_HANDLER, + "ecore_main_fd_handler_active_set"); + return; + } + fd_handler->flags = flags; } void ------------------------------------------------------- This SF.net email is sponsored by:Crypto Challenge is now open! Get cracking and register here for some mind boggling fun and the chance of winning an Apple iPod: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en _______________________________________________ enlightenment-cvs mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs