Release 980712
[wine] / include / server.h
1 /*
2  * Wine server definitions
3  *
4  * Copyright (C) 1998 Alexandre Julliard
5  */
6
7 #ifndef __WINE_SERVER_H
8 #define __WINE_SERVER_H
9
10 /* message header as sent on the wire */
11 struct header
12 {
13     unsigned int  len;     /* total msg length (including this header) */
14     unsigned int  type;    /* msg type */
15     unsigned int  seq;     /* sequence number */
16 };
17
18 /* max msg length (not including the header) */
19 #define MAX_MSG_LENGTH (16384 - sizeof(struct header))
20
21 /* request from client to server */
22
23 enum request
24 {
25     REQ_TIMEOUT,         /* internal timeout msg */
26     REQ_KILL_THREAD,     /* internal kill thread msg */
27     REQ_NEW_THREAD,      /* create a new thread (called from the creator) */
28     REQ_INIT_THREAD,     /* init a new thread (called by itself) */
29     REQ_NB_REQUESTS
30 };
31
32 /* request structures */
33
34 struct new_thread_request
35 {
36     void *pid;  /* process id for the new thread (or 0 if none yet) */
37 };
38
39 struct new_thread_reply
40 {
41     void *tid;  /* thread id */
42     void *pid;  /* process id (created if necessary) */
43 };
44
45 struct init_thread_request
46 {
47     int  pid;
48 /*    char name[...];*/
49 };
50
51 /* server-side functions */
52
53 extern void server_main_loop( int fd );
54
55
56 /* client-side functions */
57
58 #ifndef __WINE_SERVER__
59 struct _THDB;
60 extern int CLIENT_NewThread( struct _THDB *thdb );
61 extern int CLIENT_InitThread(void);
62 #endif  /* __WINE_SERVER__ */
63
64 #endif  /* __WINE_SERVER_H */