~ubuntu-branches/ubuntu/vivid/grass/vivid-proposed

« back to all changes in this revision

Viewing changes to lib/gis/intr_char.c

  • Committer: Package Import Robot
  • Author(s): Bas Couwenberg
  • Date: 2015-02-20 23:12:08 UTC
  • mfrom: (8.2.6 experimental)
  • Revision ID: package-import@ubuntu.com-20150220231208-1u6qvqm84v430b10
Tags: 7.0.0-1~exp1
* New upstream release.
* Update python-ctypes-ternary.patch to use if/else instead of and/or.
* Drop check4dev patch, rely on upstream check.
* Add build dependency on libpq-dev to grass-dev for libpq-fe.h.
* Drop patches applied upstream, refresh remaining patches.
* Update symlinks for images switched from jpg to png.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#include <grass/gis.h>
2
 
 
3
 
#include <grass/config.h>
4
 
#ifndef __MINGW32__
5
 
#if defined(HAVE_TERMIOS_H)
6
 
# include <termios.h>
7
 
# define TYPE termios
8
 
# define C c_cc[VINTR]
9
 
#elif defined(HAVE_TERMIO_H)
10
 
# include <termio.h>
11
 
# define TYPE termio
12
 
# define C c_cc[VINTR]
13
 
# define GET TCGETA
14
 
#else
15
 
# include <sgtty.h>
16
 
# define TYPE tchars
17
 
# define C t_intrc
18
 
# define GET TIOCGETC
19
 
#endif
20
 
#endif
21
 
 
22
 
/*!
23
 
 * \brief return interrupt char
24
 
 *
25
 
 * This routine returns the
26
 
 * user's keyboard interrupt character. This is the character that generates the
27
 
 * SIGINT signal from the keyboard.
28
 
 *
29
 
 *  \param ~
30
 
 *  \return char 
31
 
 */
32
 
 
33
 
char G_intr_char(void)
34
 
{
35
 
    char c = 0;
36
 
 
37
 
#ifndef __MINGW32__
38
 
    struct TYPE buf;
39
 
 
40
 
#ifdef HAVE_TERMIOS_H
41
 
    tcgetattr(2, &buf);
42
 
#else
43
 
    ioctl(2, GET, &buf);
44
 
#endif
45
 
    c = buf.C;
46
 
#endif
47
 
    return c;
48
 
}