File: termios.h

package info (click to toggle)
python-scrypt 0.9.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 832 kB
  • sloc: ansic: 6,290; python: 733; sh: 99; makefile: 5
file content (40 lines) | stat: -rw-r--r-- 1,006 bytes parent folder | download
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
35
36
37
38
39
40
#ifndef _MY_TERMIOS_H_
#define _MY_TERMIOS_H_

#ifdef _MSC_VER
/* 
 * Stub header for Windows - this isn't fully implemented
 * but provides the minimal set of definitions to make the code compile.
 */
#include <windows.h>

/* Termios structure stub */
typedef unsigned long tcflag_t;
typedef unsigned char cc_t;
typedef unsigned long speed_t;

#define NCCS 32

struct termios {
    tcflag_t c_iflag;    /* input modes */
    tcflag_t c_oflag;    /* output modes */
    tcflag_t c_cflag;    /* control modes */
    tcflag_t c_lflag;    /* local modes */
    cc_t c_cc[NCCS];     /* control characters */
};

/* Flags */
#define ECHO    0x00000001
#define ECHONL  0x00000002

/* Mode values */
#define TCSANOW     0
#define TCSAFLUSH   1

/* Function stubs for Windows */
static inline int tcgetattr(int fd, struct termios *termios_p) { return -1; }
static inline int tcsetattr(int fd, int optional_actions, const struct termios *termios_p) { return -1; }

#endif /* _MSC_VER */

#endif /* _MY_TERMIOS_H_ */