home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 13 / 13.iso / s / s001 / 1.ddi / TS / SRC / GETPROC.C < prev    next >
Encoding:
C/C++ Source or Header  |  1987-12-19  |  709 b   |  33 lines

  1.                 /******************************************
  2.            *        GETPROC.C             *
  3.                * Copyright TimeSlice, Inc. 1985, 86, 87. *
  4.                ******************************************/
  5.  
  6.  
  7. #include <ts.h>
  8. #include <stdio.h>
  9.  
  10. /***
  11. * GETPROC( PROCNAME )
  12. * Return a PROCESS pointer to the first process (in the process list)
  13. * following curproc, having the name PROCNAME. Returns NULL if no
  14. * such process is found.
  15. ***/
  16. PROCESS *getproc( procname )
  17. char *procname;
  18. {
  19.   PROCESS *pp;
  20.  
  21.   ssleep();
  22.   pp = curproc;
  23.   do {
  24.     if( !strcmp( pp->name , procname ) ) {
  25.       swake();
  26.       return( pp );
  27.     }
  28.     pp = pp->nxt;
  29.   } while ( pp != curproc );
  30.   swake();
  31.   return( NULL );
  32. }
  33.