home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / mitsch75.zip / scheme-7_5_17-src.zip / scheme-7.5.17 / src / microcode / osproc.h < prev    next >
C/C++ Source or Header  |  1999-01-02  |  4KB  |  116 lines

  1. /* -*-C-*-
  2.  
  3. $Id: osproc.h,v 1.10 1999/01/02 06:11:34 cph Exp $
  4.  
  5. Copyright (c) 1990-1999 Massachusetts Institute of Technology
  6.  
  7. This program is free software; you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation; either version 2 of the License, or (at
  10. your option) any later version.
  11.  
  12. This program is distributed in the hope that it will be useful, but
  13. WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15. General Public License for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with this program; if not, write to the Free Software
  19. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. */
  21.  
  22. #ifndef SCM_OSPROC_H
  23. #define SCM_OSPROC_H
  24.  
  25. #include "os.h"
  26.  
  27. typedef unsigned int Tprocess;
  28.  
  29. enum process_status
  30. {
  31.   process_status_free,        /* unused process table entry */
  32.   process_status_allocated,    /* being started */
  33.   process_status_running,    /* running */
  34.   process_status_stopped,    /* stopped but continuable */
  35.   process_status_exited,    /* terminated by calling _exit() */
  36.   process_status_signalled    /* terminated by being signalled */
  37. };
  38.  
  39. enum process_jc_status
  40. {
  41.   process_jc_status_no_ctty,    /* job has no control terminal */
  42.   process_jc_status_unrelated,    /* job's ctty different from Scheme's */
  43.   process_jc_status_no_jc,    /* job has same ctty, jc not available */
  44.   process_jc_status_jc        /* job has same ctty, jc available */
  45. };
  46.  
  47. enum process_ctty_type
  48. {
  49.   /* No controlling terminal.
  50.      Used for batch jobs, similar to `nohup' program. */
  51.   process_ctty_type_none,
  52.  
  53.   /* Use Scheme's controlling terminal, run in background. */
  54.   process_ctty_type_inherit_bg,
  55.  
  56.   /* Use Scheme's controlling terminal, run in foreground. */
  57.   process_ctty_type_inherit_fg,
  58.  
  59.   /* Use given controlling terminal, usually a PTY. */
  60.   process_ctty_type_explicit
  61. };
  62.  
  63. enum process_channel_type
  64. {
  65.   process_channel_type_none,
  66.   process_channel_type_inherit,
  67.   process_channel_type_ctty,
  68.   process_channel_type_explicit
  69. };
  70.  
  71. extern size_t OS_process_table_size;
  72. #define NO_PROCESS OS_process_table_size
  73. extern enum process_jc_status scheme_jc_status;
  74.  
  75. /* OS_make_subprocess is obsolete; use OS-specific procedure.  */
  76. extern Tprocess EXFUN
  77.   (OS_make_subprocess,
  78.    (CONST char * filename,
  79.     CONST char ** argv,
  80.     CONST char ** env,
  81.     CONST char * working_directory,
  82.     enum process_ctty_type ctty_type,
  83.     char * ctty_name,
  84.     enum process_channel_type channel_in_type,
  85.     Tchannel channel_in,
  86.     enum process_channel_type channel_out_type,
  87.     Tchannel channel_out,
  88.     enum process_channel_type channel_err_type,
  89.     Tchannel channel_err));
  90. extern void EXFUN (OS_process_deallocate, (Tprocess process));
  91.  
  92. extern int EXFUN (OS_process_valid_p, (Tprocess process));
  93. extern int EXFUN (OS_process_continuable_p, (Tprocess process));
  94. extern int EXFUN (OS_process_foregroundable_p, (Tprocess process));
  95.  
  96. extern pid_t EXFUN (OS_process_id, (Tprocess process));
  97. extern enum process_jc_status EXFUN (OS_process_jc_status, (Tprocess process));
  98. extern int EXFUN (OS_process_status_sync, (Tprocess process));
  99. extern int EXFUN (OS_process_status_sync_all, (void));
  100. extern int EXFUN (OS_process_any_status_change, (void));
  101. extern enum process_status EXFUN (OS_process_status, (Tprocess process));
  102. extern unsigned short EXFUN (OS_process_reason, (Tprocess process));
  103.  
  104. extern void EXFUN (OS_process_send_signal, (Tprocess process, int sig));
  105. extern void EXFUN (OS_process_kill, (Tprocess process));
  106. extern void EXFUN (OS_process_stop, (Tprocess process));
  107. extern void EXFUN (OS_process_interrupt, (Tprocess process));
  108. extern void EXFUN (OS_process_quit, (Tprocess process));
  109. extern void EXFUN (OS_process_hangup, (Tprocess process));
  110.  
  111. extern void EXFUN (OS_process_continue_background, (Tprocess process));
  112. extern void EXFUN (OS_process_continue_foreground, (Tprocess process));
  113. extern void EXFUN (OS_process_wait, (Tprocess process));
  114.  
  115. #endif /* SCM_OSPROC_H */
  116.