home *** CD-ROM | disk | FTP | other *** search
/ Network PC / Network PC.iso / amiga utilities / communication / internet / amitcp3.0b / src.lha / src / util / rsh / dosio.c next >
Encoding:
C/C++ Source or Header  |  1996-09-08  |  1.2 KB  |  61 lines

  1. /* $Id: dosio.c,v 1.2 1994/05/02 19:58:12 jraja Exp $
  2.  *
  3.  * dosio.c --- Initialize DOS IO
  4.  *
  5.  * Author: ppessi <Pekka.Pessi@hut.fi>
  6.  *
  7.  * Copyright (c) 1993 Pekka Pessi
  8.  *
  9.  * Created      : Mon Nov  1 08:04:20 1993 ppessi
  10.  * Last modified: Mon Nov  1 08:04:37 1993 ppessi
  11.  *
  12.  * $Log: dosio.c,v $
  13.  * Revision 1.2  1994/05/02  19:58:12  jraja
  14.  * Changed special perror() to use PrintNetFault() of the net.lib.
  15.  *
  16.  * Revision 1.1  1994/01/20  17:00:35  ppessi
  17.  * Initial revision
  18.  *
  19.  */
  20.  
  21. #if __SASC
  22. #include <proto/dos.h>
  23. #include <clib/exec_protos.h>
  24. #include <pragmas/exec_sysbase_pragmas.h>
  25. extern struct ExecBase *SysBase;
  26. #elif __GNUC__
  27. #include <inline/dos.h>
  28. #include <inline/exec.h>
  29. #else
  30. #include <clib/dos_protos.h>
  31. #include <clib/exec_protos.h>
  32. #endif
  33.  
  34. #include <errno.h>
  35. #include <exec/execbase.h>
  36. #include <clib/netlib_protos.h>
  37.  
  38. #include "dosio.h"
  39.  
  40. BPTR Stdin = NULL;
  41. BPTR Stdout = NULL;
  42. BPTR Stderr = NULL;
  43.  
  44. void perror(const char *header)
  45. {
  46.     PrintNetFault(errno, header);
  47. }
  48.  
  49. /*
  50.  * Autoinitialize DOS IO
  51.  */ 
  52. void
  53. _STIdosStdio(void)
  54. {
  55.   struct Process *p = (struct Process *)SysBase->ThisTask;
  56.  
  57.   Stdin = p->pr_CIS;
  58.   Stdout = p->pr_COS;
  59.   Stderr = p->pr_CES ? p->pr_CES : Stdout;
  60. }
  61.