/* $Id: dosio.c,v 1.2 1994/05/02 19:58:12 jraja Exp $
 *
 * dosio.c --- Initialize DOS IO
 *
 * Author: ppessi <Pekka.Pessi@hut.fi>
 *
 * Copyright (c) 1993 Pekka Pessi
 *
 * Created      : Mon Nov  1 08:04:20 1993 ppessi
 * Last modified: Mon Nov  1 08:04:37 1993 ppessi
 *
 * $Log: dosio.c,v $
 * Revision 1.2  1994/05/02  19:58:12  jraja
 * Changed special perror() to use PrintNetFault() of the net.lib.
 *
 * Revision 1.1  1994/01/20  17:00:35  ppessi
 * Initial revision
 *
 */

#if __SASC
#include <proto/dos.h>
#include <clib/exec_protos.h>
#include <pragmas/exec_sysbase_pragmas.h>
extern struct ExecBase *SysBase;
#elif __GNUC__
#include <inline/dos.h>
#include <inline/exec.h>
#else
#include <clib/dos_protos.h>
#include <clib/exec_protos.h>
#endif

#include <errno.h>
#include <exec/execbase.h>
#include <clib/netlib_protos.h>

#include "dosio.h"

BPTR Stdin = NULL;
BPTR Stdout = NULL;
BPTR Stderr = NULL;

void perror(const char *header)
{
	PrintNetFault(errno, header);
}

/*
 * Autoinitialize DOS IO
 */ 
void
_STIdosStdio(void)
{
  struct Process *p = (struct Process *)SysBase->ThisTask;

  Stdin = p->pr_CIS;
  Stdout = p->pr_COS;
  Stderr = p->pr_CES ? p->pr_CES : Stdout;
}
