SplReleaseJob - Example Code

This sample code will release the job id that is entered at the prompt.

#define INCL_BASE
#define INCL_SPL
#define INCL_SPLERRORS
#include <os2.h>
#include <stdio.h>       /* for printf function */
#include <stdlib.h>      /* for atoi function   */

INT main (argc, argv)
   INT argc;
   CHAR *argv[];
{
   SPLERR splerr ;
   ULONG  ulJob ;
   PSZ    pszComputerName = NULL ;
   PSZ    pszQueueName = NULL ;

   /* Get job id from the input argument  */
   ulJob = atoi(argv[1]);

   /* Call the function to do the release. If an error is returned, print it. */
   splerr=SplReleaseJob( pszComputerName, pszQueueName, ulJob);
   switch (splerr)
   {
   case NO_ERROR:
      printf("Job %d was released.\n",ulJob);
      break;
   case NERR_JobNotFound:
      printf("Job does not exist.\n");
      break;
   case  NERR_JobInvalidState:
      printf("This operation can't be performed on the print Job.\n");
      break;
   default:
      printf("Errorcode = %ld\n",splerr);
   } /* endswitch */
   DosExit( EXIT_PROCESS , 0 ) ;
   argc;
   return (splerr);
}


[Back: SplReleaseJob - Related Functions]
[Next: SplReleaseJob - Topics]