Fixed buffer handling of some locale functions (based on a patch by
[wine/multimedia.git] / server / async.h
blob37b528f82f39ab1095fbc438883b303a8848411f
1 /*
2 * Async i/o definitions
4 * Copyright (C) 2000 Mike McCormack
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #ifndef _SERVER_ASYNC_
22 #define _SERVER_ASYNC_
24 #include <sys/time.h>
25 #include "object.h"
27 struct async_queue;
29 struct async
31 struct object *obj;
32 struct thread *thread;
33 void *overlapped;
34 unsigned int status;
35 struct timeval when;
36 struct timeout_user *timeout;
37 struct async *next,*prev;
38 struct async_queue *q;
41 struct async_queue
43 struct async *head;
44 struct async *tail;
47 void destroy_async( struct async *async );
48 void destroy_async_queue( struct async_queue *q );
49 void async_notify(struct async *async, int status);
50 struct async *find_async(struct async_queue *q, struct thread *thread, void *overlapped);
51 void async_insert(struct async_queue *q, struct async *async);
52 struct async *create_async(struct object *obj, struct thread *thread,
53 void *overlapped);
54 void async_add_timeout(struct async *async, int timeout);
55 static inline void init_async_queue(struct async_queue *q)
57 q->head = q->tail = NULL;
60 #define IS_READY(q) (((q).head) && ((q).head->status==STATUS_PENDING))
62 #endif /* _SERVER_ASYNC_ */