File: INITIO.c

package info (click to toggle)
qepcad 1.74%2Bds-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,848 kB
  • sloc: ansic: 27,242; cpp: 2,995; makefile: 1,287; perl: 91
file content (34 lines) | stat: -rw-r--r-- 799 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*======================================================================
                      INITIO()

Initialize Input/Output.
======================================================================*/
#include "qepcad.h"
#include <stdlib.h>
#include <unistd.h>
#include <iostream>
#include "db/readlineistream.h"

void InputContextInit(istream&);
void OutputContextInit(ostream&);

void INITIO()
{
Step1: /* Initialize Input. */	  
       if (isatty(0)) 
	 InputContextInit(*(new readlineIstream()));
       else
	 InputContextInit(std::cin);
       
Step2: /* Initialize Output. */
       OutputContextInit(std::cout);

Step3: /* Control Echo. */
       if (!isatty(0) && !NOECHOSWITCHSET)
         setECHO(1);
       else
         setECHO(0);

Return: /* Prepare for return. */
       return;
}