~ubuntu-branches/debian/jessie/eso-midas/jessie

« back to all changes in this revision

Viewing changes to libsrc/agl/aglbsd.c

  • Committer: Package Import Robot
  • Author(s): Ole Streicher
  • Date: 2014-04-22 14:44:58 UTC
  • Revision ID: package-import@ubuntu.com-20140422144458-okiwi1assxkkiz39
Tags: upstream-13.09pl1.2+dfsg
ImportĀ upstreamĀ versionĀ 13.09pl1.2+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* @(#)aglbsd.c 19.1 (ES0-DMD) 02/25/03 13:53:03 */
 
2
/*===========================================================================
 
3
  Copyright (C) 1995 European Southern Observatory (ESO)
 
4
 
 
5
  This program is free software; you can redistribute it and/or 
 
6
  modify it under the terms of the GNU General Public License as 
 
7
  published by the Free Software Foundation; either version 2 of 
 
8
  the License, or (at your option) any later version.
 
9
 
 
10
  This program is distributed in the hope that it will be useful,
 
11
  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
  GNU General Public License for more details.
 
14
 
 
15
  You should have received a copy of the GNU General Public 
 
16
  License along with this program; if not, write to the Free 
 
17
  Software Foundation, Inc., 675 Massachusetss Ave, Cambridge, 
 
18
  MA 02139, USA.
 
19
 
 
20
  Corresponding concerning ESO-MIDAS should be addressed as follows:
 
21
        Internet e-mail: midas@eso.org
 
22
        Postal address: European Southern Observatory
 
23
                        Data Management Division 
 
24
                        Karl-Schwarzschild-Strasse 2
 
25
                        D 85748 Garching bei Muenchen 
 
26
                        GERMANY
 
27
===========================================================================*/
 
28
 
 
29
/* @(#)aglbsd.c 19.1 (OAA-ASTRONET) 02/25/03 13:53:03 */
 
30
/*
 
31
 * HEADER : aglbsd.c       - Vers 3.6.000  - Oct 1991 -  L. Fini, OAA
 
32
 *                                                       C. Guirao, ESO-IPG
 
33
 *
 
34
 * This file contains system dependent features which are common to 
 
35
 * Unix BSD systems
 
36
 *
 
37
 * CG: Modifications to do it really BSD system.
 
38
 * LF: Bug fixes to modifications (hope it is still BSD !)
 
39
 */
 
40
 
 
41
 
 
42
/***************************************************************************/
 
43
/*                      AGL_setraw  AGL_reset                              */
 
44
 
 
45
/* This routines are used to set the specified device handler in RAW mode  */
 
46
/* and to reset it in COOKED mode thereafter                               */
 
47
 
 
48
static struct sgttyb argp;
 
49
 
 
50
static unsigned long flags;
 
51
 
 
52
void AGL_setraw (filpt)
 
53
FILE * filpt;
 
54
{
 
55
int handler = fileno(filpt);
 
56
ioctl(handler,TIOCGETP,&argp);          /* Get current terminal status  */
 
57
flags = argp.sg_flags;                  /* Save flags */
 
58
argp.sg_flags = (flags & (~ECHO)) | RAW;        /* LF 920117            */
 
59
ioctl(handler,TIOCSETP,&argp);          /* Force RAW mode               */
 
60
}
 
61
 
 
62
void AGL_reset(filpt)
 
63
FILE * filpt;
 
64
{
 
65
int handler = fileno(filpt);
 
66
argp.sg_flags = flags;
 
67
ioctl(handler,TIOCSETP,&argp);  /* Reset terminal status         */
 
68
}