2012-02-05 11:35:58 -05:00
|
|
|
/****************************************************************
|
|
|
|
* *
|
2012-03-24 14:06:46 -04:00
|
|
|
* Copyright 2001, 2011 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. *
|
|
|
|
* *
|
|
|
|
****************************************************************/
|
|
|
|
|
|
|
|
#include "mdef.h"
|
|
|
|
|
|
|
|
#include "gtm_string.h"
|
|
|
|
|
|
|
|
#include "compiler.h"
|
|
|
|
#include "opcode.h"
|
|
|
|
#include "toktyp.h"
|
|
|
|
#include "nametabtyp.h"
|
|
|
|
#include "job.h"
|
|
|
|
#include "advancewindow.h"
|
|
|
|
#include "namelook.h"
|
|
|
|
#include "mvalconv.h"
|
|
|
|
|
|
|
|
/* JOB Parameter tables */
|
|
|
|
#define JPSDEF(a,b,c) {a, b}
|
|
|
|
const static readonly nametabent job_param_names[] =
|
|
|
|
{
|
|
|
|
#include "jobparamstrs.h"
|
|
|
|
};
|
|
|
|
|
|
|
|
#undef JPSDEF
|
|
|
|
#define JPSDEF(a,b,c) c
|
|
|
|
const static readonly jp_type job_param_data[] =
|
|
|
|
{
|
2012-03-24 14:06:46 -04:00
|
|
|
#include "jobparamstrs.h" /* BYPASSOK */
|
2012-02-05 11:35:58 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
const static readonly unsigned char job_param_index[27] =
|
|
|
|
{
|
|
|
|
0, 2, 2, 2, 6, 8, 8, 10, 10, 14, 14, 14, 16,
|
|
|
|
16, 22, 24, 28, 28, 28, 34, 34, 34, 34, 34, 34, 34,
|
|
|
|
34
|
|
|
|
};
|
|
|
|
|
|
|
|
#undef JPDEF
|
|
|
|
#define JPDEF(a,b) b
|
|
|
|
LITDEF jp_datatype job_param_datatypes[] =
|
|
|
|
{
|
|
|
|
#include "jobparams.h"
|
|
|
|
};
|
|
|
|
|
2012-03-24 14:06:46 -04:00
|
|
|
error_def(ERR_JOBPARNOVAL);
|
|
|
|
error_def(ERR_JOBPARNUM);
|
|
|
|
error_def(ERR_JOBPARSTR);
|
|
|
|
error_def(ERR_JOBPARUNK);
|
|
|
|
error_def(ERR_JOBPARVALREQ);
|
2012-02-05 11:35:58 -05:00
|
|
|
|
|
|
|
int one_job_param (char **parptr)
|
|
|
|
{
|
|
|
|
boolean_t neg;
|
|
|
|
int x, num;
|
2012-03-24 14:06:46 -04:00
|
|
|
int len;
|
|
|
|
DCL_THREADGBL_ACCESS;
|
2012-02-05 11:35:58 -05:00
|
|
|
|
2012-03-24 14:06:46 -04:00
|
|
|
SETUP_THREADGBL_ACCESS;
|
|
|
|
if ((TK_IDENT != TREF(window_token))
|
|
|
|
|| (0 > (x = (namelook(job_param_index, job_param_names, (TREF(window_ident)).addr, (TREF(window_ident)).len)))))
|
|
|
|
{ /* NOTE assigment above */
|
2012-02-05 11:35:58 -05:00
|
|
|
stx_error (ERR_JOBPARUNK);
|
|
|
|
return FALSE;
|
|
|
|
}
|
2012-03-24 14:06:46 -04:00
|
|
|
advancewindow();
|
2012-02-05 11:35:58 -05:00
|
|
|
*(*parptr)++ = job_param_data[x];
|
|
|
|
if (job_param_datatypes[job_param_data[x]] != jpdt_nul)
|
|
|
|
{
|
2012-03-24 14:06:46 -04:00
|
|
|
if (TK_EQUAL != TREF(window_token))
|
2012-02-05 11:35:58 -05:00
|
|
|
{
|
|
|
|
stx_error (ERR_JOBPARVALREQ);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
advancewindow ();
|
|
|
|
switch (job_param_datatypes[job_param_data[x]])
|
|
|
|
{
|
2012-03-24 14:06:46 -04:00
|
|
|
case jpdt_num:
|
|
|
|
neg = FALSE;
|
|
|
|
if ((TK_MINUS == TREF(window_token)) && (TK_INTLIT == TREF(director_token)))
|
|
|
|
{
|
|
|
|
advancewindow();
|
|
|
|
neg = TRUE;
|
|
|
|
}
|
|
|
|
if (TK_INTLIT != TREF(window_token))
|
|
|
|
{
|
|
|
|
stx_error (ERR_JOBPARNUM);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
num = MV_FORCE_INTD(&(TREF(window_mval)));
|
|
|
|
*((int4 *)(*parptr)) = (neg ? -num : num);
|
|
|
|
*parptr += SIZEOF(int4);
|
|
|
|
break;
|
|
|
|
case jpdt_str:
|
|
|
|
if (TK_STRLIT != TREF(window_token))
|
|
|
|
{
|
|
|
|
stx_error (ERR_JOBPARSTR);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
len = (TREF(window_mval)).str.len;
|
|
|
|
*(*parptr)++ = len;
|
|
|
|
memcpy(*parptr, (TREF(window_mval)).str.addr, len);
|
|
|
|
*parptr += len;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
GTMASSERT;
|
2012-02-05 11:35:58 -05:00
|
|
|
}
|
|
|
|
advancewindow ();
|
2012-03-24 14:06:46 -04:00
|
|
|
} else if (TK_EQUAL == TREF(window_token))
|
2012-02-05 11:35:58 -05:00
|
|
|
{
|
|
|
|
stx_error (ERR_JOBPARNOVAL);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|