14 #define S_READDIR (S_IRWXU | S_IRGRP | S_IROTH | S_IXGRP | S_IXOTH) 
   15 #define S_READ (S_IRUSR | S_IRGRP | S_IROTH | S_IWUSR) 
   16 #define S_READWRITE (S_IRUSR | S_IRGRP | S_IROTH | S_IWUSR | S_IWGRP | S_IWOTH) 
   17 #define S_CUSTOM (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP) 
   18 #define S_CUSTOM_R (S_IRUSR | S_IWUSR | S_IRGRP) 
   42 unsigned readlines(
int fd, readlines_ctx ctx, 
const char** input);
 
int rmdevpath(usbdevice *kb)
Remove the dev path for the keyboard at index. Returns 0 on success. 
 
void updateconnected()
Update the list of connected devices. 
 
struct _readlines_ctx * readlines_ctx
Custom readline is needed for FIFOs. fopen()/getline() will die if the data is sent in too fast...
 
void readlines_ctx_free(readlines_ctx ctx)
 
int rmnotifynode(usbdevice *kb, int notify)
Removes a notification node for the specified keyboard. 
 
long gid
Group ID for the control nodes. -1 to give read/write access to everybody. 
 
int mkdevpath(usbdevice *kb)
Create a dev path for the keyboard at index. Returns 0 on success. 
 
int mknotifynode(usbdevice *kb, int notify)
Creates a notification node for the specified keyboard. 
 
void readlines_ctx_init(readlines_ctx *ctx)
 
unsigned readlines(int fd, readlines_ctx ctx, const char **input)
 
Definitions for using USB interface. 
 
const char *const devpath
Device path base ("/dev/input/ckb" or "/var/run/ckb") 
 
int mkfwnode(usbdevice *kb)
Writes a keyboard's firmware version and poll rate to its device node.