NetBatch Management Programming Manual

Sample Programs
NetBatch Management Programming Manual522462-003
C-11
Sample C Program
spi_err = SSPUT ( (short *) spi_buff, (short *) zbat_map_def_job, (char
*) &JOB );
if (spi_err != ZSPI_ERR_OK)
stopwitherror(spi_err, (char *) &essput);
/* Do WriteRead to scheduler */
retcode = send_spi();
if (retcode != 0)
stopwitherror(retcode, (char *) &eretcode);
}
#pragma page
/*
*--------------------------------------------------------------------
* status_job
* Use:
* Perform status job on the job number passed
* Effects:
* Sets SPI buffer to status job details if successful
* Stops program otherwise
*
*--------------------------------------------------------------------
*/
void status_job(const int jobnum)
{
int retcode = 0;
/* Initialize the SPI buffer */
spi_err = SSINIT (
(short *) spi_buff /* SPI buffer
*/
,(ZBAT_VAL_BUFLEN+6) /* SPI buffer length
*/
,(short *) &zbat_val_ssid /* SSID - subsystem ID
*/
,ZSPI_VAL_CMDHDR /* SPI buffer type
*/
,ZBAT_CMD_STATUS /* Command number
*/
,ZBAT_OBJ_JOB /* Object type
*/
,0 /* Max-resp
*/
, /* Server-vrsn
*/
,ZSPI_VAL_TRUE /* Checksum enabled
*/
);
if (spi_err != ZSPI_ERR_OK)
stopwitherror(spi_err, (char *) &essinit);
/* Insert the job number into zbat_tkn_sel_job_number */
(continued)