home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / hltrex.zip / haltrex.c next >
C/C++ Source or Header  |  1993-11-10  |  1KB  |  54 lines

  1. #define INCL_RXARI
  2.  
  3. #include <rexxsaa.h>
  4. #include <stdio.h>
  5.  
  6. main() {
  7.     CHAR         instring[20];
  8.     PID        pid;
  9.     TID        tid;
  10.     APIRET    rc;
  11.  
  12.     printf ("Enter the PID of the REXX process:\n");
  13.     gets(instring);
  14.     pid = atol(instring);
  15.  
  16.     printf ("Enter the TID of the REXX process:\n");
  17.     gets(instring);
  18.     tid = atol(instring);
  19.  
  20.     printf ("Enter (1) to RexxSetHalt\n");
  21.     printf ("Enter (2) to RexxSetTrace\n");
  22.     printf ("Enter (3) to RexxResetTrace\n");
  23.     gets(instring);
  24.     switch(instring[0]) {
  25.         case '1':
  26.             printf ("Now halting REXX pid %lX, thread %lX\n",
  27.                         pid,
  28.                         tid);
  29.             rc = RexxSetHalt(pid, tid);
  30.             break;
  31.  
  32.         case '2':
  33.             printf ("Now tracing REXX pid %lX, thread %lX\n",
  34.                         pid,
  35.                         tid);
  36.             rc = RexxSetTrace(pid, tid);
  37.             break;
  38.  
  39.         case '3':
  40.             printf ("Now tracing REXX pid %lX, thread %lX\n",
  41.                         pid,
  42.                         tid);
  43.             rc = RexxResetTrace(pid, tid);
  44.             break;
  45.  
  46.         default:
  47.             printf ("Command not recognized\n");
  48.     }
  49.  
  50.     printf ("REXX rc = %lu",
  51.                 rc);
  52.     return rc;
  53. }
  54.