]> andersk Git - moira.git/blob - lib/mr_call.c
57bf53daaf4c1f1eae84088aad1ecd1e952a606f
[moira.git] / lib / mr_call.c
1 /*
2  *      $Source$
3  *      $Author$
4  *      $Header$
5  *
6  *      Copyright (C) 1987 by the Massachusetts Institute of Technology
7  *      For copying and distribution information, please see the file
8  *      <mit-copyright.h>.
9  */
10
11 #ifndef lint
12 static char *rcsid_sms_call_c = "$Header$";
13 #endif
14
15 #include <mit-copyright.h>
16 #include "mr_private.h"
17
18 int mr_do_call(struct mr_params *params, struct mr_params **reply)
19 {
20   CHECK_CONNECTED;
21
22   if (!_mr_send_op)
23     _mr_send_op = create_operation();
24
25   if (!_mr_recv_op)
26     _mr_recv_op = create_operation();
27
28   initialize_operation(_mr_send_op, mr_start_send, (char *)params, NULL);
29   queue_operation(_mr_conn, CON_OUTPUT, _mr_send_op);
30
31   initialize_operation(_mr_recv_op, mr_start_recv, (char *)reply, NULL);
32   queue_operation(_mr_conn, CON_INPUT, _mr_recv_op);
33
34   /* Block until operation done. */
35   mr_complete_operation(_mr_send_op);
36   mr_complete_operation(_mr_recv_op);
37   /* Look at results */
38   if ((OP_STATUS(_mr_send_op) != OP_COMPLETE) ||
39       (OP_STATUS(_mr_recv_op) != OP_COMPLETE))
40     {
41       mr_disconnect();
42       return MR_ABORTED;
43     }
44   return 0;
45 }
This page took 0.027762 seconds and 3 git commands to generate.