]> andersk Git - moira.git/blob - lib/mr_private.h
Would you like some undocumented errno values with that?
[moira.git] / lib / mr_private.h
1 /* $Id$
2  *
3  * Private declarations of the Moira library.
4  *
5  * Copyright (C) 1987-1998 by the Massachusetts Institute of Technology
6  * For copying and distribution information, please see the file
7  * <mit-copyright.h>.
8  */
9
10 #include <mit-copyright.h>
11 #include <moira.h>
12
13 #include <sys/types.h>
14
15 #include <netinet/in.h>
16 #include <arpa/inet.h>
17
18 extern int _mr_conn, mr_inited;
19
20 typedef struct mr_params {
21   union {
22     u_long mr_procno;     /* for call */
23     u_long mr_status;     /* for reply */
24   } u;
25   int mr_argc;
26   char **mr_argv;
27   int *mr_argl;
28   unsigned char *mr_flattened;
29   u_long mr_filled;
30 } mr_params;
31
32 #define CHECK_CONNECTED if (!_mr_conn) return MR_NOT_CONNECTED
33
34 #define getlong(cp, l) do { l = ((((unsigned char *)cp)[0] * 256 + ((unsigned char *)cp)[1]) * 256 + ((unsigned char *)cp)[2]) * 256 + ((unsigned char *)cp)[3]; } while(0)
35 #define putlong(cp, l) do { ((unsigned char *)cp)[0] = l >> 24; ((unsigned char *)cp)[1] = l >> 16; ((unsigned char *)cp)[2] = l >> 8; ((unsigned char *)cp)[3] = l; } while(0)
36
37 /* prototypes from mr_call.h */
38 int mr_do_call(struct mr_params *params, struct mr_params *reply);
39 int mr_send(int fd, struct mr_params *params);
40 int mr_receive(int fd, struct mr_params *params);
41 int mr_cont_receive(int fd, struct mr_params *params);
42 void mr_destroy_reply(mr_params reply);
43
44 /* prototypes from mr_connect.h */
45 int mr_accept(int s, struct sockaddr_in *sin);
46 int mr_cont_accept(int conn, char **buf, int *nread);
47 int mr_connect_internal(char *server, char *port);
48 int mr_listen(char *port);
49
50 /* prototypes from mr_init.c */
51 void mr_init(void);
This page took 0.038993 seconds and 5 git commands to generate.