|
|
1.1 root 1: /* dapread.c - */
2:
3: #ifndef lint
4: static char *rcsid = "$Header: /f/osi/dsap/net/RCS/dapread.c,v 7.0 90/07/26 14:45:23 mrose Exp $";
5: #endif
6:
7: /*
8: * $Header: /f/osi/dsap/net/RCS/dapread.c,v 7.0 90/07/26 14:45:23 mrose Exp $
9: *
10: *
11: * $Log: dapread.c,v $
12: * Revision 7.0 90/07/26 14:45:23 mrose
13: * *** empty log message ***
14: *
15: */
16:
17: /*
18: * NOTICE
19: *
20: * Acquisition, use, and distribution of this module and related
21: * materials are subject to the restrictions of a license agreement.
22: * Consult the Preface in the User's Manual for the full terms of
23: * this agreement.
24: *
25: */
26:
27:
28: /* LINTLIBRARY */
29:
30: #include "tailor.h"
31: #include "quipu/util.h"
32: #include "quipu/dap2.h"
33:
34: extern LLog *log_dsap;
35:
36: dap_read (ad, id, arg, error, result)
37: int ad;
38: int *id;
39: struct ds_read_arg *arg;
40: struct ds_read_result *result;
41: struct DSError *error;
42: {
43: struct DAPindication di_s;
44: struct DAPindication * di = &(di_s);
45:
46: DLOG(log_dsap, LLOG_TRACE, ("dap_read()"));
47:
48: ++(*id);
49:
50: (void) DapRead (ad, (*id), arg, di, ROS_INTR);
51:
52: error->dse_type = DSE_NOERROR;
53:
54: switch (di->di_type)
55: {
56: case DI_RESULT:
57: {
58: struct DAPresult * dr = &(di->di_result);
59:
60: /* Nasty struct copy */
61: (*result) = dr->dr_res.res_rd; /* struct copy */
62: dr->dr_res.result_type = -1; /* Prevent freeing */
63: DRFREE (dr);
64: return (DS_OK);
65: }
66:
67: case DI_ERROR:
68: {
69: struct DAPerror * de = &(di->di_error);
70:
71: (*error) = de->de_err; /* struct copy */
72: return (DS_ERROR_REMOTE);
73: }
74:
75: case DI_PREJECT:
76: error->dse_type = DSE_REMOTEERROR;
77: return (DS_ERROR_PROVIDER);
78:
79: case DI_ABORT:
80: error->dse_type = DSE_REMOTEERROR;
81: return (DS_ERROR_CONNECT);
82:
83: default:
84: error->dse_type = DSE_REMOTEERROR;
85: return (DS_ERROR_PROVIDER);
86: }
87: }
88:
89: int DapRead (ad, id, arg, di, asyn)
90: int ad;
91: int id;
92: struct ds_read_arg * arg;
93: struct DAPindication * di;
94: int asyn;
95: {
96: PE arg_pe;
97:
98: if(encode_DAS_ReadArgument(&arg_pe,1,0,NULLCP,arg) != OK)
99: {
100: return(dapreject (di, DP_INVOKE, id, NULLCP, "Read argument encoding failed"));
101: }
102:
103: return (DapInvokeReqAux (ad, id, OP_READ, arg_pe, di, asyn));
104:
105: }
106:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.