25 #ifndef BRLAPI_INCLUDED
26 #define BRLAPI_INCLUDED
38 #define BRLAPI_RELEASE "0.6.5"
41 #define BRLAPI_MAJOR 0
44 #define BRLAPI_MINOR 6
47 #define BRLAPI_REVISION 5
52 #include <sys/types.h>
56 #define BRLAPI_STDCALL __stdcall
58 #define BRLAPI_STDCALL
62 typedef __int64 uint64_t;
63 typedef __int32 uint32_t;
64 #define UINT64_C(x) (x ## Ui64)
66 typedef signed int ssize_t;
120 #define BRLAPI_SOCKETPORTNUM 4101
121 #define BRLAPI_SOCKETPORT "4101"
124 #define BRLAPI_SOCKETPATH "/var/lib/BrlAPI"
130 #define BRLAPI_ETCDIR "/etc"
135 #define BRLAPI_AUTHKEYFILE "brlapi.key"
140 #define BRLAPI_DEFAUTH "none"
142 #define BRLAPI_DEFAUTH BRLAPI_ETCDIR "/" BRLAPI_AUTHKEYFILE
205 #define BRLAPI_SETTINGS_INITIALIZER { NULL, NULL }
252 #ifndef BRLAPI_NO_SINGLE_SESSION
264 #ifndef BRLAPI_NO_SINGLE_SESSION
284 #define BRLAPI_MAXNAMELENGTH 31
298 #ifndef BRLAPI_NO_SINGLE_SESSION
305 #ifndef BRLAPI_NO_SINGLE_SESSION
353 #ifndef BRLAPI_NO_SINGLE_SESSION
367 #define BRLAPI_TTY_DEFAULT -1
381 #ifndef BRLAPI_NO_SINGLE_SESSION
393 #ifndef BRLAPI_NO_SINGLE_SESSION
409 #ifndef BRLAPI_NO_SINGLE_SESSION
458 #ifndef BRLAPI_NO_SINGLE_SESSION
476 #ifndef BRLAPI_NO_SINGLE_SESSION
489 #ifndef BRLAPI_NO_SINGLE_SESSION
498 unsigned int regionBegin ;
499 unsigned int regionSize ;
502 unsigned char *andMask ;
503 unsigned char *orMask ;
512 #define BRLAPI_DISPLAY_DEFAULT -1
518 #define BRLAPI_CURSOR_LEAVE -1
524 #define BRLAPI_CURSOR_OFF 0
536 #define BRLAPI_WRITEARGUMENTS_INITIALIZER { \
537 .displayNumber = BRLAPI_DISPLAY_DEFAULT, \
544 .cursor = BRLAPI_CURSOR_LEAVE, \
584 #ifndef BRLAPI_NO_SINGLE_SESSION
610 unsigned int command ;
611 unsigned int argument ;
629 const char *command ;
630 unsigned int argument ;
647 #define BRLAPI_UC_ROW 0x2800UL
716 #ifndef BRLAPI_NO_SINGLE_SESSION
743 #ifndef BRLAPI_NO_SINGLE_SESSION
761 #ifndef BRLAPI_NO_SINGLE_SESSION
772 #ifndef BRLAPI_NO_SINGLE_SESSION
774 #define brlapi_ignoreAllKeys() brlapi_ignoreKeys(brlapi_rangeType_all, NULL, 0)
777 #define brlapi__ignoreAllKeys(handle) brlapi__ignoreKeys(handle, brlapi_rangeType_all, NULL, 0)
788 #ifndef BRLAPI_NO_SINGLE_SESSION
790 #define brlapi_acceptAllKeys() brlapi_acceptKeys(brlapi_rangeType_all, NULL, 0)
793 #define brlapi__acceptAllKeys(handle) brlapi__acceptKeys(handle, brlapi_rangeType_all, NULL, 0)
815 #ifndef BRLAPI_NO_SINGLE_SESSION
831 #ifndef BRLAPI_NO_SINGLE_SESSION
865 #ifndef BRLAPI_NO_SINGLE_SESSION
873 #ifndef BRLAPI_NO_SINGLE_SESSION
884 #ifndef BRLAPI_NO_SINGLE_SESSION
896 #ifndef BRLAPI_NO_SINGLE_SESSION
906 #ifndef BRLAPI_NO_SINGLE_SESSION
915 #ifndef BRLAPI_NO_SINGLE_SESSION
943 #define BRLAPI_ERROR_SUCCESS 0
944 #define BRLAPI_ERROR_NOMEM 1
945 #define BRLAPI_ERROR_TTYBUSY 2
946 #define BRLAPI_ERROR_DEVICEBUSY 3
947 #define BRLAPI_ERROR_UNKNOWN_INSTRUCTION 4
948 #define BRLAPI_ERROR_ILLEGAL_INSTRUCTION 5
949 #define BRLAPI_ERROR_INVALID_PARAMETER 6
950 #define BRLAPI_ERROR_INVALID_PACKET 7
951 #define BRLAPI_ERROR_CONNREFUSED 8
952 #define BRLAPI_ERROR_OPNOTSUPP 9
953 #define BRLAPI_ERROR_GAIERR 10
954 #define BRLAPI_ERROR_LIBCERR 11
955 #define BRLAPI_ERROR_UNKNOWNTTY 12
956 #define BRLAPI_ERROR_PROTOCOL_VERSION 13
957 #define BRLAPI_ERROR_EOF 14
958 #define BRLAPI_ERROR_EMPTYKEY 15
959 #define BRLAPI_ERROR_DRIVERERROR 16
960 #define BRLAPI_ERROR_AUTHENTICATION 17
1019 #define brlapi_error (*brlapi_error_location())
1021 #define brlapi_errno (brlapi_error.brlerrno)
1023 #define brlapi_libcerrno (brlapi_error.libcerrno)
1025 #define brlapi_gaierrno (brlapi_error.gaierrno)
1027 #define brlapi_errfun (brlapi_error.errfun)
1060 #ifndef BRLAPI_NO_SINGLE_SESSION
1075 #ifndef BRLAPI_NO_SINGLE_SESSION
1089 #ifndef BRLAPI_NO_SINGLE_SESSION
1094 #ifndef BRLAPI_NO_SINGLE_SESSION
1103 #ifndef BRLAPI_NO_SINGLE_SESSION
1104 int BRLAPI_STDCALL brlapi_writeTextWin(
int cursor,
const void *str,
int wide);
1108 #ifndef BRLAPI_NO_SINGLE_SESSION
1114 #ifndef BRLAPI_NO_SINGLE_SESSION
1115 #define brlapi_writeText(cursor, str) brlapi_writeTextWin(cursor, str, 1)
1117 #define brlapi__writeText(handle, cursor, str) brlapi__writeTextWin(handle, cursor, str, 1)
1119 #ifndef BRLAPI_NO_SINGLE_SESSION
1120 #define brlapi_write(s) brlapi_writeWin(s, 1)
1122 #define brlapi__write(handle, s) brlapi__writeWin(handle, s, 1)
1126 #ifndef BRLAPI_NO_SINGLE_SESSION
1127 #define brlapi_writeText(cursor, str) brlapi_writeTextWin(cursor, str, 0)
1129 #define brlapi__writeText(handle, cursor, str) brlapi__writeTextWin(handle, cursor, str, 0)
1131 #ifndef BRLAPI_NO_SINGLE_SESSION
1132 #define brlapi_write(s) brlapi_writeWin(s, 0)
1134 #define brlapi__write(handle, s) brlapi__writeWin(handle, s, 0)
1139 #ifndef BRLAPI_NO_DEPRECATED
1152 #define brlapi_settings_t brlapi_connectionSettings_t
1166 #define BRLAPI_WRITESTRUCT_INITIALIZER BRLAPI_WRITEARGUMENTS_INITIALIZER
1168 #define brl_keycode_t brlapi_keyCode_t
1169 #define brl_type_t brlapi_packetType_t
1171 #define BRLCOMMANDS NULL
1172 #define BRL_KEYCODE_MAX BRLAPI_KEY_MAX
1174 #ifndef BRLAPI_NO_SINGLE_SESSION
1175 #define brlapi_initializeConnection brlapi_openConnection
1176 #define brlapi_getTty brlapi_enterTtyMode
1177 #define brlapi_getTtyPath brlapi_enterTtyModeWithPath
1178 #define brlapi_leaveTty brlapi_leaveTtyMode
1179 #define brlapi_unignoreKeyRange brlapi_acceptKeyRange
1180 #define brlapi_unignoreKeySet brlapi_acceptKeySet
1181 #define brlapi_getRaw brlapi_enterRawMode
1182 #define brlapi_leaveRaw brlapi_leaveRawMode
1183 #define brlapi_suspend brlapi_suspendDriver
1184 #define brlapi_resume brlapi_resumeDriver
1187 #define BRLERR_SUCCESS BRLAPI_ERROR_SUCCESS
1188 #define BRLERR_NOMEM BRLAPI_ERROR_NOMEM
1189 #define BRLERR_TTYBUSY BRLAPI_ERROR_TTYBUSY
1190 #define BRLERR_DEVICEBUSY BRLAPI_ERROR_DEVICEBUSY
1191 #define BRLERR_UNKNOWN_INSTRUCTION BRLAPI_ERROR_UNKNOWN_INSTRUCTION
1192 #define BRLERR_ILLEGAL_INSTRUCTION BRLAPI_ERROR_ILLEGAL_INSTRUCTION
1193 #define BRLERR_INVALID_PARAMETER BRLAPI_ERROR_INVALID_PARAMETER
1194 #define BRLERR_INVALID_PACKET BRLAPI_ERROR_INVALID_PACKET
1195 #define BRLERR_CONNREFUSED BRLAPI_ERROR_CONNREFUSED
1196 #define BRLERR_OPNOTSUPP BRLAPI_ERROR_OPNOTSUPP
1197 #define BRLERR_GAIERR BRLAPI_ERROR_GAIERR
1198 #define BRLERR_LIBCERR BRLAPI_ERROR_LIBCERR
1199 #define BRLERR_UNKNOWNTTY BRLAPI_ERROR_UNKNOWNTTY
1200 #define BRLERR_PROTOCOL_VERSION BRLAPI_ERROR_PROTOCOL_VERSION
1201 #define BRLERR_EOF BRLAPI_ERROR_EOF
1202 #define BRLERR_EMPTYKEY BRLAPI_ERROR_EMPTYKEY
1203 #define BRLERR_DRIVERERROR BRLAPI_ERROR_DRIVERERROR
#define BRLAPI_STDCALL
Definition: brlapi.h:58
int BRLAPI_STDCALL brlapi_writeText(int cursor, const char *text)
int brlapi_fileDescriptor
Definition: brlapi.h:148
int BRLAPI_STDCALL brlapi_writeDots(const unsigned char *dots)
struct brlapi_handle_t brlapi_handle_t
Definition: brlapi.h:102
ssize_t BRLAPI_STDCALL brlapi__sendRaw(brlapi_handle_t *handle, const void *buffer, size_t size)
int BRLAPI_STDCALL brlapi_resumeDriver(void)
const char * brlapi_errlist[]
size_t BRLAPI_STDCALL brlapi_getHandleSize(void)
int gaierrno
Definition: brlapi.h:985
int BRLAPI_STDCALL brlapi__readKey(brlapi_handle_t *handle, int wait, brlapi_keyCode_t *code)
int BRLAPI_STDCALL brlapi__resumeDriver(brlapi_handle_t *handle)
int BRLAPI_STDCALL brlapi__getDisplaySize(brlapi_handle_t *handle, unsigned int *x, unsigned int *y)
int BRLAPI_STDCALL brlapi_getDisplaySize(unsigned int *x, unsigned int *y)
#define brlapi_error
Definition: brlapi.h:1019
int BRLAPI_STDCALL brlapi__acceptKeys(brlapi_handle_t *handle, brlapi_rangeType_t type, const brlapi_keyCode_t keys[], unsigned int count)
const char *BRLAPI_STDCALL brlapi_getPacketTypeName(brlapi_packetType_t type)
ssize_t BRLAPI_STDCALL brlapi_recvRaw(void *buffer, size_t size)
int displayNumber
Definition: brlapi.h:1156
unsigned int regionBegin
Definition: brlapi.h:1157
brlapi_keyCode_t first
Definition: brlapi.h:800
unsigned int regionSize
Definition: brlapi.h:1158
brlapi_keyCode_t last
Definition: brlapi.h:801
int BRLAPI_STDCALL brlapi__enterTtyModeWithPath(brlapi_handle_t *handle, int *ttys, int count, const char *driver)
void BRLAPI_STDCALL brlapi_closeConnection(void)
int BRLAPI_STDCALL brlapi__acceptKeyRanges(brlapi_handle_t *handle, brlapi_range_t ranges[], unsigned int count)
int cursor
Definition: brlapi.h:1163
int BRLAPI_STDCALL brlapi_ignoreKeys(brlapi_rangeType_t type, const brlapi_keyCode_t keys[], unsigned int count)
ssize_t BRLAPI_STDCALL brlapi_sendRaw(const void *buffer, size_t size)
void BRLAPI_STDCALL brlapi_perror(const char *s)
void(BRLAPI_STDCALL * brlapi__exceptionHandler_t)(brlapi_handle_t *handle, int error, brlapi_packetType_t type, const void *packet, size_t size)
Definition: brlapi.h:1063
int BRLAPI_STDCALL brlapi__leaveTtyMode(brlapi_handle_t *handle)
int BRLAPI_STDCALL brlapi_suspendDriver(const char *driver)
int BRLAPI_STDCALL brlapi__write(brlapi_handle_t *handle, const brlapi_writeArguments_t *arguments)
uint64_t brlapi_keyCode_t
Definition: brlapi_keycodes.h:90
int BRLAPI_STDCALL brlapi_acceptKeyRanges(brlapi_range_t ranges[], unsigned int count)
int BRLAPI_STDCALL brlapi__ignoreKeys(brlapi_handle_t *handle, brlapi_rangeType_t type, const brlapi_keyCode_t keys[], unsigned int count)
int BRLAPI_STDCALL brlapi__writeText(brlapi_handle_t *handle, int cursor, const char *text)
int BRLAPI_STDCALL brlapi_leaveRawMode(void)
#define brlapi_libcerrno
Definition: brlapi.h:1023
brlapi_error_t *BRLAPI_STDCALL brlapi_error_location(void)
int BRLAPI_STDCALL brlapi__enterRawMode(brlapi_handle_t *handle, const char *driver)
int textSize
Definition: brlapi.h:1160
void(BRLAPI_STDCALL * brlapi_exceptionHandler_t)(int error, brlapi_packetType_t type, const void *packet, size_t size)
Definition: brlapi.h:1061
void BRLAPI_STDCALL brlapi_defaultExceptionHandler(int error, brlapi_packetType_t type, const void *packet, size_t size)
int BRLAPI_STDCALL brlapi_write(const brlapi_writeArguments_t *arguments)
#define brlapi_errno
Definition: brlapi.h:1021
brlapi_fileDescriptor BRLAPI_STDCALL brlapi_openConnection(const brlapi_connectionSettings_t *desiredSettings, brlapi_connectionSettings_t *actualSettings)
Definition: brlapi.h:1155
int BRLAPI_STDCALL brlapi_getDriverName(char *buffer, size_t size)
int BRLAPI_STDCALL brlapi_strexception(char *buffer, size_t bufferSize, int error, brlapi_packetType_t type, const void *packet, size_t packetSize)
int BRLAPI_STDCALL brlapi_describeKeyCode(brlapi_keyCode_t code, brlapi_describedKeyCode_t *description)
int brlerrno
Definition: brlapi.h:983
#define BRLAPI_KEY_FLAGS_SHIFT
Definition: brlapi_keycodes.h:107
unsigned char * attrAnd
Definition: brlapi.h:1161
void BRLAPI_STDCALL brlapi__closeConnection(brlapi_handle_t *handle)
uint32_t brlapi_packetType_t
Definition: brlapi.h:1038
int BRLAPI_STDCALL brlapi__suspendDriver(brlapi_handle_t *handle, const char *driver)
#define brlapi_errfun
Definition: brlapi.h:1027
#define brlapi__acceptAllKeys(handle)
Definition: brlapi.h:793
int BRLAPI_STDCALL brlapi__strexception(brlapi_handle_t *handle, char *buffer, size_t bufferSize, int error, brlapi_packetType_t type, const void *packet, size_t packetSize)
char * text
Definition: brlapi.h:1159
int BRLAPI_STDCALL brlapi__writeDots(brlapi_handle_t *handle, const unsigned char *dots)
#define brlapi_acceptAllKeys()
Definition: brlapi.h:790
brlapi_exceptionHandler_t BRLAPI_STDCALL brlapi_setExceptionHandler(brlapi_exceptionHandler_t handler)
int BRLAPI_STDCALL brlapi_enterTtyModeWithPath(int *ttys, int count, const char *driver)
int BRLAPI_STDCALL brlapi_expandKeyCode(brlapi_keyCode_t code, brlapi_expandedKeyCode_t *expansion)
int BRLAPI_STDCALL brlapi_readKey(int wait, brlapi_keyCode_t *code)
const char * errfun
Definition: brlapi.h:986
int BRLAPI_STDCALL brlapi__ignoreKeyRanges(brlapi_handle_t *handle, brlapi_range_t ranges[], unsigned int count)
unsigned char * attrOr
Definition: brlapi.h:1162
int BRLAPI_STDCALL brlapi_enterTtyMode(int tty, const char *driver)
int BRLAPI_STDCALL brlapi__enterTtyMode(brlapi_handle_t *handle, int tty, const char *driver)
int BRLAPI_STDCALL brlapi_setFocus(int tty)
brlapi_rangeType_t
Definition: brlapi.h:722
int BRLAPI_STDCALL brlapi__setFocus(brlapi_handle_t *handle, int tty)
int BRLAPI_STDCALL brlapi__getDriverName(brlapi_handle_t *handle, char *buffer, size_t size)
brlapi_fileDescriptor BRLAPI_STDCALL brlapi__openConnection(brlapi_handle_t *handle, const brlapi_connectionSettings_t *desiredSettings, brlapi_connectionSettings_t *actualSettings)
char * host
Definition: brlapi.h:199
char * auth
Definition: brlapi.h:189
int BRLAPI_STDCALL brlapi__leaveRawMode(brlapi_handle_t *handle)
int BRLAPI_STDCALL brlapi__writeWText(brlapi_handle_t *handle, int cursor, const wchar_t *text)
int BRLAPI_STDCALL brlapi_enterRawMode(const char *driver)
void BRLAPI_STDCALL brlapi__defaultExceptionHandler(brlapi_handle_t *handle, int error, brlapi_packetType_t type, const void *packet, size_t size)
Settings structure for BrlAPI connection.
Definition: brlapi.h:181
int BRLAPI_STDCALL brlapi_acceptKeys(brlapi_rangeType_t type, const brlapi_keyCode_t keys[], unsigned int count)
int libcerrno
Definition: brlapi.h:984
char * charset
Definition: brlapi.h:1164
brlapi__exceptionHandler_t BRLAPI_STDCALL brlapi__setExceptionHandler(brlapi_handle_t *handle, brlapi__exceptionHandler_t handler)
int BRLAPI_STDCALL brlapi_writeWText(int cursor, const wchar_t *text)
#define brlapi_ignoreAllKeys()
Definition: brlapi.h:774
#define brlapi_gaierrno
Definition: brlapi.h:1025
const char *BRLAPI_STDCALL brlapi_strerror(const brlapi_error_t *error)
int BRLAPI_STDCALL brlapi_leaveTtyMode(void)
#define brlapi__ignoreAllKeys(handle)
Definition: brlapi.h:777
ssize_t BRLAPI_STDCALL brlapi__recvRaw(brlapi_handle_t *handle, void *buffer, size_t size)
int BRLAPI_STDCALL brlapi_ignoreKeyRanges(brlapi_range_t ranges[], unsigned int count)