Data Structures | Macros | Typedefs
loop.h File Reference
#include <stdint.h>
#include <uv.h>
#include "nvim/lib/klist.h"
#include "nvim/os/time.h"
#include "nvim/event/multiqueue.h"

Go to the source code of this file.

Data Structures

struct  loop
 

Macros

#define _noop(x)
 
#define CREATE_EVENT(multiqueue, handler, argc, ...)
 
#define LOOP_PROCESS_EVENTS_UNTIL(loop, multiqueue, timeout, condition)
 
#define LOOP_PROCESS_EVENTS(loop, multiqueue, timeout)
 

Typedefs

typedef void * WatcherPtr
 
typedef struct loop Loop
 

Macro Definition Documentation

#define _noop (   x)
#define CREATE_EVENT (   multiqueue,
  handler,
  argc,
  ... 
)
Value:
do { \
multiqueue_put((multiqueue), (handler), argc, __VA_ARGS__); \
} else { \
void *argv[argc] = { __VA_ARGS__ }; \
(handler)(argv); \
} \
} while (0)
if(len)
Definition: encode.c:222
typval_T argv[MAX_FUNC_ARGS+1]
Definition: eval.c:6577
multiqueue_put(main_loop.events, msg_emsgf_event, 1, s)
Definition: multiqueue.c:73
#define LOOP_PROCESS_EVENTS (   loop,
  multiqueue,
  timeout 
)
Value:
do { \
} else { \
loop_poll_events(loop, timeout); \
} \
} while (0)
if(len)
Definition: encode.c:222
void multiqueue_process_events(MultiQueue *this)
Definition: multiqueue.c:151
bool loop_poll_events(Loop *loop, int ms)
Definition: loop.c:44
bool multiqueue_empty(MultiQueue *this)
Definition: multiqueue.c:171
Definition: loop.h:17
Definition: multiqueue.c:73
#define LOOP_PROCESS_EVENTS_UNTIL (   loop,
  multiqueue,
  timeout,
  condition 
)
Value:
do { \
int remaining = timeout; \
uint64_t before = (remaining > 0) ? os_hrtime() : 0; \
while (!(condition)) { \
if (remaining == 0) { \
break; \
} else if (remaining > 0) { \
uint64_t now = os_hrtime(); \
remaining -= (int) ((now - before) / 1000000); \
before = now; \
if (remaining <= 0) { \
break; \
} \
} \
} \
} while (0)
uint64_t os_hrtime(void)
Definition: time.c:40
if(len)
Definition: encode.c:222
#define LOOP_PROCESS_EVENTS(loop, multiqueue, timeout)
Definition: loop.h:77
Definition: loop.h:17
while(argv_clear > 0)
Definition: eval.c:6736
Definition: multiqueue.c:73

Typedef Documentation

typedef struct loop Loop
typedef void* WatcherPtr