JeVois  1.20
JeVois Smart Embedded Machine Vision Toolkit
Share this page:
Console.C File Reference
#include <jevois/Util/Console.H>
#include <stdexcept>
#include <string>
#include <linux/input.h>
#include <linux/kd.h>
#include <linux/keyboard.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <cctype>
Include dependency graph for Console.C:

Go to the source code of this file.

Macros

#define NELEMS(x)   (sizeof(x) / sizeof((x)[0]))
 
#define BITS_PER_LONG   (sizeof(unsigned long) * 8)
 
#define NBITS(x)   ((((x)-1)/BITS_PER_LONG)+1)
 
#define OFF(x)   ((x)%BITS_PER_LONG)
 
#define LONG(x)   ((x)/BITS_PER_LONG)
 
#define test_bit(bit, array)   ((array[LONG(bit)] >> OFF(bit)) & 1)
 
#define KDSKBMUTE   0x4B51
 
#define KDSKBMODE   0x4B45
 
#define K_OFF   0x04
 
#define IS_CONSOLE(fd)   isatty(fd) && ioctl(fd, KDGKBTYPE, &arg) == 0 && ((arg == KB_101) || (arg == KB_84))
 

Macro Definition Documentation

◆ BITS_PER_LONG

#define BITS_PER_LONG   (sizeof(unsigned long) * 8)

◆ IS_CONSOLE

#define IS_CONSOLE (   fd)    isatty(fd) && ioctl(fd, KDGKBTYPE, &arg) == 0 && ((arg == KB_101) || (arg == KB_84))

Definition at line 83 of file Console.C.

◆ K_OFF

#define K_OFF   0x04

Definition at line 76 of file Console.C.

◆ KDSKBMODE

#define KDSKBMODE   0x4B45

Definition at line 73 of file Console.C.

◆ KDSKBMUTE

#define KDSKBMUTE   0x4B51

Definition at line 70 of file Console.C.

◆ LONG

#define LONG (   x)    ((x)/BITS_PER_LONG)

◆ NBITS

#define NBITS (   x)    ((((x)-1)/BITS_PER_LONG)+1)

◆ NELEMS

#define NELEMS (   x)    (sizeof(x) / sizeof((x)[0]))

Definition at line 33 of file Console.C.

◆ OFF

#define OFF (   x)    ((x)%BITS_PER_LONG)

◆ test_bit

#define test_bit (   bit,
  array 
)    ((array[LONG(bit)] >> OFF(bit)) & 1)