]>
Commit | Line | Data |
---|---|---|
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 "sms_private.h" | |
17 | ||
18 | sms_do_call(params, reply) | |
19 | struct sms_params *params; | |
20 | struct sms_params **reply; | |
21 | { | |
22 | CHECK_CONNECTED; | |
23 | ||
24 | if (!_sms_send_op) | |
25 | _sms_send_op = create_operation(); | |
26 | ||
27 | if (!_sms_recv_op) | |
28 | _sms_recv_op = create_operation(); | |
29 | ||
30 | initialize_operation(_sms_send_op, sms_start_send, (char *)params, | |
31 | (int (*)())NULL); | |
32 | queue_operation(_sms_conn, CON_OUTPUT, _sms_send_op); | |
33 | ||
34 | initialize_operation(_sms_recv_op, sms_start_recv, (char *)reply, | |
35 | (int (*)())NULL); | |
36 | queue_operation(_sms_conn, CON_INPUT, _sms_recv_op); | |
37 | ||
38 | /* Block until operation done. */ | |
39 | sms_complete_operation(_sms_send_op); | |
40 | sms_complete_operation(_sms_recv_op); | |
41 | /* Look at results */ | |
42 | if ((OP_STATUS(_sms_send_op) != OP_COMPLETE) || | |
43 | (OP_STATUS(_sms_recv_op) != OP_COMPLETE)) { | |
44 | sms_disconnect(); | |
45 | return SMS_ABORTED; | |
46 | } | |
47 | return 0; | |
48 | } |