File: show-tiocm.c.test

package info (click to toggle)
libdevice-serialport-perl 1.04-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 664 kB
  • sloc: perl: 4,737; makefile: 7
file content (28 lines) | stat: -rw-r--r-- 602 bytes parent folder | download | duplicates (5)
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
#include <stdio.h>

// for TIOCM* stuff...
#define TRY_TIOCM
#ifdef TRY_TIOCM
# include <termios.h>
#endif

// for TC* stuff...
#define TRY_TC
#ifdef TRY_TC
# include <sys/termiox.h>
#endif

int main()
{
#ifdef TRY_TIOCM
        printf("eval \"sub %s { 0x%x }\";\n","TIOCMBIS", TIOCMBIS);
        printf("eval \"sub %s { 0x%x }\";\n","TIOCMBIC", TIOCMBIC);
        printf("eval \"sub %s { 0x%x }\";\n","TIOCMGET", TIOCMGET);
#endif
#ifdef TRY_TC
        printf("eval \"sub %s { 0x%x }\";\n","TCGETX", TCGETX);
        printf("eval \"sub %s { 0x%x }\";\n","TCSETX", TCSETX);
#endif
        return 0;
}