]> andersk Git - moira.git/blob - lib/mr_call.c
sms -> moira
[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 lint
14
15 #include <mit-copyright.h>
16 #include "mr_private.h"
17
18 mr_do_call(params, reply)
19     struct mr_params *params;
20     struct mr_params **reply;
21 {
22     CHECK_CONNECTED;
23     
24     if (!_mr_send_op)
25         _mr_send_op = create_operation();
26
27     if (!_mr_recv_op)
28         _mr_recv_op = create_operation();
29
30     initialize_operation(_mr_send_op, mr_start_send, (char *)params,
31                          (int (*)())NULL);
32     queue_operation(_mr_conn, CON_OUTPUT, _mr_send_op);
33
34     initialize_operation(_mr_recv_op, mr_start_recv, (char *)reply,
35                          (int (*)())NULL);
36     queue_operation(_mr_conn, CON_INPUT, _mr_recv_op);
37
38     /* Block until operation done. */
39     mr_complete_operation(_mr_send_op);
40     mr_complete_operation(_mr_recv_op);
41     /* Look at results */
42     if ((OP_STATUS(_mr_send_op) != OP_COMPLETE) ||
43         (OP_STATUS(_mr_recv_op) != OP_COMPLETE)) {
44         mr_disconnect();
45         return MR_ABORTED;
46     }
47     return 0;
48 }
This page took 0.033575 seconds and 5 git commands to generate.