goinfre/libs/libevent/del.c

goinfre/libs/libevent/del.c

  _____________________________________________________________________________ 
 /   / Index / Goinfre / Resume / Links / Contact / Sitemap /    .: v0.6.1.0 |^|
|\__/-------+         +--------+-------+---------+---------+-----------------+#|
|  1| /goinfre/libs/libevent/del.c                                           |#|
|  2| ==========================================                             |#|
|  3|                                                                        |#|
|  4|                                                   [ raw ] [ download ] |#|
|  5|                                             ` `` ````````````````````` |#|
|  6|                                                                        |#|
|  7| /**                                                                    |#|
|  8|  * libevent/del.c                                                      |#|
|  9|  *                                                                     |#|
| 10|  * Copyright (c) Manfred Touron 2008                                   |#|
| 11|  */                                                                    |#|
| 12|                                                                        |#|
| 13| #include <stdlib.h>                                                    |#|
| 14| #include <unistd.h>                                                    |#|
| 15| #include <stdio.h>                                                     |#|
| 16| #include <string.h>                                                    |#|
| 17|                                                                        |#|
| 18| #include <liblc/liblc.h>                                               |#|
| 19|                                                                        |#|
| 20| #include "core.h"                                                      |#|
| 21|                                                                        |#|
| 22| void            event_callback_delete(event e, cllbck callback)        |#|
| 23| {                                                                      |#|
| 24|   lc_remove_ptr(e->lc, (void *)(uintptr_t)callback);                   |#|
| 25|   if (!lc_length(e->lc))                                               |#|
| 26|     event_unset(e);                                                    |#|
| 27|   return ;                                                             | |
| 28| }                                                                      | |
| 29|                                                                        | |
| 30| void      event_del_handler(const char *name, cllbck callback)         | |
| 31| {                                                                      | |
| 32|   event      e;                                                        | |
| 33|                                                                        | |
| 34|   e = events_find(name);                                               | |
| 35|   if (event_callback_exists(e, callback))                              | |
| 36|     event_callback_delete(e, callback);                                | |
| 37|   return ;                                                             | |
| 38| }                                                                      | |
| 39|                                                                        | |
+---+                                                                        | |
\_   \______ mo5.so - normal - 1337.so - rev.so - video_r.so +---------------+ |
  |__       \_____   plain.so - color.so - comment.so       /  moul 2008 (c) |V|
     \-----\______\________________________________________/-----------------+-+