Main Page   Modules   Data Structures   File List   Data Fields   Globals  

api.h File Reference

types, defines and functions prototypes for BrlAPI's library More...

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

Go to the source code of this file.

Data Structures

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

struct  extWriteStruct

Defines

#define BRLAPI_MAXPACKETSIZE   512
#define BRLAPI_SOCKETPORT   "35751"
#define BRLAPI_ETCDIR   "/etc"
#define BRLAPI_AUTHFILE   "brlapi.key"
#define BRLAPI_DEFAUTHPATH   BRLAPI_ETCDIR "/" BRLAPI_AUTHFILE
#define BRLKEYCODES   1
#define BRLCOMMANDS   2
#define BRLAPI_EXTWRITESTRUCT_INITIALIZER   { -1, 0, 0, NULL, NULL, NULL, -1};
#define BRL_KEYBUF_SIZE   256
#define BRL_KEYCODE_MAX   ((brl_keycode_t) (UINT32_MAX))
#define BRLERR_SUCCESS   0
#define BRLERR_NOMEM   1
#define BRLERR_TTYBUSY   2
#define BRLERR_UNKNOWN_INSTRUCTION   3
#define BRLERR_ILLEGAL_INSTRUCTION   4
#define BRLERR_INVALID_PARAMETER   5
#define BRLERR_INVALID_PACKET   6
#define BRLERR_RAWNOTSUPP   7
#define BRLERR_KEYSNOTSUPP   8
#define BRLERR_CONNREFUSED   9
#define BRLERR_OPNOTSUPP   10
#define BRLERR_GAIERR   11
#define BRLERR_LIBCERR   12
#define BRLERR_UNKNOWNTTY   13
#define BRLERR_PROTOCOL_VERSION   14
#define BRLERR_EOF   15
#define brlapi_errno   (*brlapi_errno_location ())
#define BRLAPI_EWF_DISPLAYNUMBER   0X01
#define BRLAPI_EWF_REGION   0X02
#define BRLAPI_EWF_TEXT   0X04
#define BRLAPI_EWF_ATTR_AND   0X08
#define BRLAPI_EWF_ATTR_OR   0X10
#define BRLAPI_EWF_CURSOR   0X20

Typedefs

typedef uint32_t brl_keycode_t

Functions

int brlapi_initializeConnection (const brlapi_settings_t *clientSettings, brlapi_settings_t *usedSettings)
void brlapi_closeConnection (void)
int brlapi_loadAuthKey (const char *filename, size_t *authlength, void *auth)
int brlapi_getDriverId (unsigned char *id, size_t n)
int brlapi_getDriverName (unsigned char *name, size_t n)
int brlapi_getDisplaySize (unsigned int *x, unsigned int *y)
int brlapi_getTty (int tty, int how)
int brlapi_leaveTty (void)
int brlapi_writeBrl (int cursor, const unsigned char *str)
int brlapi_writeBrlDots (const unsigned char *dots)
int brlapi_extWriteBrl (const brlapi_extWriteStruct *s)
int brlapi_readKey (int block, brl_keycode_t *code)
int brlapi_readCommand (int block, brl_keycode_t *code)
int brlapi_ignoreKeyRange (brl_keycode_t x, brl_keycode_t y)
int brlapi_ignoreKeySet (const brl_keycode_t *s, uint32_t n)
int brlapi_unignoreKeyRange (brl_keycode_t x, brl_keycode_t y)
int brlapi_unignoreKeySet (const brl_keycode_t *s, uint32_t n)
int brlapi_getRaw (void)
int brlapi_leaveRaw (void)
ssize_t brlapi_sendRaw (const unsigned char *buf, size_t size)
ssize_t brlapi_recvRaw (unsigned char *buf, size_t size)
void brlapi_perror (const char *s)
int * brlapi_errno_location (void)
const char * brlapi_strerror (void)

Variables

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


Detailed Description


Define Documentation

#define BRLAPI_EWF_ATTR_AND   0X08
 

And attributes

#define BRLAPI_EWF_ATTR_OR   0X10
 

Or attributes

#define BRLAPI_EWF_CURSOR   0X20
 

Cursor position

#define BRLAPI_EWF_DISPLAYNUMBER   0X01
 

Display number

#define BRLAPI_EWF_REGION   0X02
 

Region parameter

#define BRLAPI_EWF_TEXT   0X04
 

Contains some text

#define BRLAPI_MAXPACKETSIZE   512
 

Maximum packet size for packets exchanged on sockets and with braille terminal


Variable Documentation

pthread_mutex_t brlapi_fd_mutex
 

Mutex for protecting concurrent fd access

In order to regulate concurrent access to the library's file descriptor and requests to / answers from BrlAPI server, every function of the library locks this mutex, namely

If both these functions and brlapi_writePacket() or brlapi_readPacket() are used in a multithreaded application, this mutex must be locked before calling brlapi_writePacket() or brlapi_readPacket(), and unlocked afterwards.


Generated on Tue Jul 13 07:08:03 2004 for BrlAPI by doxygen1.2.18