X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/7a932b74cc22097655d6792f64cab66bb0fe1694..17d68f9c99cd629591527d4c385ed0b1244726c5:/ae.h diff --git a/ae.h b/ae.h index 0a056ce9..a9db18ed 100644 --- a/ae.h +++ b/ae.h @@ -2,7 +2,7 @@ * for the Jim's event-loop (Jim is a Tcl interpreter) but later translated * it in form of a library for easy reuse. * - * Copyright (c) 2006-2009, Salvatore Sanfilippo + * Copyright (c) 2006-2010, Salvatore Sanfilippo * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,7 +41,6 @@ #define AE_NONE 0 #define AE_READABLE 1 #define AE_WRITABLE 2 -#define AE_EXCEPTION 4 #define AE_FILE_EVENTS 1 #define AE_TIME_EVENTS 2 @@ -59,13 +58,13 @@ struct aeEventLoop; typedef void aeFileProc(struct aeEventLoop *eventLoop, int fd, void *clientData, int mask); typedef int aeTimeProc(struct aeEventLoop *eventLoop, long long id, void *clientData); typedef void aeEventFinalizerProc(struct aeEventLoop *eventLoop, void *clientData); +typedef void aeBeforeSleepProc(struct aeEventLoop *eventLoop); /* File event structure */ typedef struct aeFileEvent { - int mask; /* one of AE_(READABLE|WRITABLE|EXCEPTION) */ + int mask; /* one of AE_(READABLE|WRITABLE) */ aeFileProc *rfileProc; aeFileProc *wfileProc; - aeFileProc *efileProc; void *clientData; } aeFileEvent; @@ -95,6 +94,7 @@ typedef struct aeEventLoop { aeTimeEvent *timeEventHead; int stop; void *apidata; /* This is used for polling API specific data */ + aeBeforeSleepProc *beforesleep; } aeEventLoop; /* Prototypes */ @@ -112,5 +112,6 @@ int aeProcessEvents(aeEventLoop *eventLoop, int flags); int aeWait(int fd, int mask, long long milliseconds); void aeMain(aeEventLoop *eventLoop); char *aeGetApiName(void); +void aeSetBeforeSleepProc(aeEventLoop *eventLoop, aeBeforeSleepProc *beforesleep); #endif