]> andersk Git - moira.git/blame - lib/mr_private.h
Command line printer manipulation client, and build goo.
[moira.git] / lib / mr_private.h
CommitLineData
fa59b86f 1/* $Id$
e2a67c78 2 *
7ac48069 3 * Private declarations of the Moira library.
e2a67c78 4 *
7ac48069 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>.
e2a67c78 8 */
9
85330553 10#include <mit-copyright.h>
11#include <moira.h>
55ed894e 12
85330553 13#include <sys/types.h>
55ed894e 14
533bacb3 15#ifndef _WIN32
85330553 16#include <netinet/in.h>
17#include <arpa/inet.h>
533bacb3 18#endif /*_WIN32*/
55ed894e 19
85330553 20extern int _mr_conn, mr_inited;
55ed894e 21
85330553 22typedef struct mr_params {
23 union {
24 u_long mr_procno; /* for call */
25 u_long mr_status; /* for reply */
26 } u;
27 int mr_argc;
28 char **mr_argv;
29 int *mr_argl;
30 unsigned char *mr_flattened;
12cbd6bd 31 u_long mr_filled;
85330553 32} mr_params;
55ed894e 33
85330553 34#define CHECK_CONNECTED if (!_mr_conn) return MR_NOT_CONNECTED
5eaef520 35
12cbd6bd 36#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)
533bacb3 37#define putlong(cp, l) do { ((unsigned char *)cp)[0] = (unsigned char)(l >> 24); ((unsigned char *)cp)[1] = (unsigned char)(l >> 16); ((unsigned char *)cp)[2] = (unsigned char)(l >> 8); ((unsigned char *)cp)[3] = (unsigned char)(l); } while(0)
7ac48069 38
39/* prototypes from mr_call.h */
85330553 40int mr_do_call(struct mr_params *params, struct mr_params *reply);
41int mr_send(int fd, struct mr_params *params);
42int mr_receive(int fd, struct mr_params *params);
12cbd6bd 43int mr_cont_receive(int fd, struct mr_params *params);
85330553 44void mr_destroy_reply(mr_params reply);
45
46/* prototypes from mr_connect.h */
47int mr_accept(int s, struct sockaddr_in *sin);
12cbd6bd 48int mr_cont_accept(int conn, char **buf, int *nread);
85330553 49int mr_connect_internal(char *server, char *port);
50int mr_listen(char *port);
7ac48069 51
52/* prototypes from mr_init.c */
53void mr_init(void);
This page took 0.402077 seconds and 5 git commands to generate.