2012-02-05 11:35:58 -05:00
|
|
|
/****************************************************************
|
|
|
|
* *
|
2024-07-19 11:43:27 -04:00
|
|
|
* Copyright 2001, 2012 Fidelity Information Services, Inc *
|
2012-02-05 11:35:58 -05:00
|
|
|
* *
|
|
|
|
* This source code contains the intellectual property *
|
|
|
|
* of its copyright holder(s), and is made available *
|
|
|
|
* under a license. If you do not know the terms of *
|
|
|
|
* the license, please stop and do not read further. *
|
|
|
|
* *
|
|
|
|
****************************************************************/
|
|
|
|
|
|
|
|
/* Handle indirect device parameters for open, use and close commands */
|
|
|
|
#include "mdef.h"
|
|
|
|
#include "compiler.h"
|
|
|
|
#include "opcode.h"
|
|
|
|
#include "indir_enum.h"
|
|
|
|
#include "toktyp.h"
|
|
|
|
#include "io_params.h"
|
|
|
|
#include "cache.h"
|
|
|
|
#include "hashtab_objcode.h"
|
|
|
|
#include "deviceparameters.h"
|
|
|
|
#include "op.h"
|
|
|
|
|
2012-03-24 14:06:46 -04:00
|
|
|
error_def(ERR_INDEXTRACHARS);
|
2012-02-05 11:35:58 -05:00
|
|
|
|
|
|
|
void op_inddevparms(mval *devpsrc, int4 ok_iop_parms, mval *devpiopl)
|
|
|
|
{
|
2012-03-24 14:06:46 -04:00
|
|
|
int rval;
|
|
|
|
icode_str indir_src;
|
2012-02-05 11:35:58 -05:00
|
|
|
mstr *obj, object;
|
2024-07-19 11:43:27 -04:00
|
|
|
oprtype devpopr, plist, getdst;
|
2012-02-05 11:35:58 -05:00
|
|
|
triple *indref;
|
2012-03-24 14:06:46 -04:00
|
|
|
DCL_THREADGBL_ACCESS;
|
2012-02-05 11:35:58 -05:00
|
|
|
|
2012-03-24 14:06:46 -04:00
|
|
|
SETUP_THREADGBL_ACCESS;
|
2012-02-05 11:35:58 -05:00
|
|
|
MV_FORCE_STR(devpsrc);
|
|
|
|
indir_src.str = devpsrc->str;
|
|
|
|
indir_src.code = indir_devparms;
|
2012-03-24 14:06:46 -04:00
|
|
|
if (NULL == (obj = cache_get(&indir_src))) /* NOTE assignment */
|
2012-02-05 11:35:58 -05:00
|
|
|
{ /* No cached version, compile it now */
|
2012-03-24 14:06:46 -04:00
|
|
|
obj = &object;
|
2024-07-19 11:43:27 -04:00
|
|
|
comp_init(&devpsrc->str, &getdst);
|
2012-03-24 14:06:46 -04:00
|
|
|
if (TK_ATSIGN == TREF(window_token))
|
2012-02-05 11:35:58 -05:00
|
|
|
{ /* For the indirection-obsessive */
|
2012-03-24 14:06:46 -04:00
|
|
|
if (EXPR_FAIL != (rval = indirection(&devpopr))) /* NOTE assignment */
|
2012-02-05 11:35:58 -05:00
|
|
|
{
|
|
|
|
indref = newtriple(OC_INDDEVPARMS);
|
|
|
|
indref->operand[0] = devpopr;
|
|
|
|
indref->operand[1] = put_ilit(ok_iop_parms);
|
|
|
|
plist = put_tref(indref);
|
|
|
|
}
|
|
|
|
} else /* We have the parm string to process now */
|
2012-03-24 14:06:46 -04:00
|
|
|
rval = deviceparameters(&plist, ok_iop_parms);
|
2024-07-19 11:43:27 -04:00
|
|
|
if (EXPR_FAIL == comp_fini(rval, obj, OC_IRETMVAL, &plist, &getdst, devpsrc->str.len))
|
2012-02-05 11:35:58 -05:00
|
|
|
return;
|
|
|
|
indir_src.str.addr = devpsrc->str.addr;
|
2012-03-24 14:06:46 -04:00
|
|
|
cache_put(&indir_src, obj);
|
2012-02-05 11:35:58 -05:00
|
|
|
/* Fall into code activation below */
|
|
|
|
}
|
2024-07-19 11:43:27 -04:00
|
|
|
TREF(ind_result) = devpiopl; /* Where to store return value */
|
2012-02-05 11:35:58 -05:00
|
|
|
comp_indr(obj);
|
2012-03-24 14:06:46 -04:00
|
|
|
return;
|
2012-02-05 11:35:58 -05:00
|
|
|
}
|