Main Page | Modules | Data Structures | File List | Data Fields | Globals

brlapi.h File Reference

types, defines and functions prototypes for BrlAPI More...

#include <inttypes.h>
#include <unistd.h>
#include <pthread.h>

Go to the source code of this file.

Data Structures

struct  brlapi_settings_t
 Settings structure for BrlAPI connection. More...

struct  brlapi_keybinding_t
 Key binding structure. More...


Defines

#define BRLAPI_SOCKETPORT   "35751"
#define BRLAPI_ETCDIR   "/etc"
#define BRLAPI_AUTHFILE   "brlapi.key"
#define BRLAPI_AUTHNAME   BRLAPI_ETCDIR "/" BRLAPI_AUTHFILE
#define BRLKEYCODES   ((uint32_t) 1)
#define BRLCOMMANDS   ((uint32_t) 2)
#define BRL_KEYBUF_SIZE   256
#define BRL_KEYCODE_MAX   ((brl_keycode_t) (UINT32_MAX))
#define BRLAPI_HOMEKEYDIR   ".brlkeys"
#define BRLAPI_HOMEKEYEXT   ".kbd"
#define BRLAPI_ETCKEYFILE   "brlkeys"
#define BRLERR_SUCCESS   0 /**< Success */
#define BRLERR_NOMEM   1 /**< Not enough memory */
#define BRLERR_TTYBUSY   2 /**< Already a connection running in this tty */
#define BRLERR_UNKNOWN_INSTRUCTION   3 /**< Not implemented in protocol */
#define BRLERR_ILLEGAL_INSTRUCTION   4 /**< Forbiden in current mode */
#define BRLERR_INVALID_PARAMETER   5 /**< Out of range or have no sense */
#define BRLERR_INVALID_PACKET   6 /**< Invalid size */
#define BRLERR_RAWNOTSUPP   7 /**< Raw mode not supported by loaded driver */
#define BRLERR_KEYSNOTSUPP   8 /**< Reading of key codes not supported by loaded driver */
#define BRLERR_CONNREFUSED   9 /**< Connection refused */
#define BRLERR_OPNOTSUPP   10 /**< Operation not supported */
#define BRLERR_GAIERR   11 /**< Getaddrinfo error */
#define BRLERR_LIBCERR   12 /**< Libc error */
#define BRLERR_UNKNOWNTTY   13 /**< Couldn't find out the tty number */
#define brlapi_errno   (*brlapi_errno_location ())
#define BRLAPI_MAXPACKETSIZE   512
#define BRLPACKET_AUTHKEY   'K' /**< Authentication key */
#define BRLPACKET_BYE   'B' /**< Bye */
#define BRLPACKET_GETDRIVERID   'd' /**< Ask which driver is used */
#define BRLPACKET_GETDRIVERNAME   'n' /**< Ask which driver is used */
#define BRLPACKET_GETDISPLAYSIZE   's' /**< Dimensions of brl display */
#define BRLPACKET_GETTTY   't' /**< asks for a specified tty */
#define BRLPACKET_LEAVETTY   'L' /**< release the tty */
#define BRLPACKET_KEY   'k' /**< braille key */
#define BRLPACKET_COMMAND   'c' /**< braille command */
#define BRLPACKET_MASKKEYS   'm' /**< Mask a key-range */
#define BRLPACKET_UNMASKKEYS   'u' /**< Unmask key range */
#define BRLPACKET_WRITE   'W' /**< Write On Braille Display */
#define BRLPACKET_WRITEDOTS   'D' /**< Write Dots On Braille Display */
#define BRLPACKET_STATWRITE   'S' /**< Write Status Cells */
#define BRLPACKET_GETRAW   '*' /**< Enter in raw mode */
#define BRLPACKET_LEAVERAW   '#' /**< Leave raw mode */
#define BRLPACKET_PACKET   'p' /**< Raw packets */
#define BRLPACKET_ACK   'A' /**< Acknowledgement */
#define BRLPACKET_ERROR   'E' /**< Error in protocol */
#define BRLRAW_MAGIC   (0xdeadbeefL)

Typedefs

typedef uint32_t brl_keycode_t
typedef uint32_t brl_type_t

Functions

int brlapi_initializeConnection (const brlapi_settings_t *clientSettings, brlapi_settings_t *usedSettings)
void brlapi_closeConnection (void)
int brlapi_loadAuthKey (const char *filename, int *authlength, void *auth)
int brlapi_getControllingTty (void)
char * brlapi_getDriverId (void)
char * brlapi_getDriverName (void)
int brlapi_getDisplaySize (unsigned int *x, unsigned int *y)
int brlapi_getTty (uint32_t tty, uint32_t how, brlapi_keybinding_t *keybinding)
int brlapi_leaveTty (void)
int brlapi_writeBrl (uint32_t cursor, const char *str)
int brlapi_writeBrlDots (const char *dots)
int brlapi_readKey (int block, brl_keycode_t *code)
int brlapi_readCommand (int block, brl_keycode_t *code)
int brlapi_readBinding (int block, const char **code)
int brlapi_ignoreKeys (brl_keycode_t x, brl_keycode_t y)
int brlapi_unignoreKeys (brl_keycode_t x, brl_keycode_t y)
int brlapi_getRaw (void)
int brlapi_leaveRaw (void)
int brlapi_sendRaw (const unsigned char *buf, size_t size)
int brlapi_recvRaw (unsigned char *buf, size_t size)
void brlapi_perror (const char *s)
int * brlapi_errno_location (void)
int brlapi_writePacket (int fd, brl_type_t type, const void *buf, size_t size)
int brlapi_readPacket (int fd, brl_type_t *type, void *buf, size_t size)

Variables

const char * brlapi_errlist []
const int brlapi_nerr
int brlapi_errno
pthread_mutex_t brlapi_fd_mutex


Detailed Description


Generated on Fri Mar 12 19:32:18 2004 for BrlAPI by doxygen 1.3.6-20040222