25 #ifndef BRLAPI_INCLUDED 26 #define BRLAPI_INCLUDED 38 #define BRLAPI_RELEASE "0.6.7" 41 #define BRLAPI_MAJOR 0 44 #define BRLAPI_MINOR 6 47 #define BRLAPI_REVISION 7 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_KEYFILE "keyfile:" BRLAPI_ETCDIR "/" BRLAPI_AUTHKEYFILE 145 #define BRLAPI_DEFAUTH_POLKIT "+polkit" 147 #define BRLAPI_DEFAUTH_POLKIT "" 150 #define BRLAPI_DEFAUTH BRLAPI_DEFAUTH_KEYFILE BRLAPI_DEFAUTH_POLKIT 213 #define BRLAPI_SETTINGS_INITIALIZER { NULL, NULL } 260 #ifndef BRLAPI_NO_SINGLE_SESSION 272 #ifndef BRLAPI_NO_SINGLE_SESSION 292 #define BRLAPI_MAXNAMELENGTH 31 306 #ifndef BRLAPI_NO_SINGLE_SESSION 323 #ifndef BRLAPI_NO_SINGLE_SESSION 330 #ifndef BRLAPI_NO_SINGLE_SESSION 378 #ifndef BRLAPI_NO_SINGLE_SESSION 392 #define BRLAPI_TTY_DEFAULT -1 406 #ifndef BRLAPI_NO_SINGLE_SESSION 418 #ifndef BRLAPI_NO_SINGLE_SESSION 434 #ifndef BRLAPI_NO_SINGLE_SESSION 483 #ifndef BRLAPI_NO_SINGLE_SESSION 501 #ifndef BRLAPI_NO_SINGLE_SESSION 514 #ifndef BRLAPI_NO_SINGLE_SESSION 523 unsigned int regionBegin ;
524 unsigned int regionSize ;
527 unsigned char *andMask ;
528 unsigned char *orMask ;
537 #define BRLAPI_DISPLAY_DEFAULT -1 543 #define BRLAPI_CURSOR_LEAVE -1 549 #define BRLAPI_CURSOR_OFF 0 561 #define BRLAPI_WRITEARGUMENTS_INITIALIZER { \ 562 .displayNumber = BRLAPI_DISPLAY_DEFAULT, \ 569 .cursor = BRLAPI_CURSOR_LEAVE, \ 609 #ifndef BRLAPI_NO_SINGLE_SESSION 635 unsigned int command ;
636 unsigned int argument ;
654 const char *command ;
655 unsigned int argument ;
672 #define BRLAPI_UC_ROW 0x2800UL 741 #ifndef BRLAPI_NO_SINGLE_SESSION 768 #ifndef BRLAPI_NO_SINGLE_SESSION 786 #ifndef BRLAPI_NO_SINGLE_SESSION 797 #ifndef BRLAPI_NO_SINGLE_SESSION 799 #define brlapi_ignoreAllKeys() brlapi_ignoreKeys(brlapi_rangeType_all, NULL, 0) 802 #define brlapi__ignoreAllKeys(handle) brlapi__ignoreKeys(handle, brlapi_rangeType_all, NULL, 0) 813 #ifndef BRLAPI_NO_SINGLE_SESSION 815 #define brlapi_acceptAllKeys() brlapi_acceptKeys(brlapi_rangeType_all, NULL, 0) 818 #define brlapi__acceptAllKeys(handle) brlapi__acceptKeys(handle, brlapi_rangeType_all, NULL, 0) 840 #ifndef BRLAPI_NO_SINGLE_SESSION 856 #ifndef BRLAPI_NO_SINGLE_SESSION 890 #ifndef BRLAPI_NO_SINGLE_SESSION 898 #ifndef BRLAPI_NO_SINGLE_SESSION 909 #ifndef BRLAPI_NO_SINGLE_SESSION 921 #ifndef BRLAPI_NO_SINGLE_SESSION 931 #ifndef BRLAPI_NO_SINGLE_SESSION 940 #ifndef BRLAPI_NO_SINGLE_SESSION 968 #define BRLAPI_ERROR_SUCCESS 0 969 #define BRLAPI_ERROR_NOMEM 1 970 #define BRLAPI_ERROR_TTYBUSY 2 971 #define BRLAPI_ERROR_DEVICEBUSY 3 972 #define BRLAPI_ERROR_UNKNOWN_INSTRUCTION 4 973 #define BRLAPI_ERROR_ILLEGAL_INSTRUCTION 5 974 #define BRLAPI_ERROR_INVALID_PARAMETER 6 975 #define BRLAPI_ERROR_INVALID_PACKET 7 976 #define BRLAPI_ERROR_CONNREFUSED 8 977 #define BRLAPI_ERROR_OPNOTSUPP 9 978 #define BRLAPI_ERROR_GAIERR 10 979 #define BRLAPI_ERROR_LIBCERR 11 980 #define BRLAPI_ERROR_UNKNOWNTTY 12 981 #define BRLAPI_ERROR_PROTOCOL_VERSION 13 982 #define BRLAPI_ERROR_EOF 14 983 #define BRLAPI_ERROR_EMPTYKEY 15 984 #define BRLAPI_ERROR_DRIVERERROR 16 985 #define BRLAPI_ERROR_AUTHENTICATION 17 1044 #define brlapi_error (*brlapi_error_location()) 1046 #define brlapi_errno (brlapi_error.brlerrno) 1048 #define brlapi_libcerrno (brlapi_error.libcerrno) 1050 #define brlapi_gaierrno (brlapi_error.gaierrno) 1052 #define brlapi_errfun (brlapi_error.errfun) 1085 #ifndef BRLAPI_NO_SINGLE_SESSION 1100 #ifndef BRLAPI_NO_SINGLE_SESSION 1114 #ifndef BRLAPI_NO_SINGLE_SESSION 1119 #ifndef BRLAPI_NO_SINGLE_SESSION 1128 #ifndef BRLAPI_NO_SINGLE_SESSION 1129 int BRLAPI_STDCALL brlapi_writeTextWin(
int cursor,
const void *str,
int wide);
1133 #ifndef BRLAPI_NO_SINGLE_SESSION 1139 #ifndef BRLAPI_NO_SINGLE_SESSION 1140 #define brlapi_writeText(cursor, str) brlapi_writeTextWin(cursor, str, 1) 1142 #define brlapi__writeText(handle, cursor, str) brlapi__writeTextWin(handle, cursor, str, 1) 1144 #ifndef BRLAPI_NO_SINGLE_SESSION 1145 #define brlapi_write(s) brlapi_writeWin(s, 1) 1147 #define brlapi__write(handle, s) brlapi__writeWin(handle, s, 1) 1151 #ifndef BRLAPI_NO_SINGLE_SESSION 1152 #define brlapi_writeText(cursor, str) brlapi_writeTextWin(cursor, str, 0) 1154 #define brlapi__writeText(handle, cursor, str) brlapi__writeTextWin(handle, cursor, str, 0) 1156 #ifndef BRLAPI_NO_SINGLE_SESSION 1157 #define brlapi_write(s) brlapi_writeWin(s, 0) 1159 #define brlapi__write(handle, s) brlapi__writeWin(handle, s, 0) 1164 #ifndef BRLAPI_NO_DEPRECATED 1177 #define brlapi_settings_t brlapi_connectionSettings_t 1191 #define BRLAPI_WRITESTRUCT_INITIALIZER BRLAPI_WRITEARGUMENTS_INITIALIZER 1193 #define brl_keycode_t brlapi_keyCode_t 1194 #define brl_type_t brlapi_packetType_t 1196 #define BRLCOMMANDS NULL 1197 #define BRL_KEYCODE_MAX BRLAPI_KEY_MAX 1199 #ifndef BRLAPI_NO_SINGLE_SESSION 1200 #define brlapi_initializeConnection brlapi_openConnection 1201 #define brlapi_getTty brlapi_enterTtyMode 1202 #define brlapi_getTtyPath brlapi_enterTtyModeWithPath 1203 #define brlapi_leaveTty brlapi_leaveTtyMode 1204 #define brlapi_unignoreKeyRange brlapi_acceptKeyRange 1205 #define brlapi_unignoreKeySet brlapi_acceptKeySet 1206 #define brlapi_getRaw brlapi_enterRawMode 1207 #define brlapi_leaveRaw brlapi_leaveRawMode 1208 #define brlapi_suspend brlapi_suspendDriver 1209 #define brlapi_resume brlapi_resumeDriver 1212 #define BRLERR_SUCCESS BRLAPI_ERROR_SUCCESS 1213 #define BRLERR_NOMEM BRLAPI_ERROR_NOMEM 1214 #define BRLERR_TTYBUSY BRLAPI_ERROR_TTYBUSY 1215 #define BRLERR_DEVICEBUSY BRLAPI_ERROR_DEVICEBUSY 1216 #define BRLERR_UNKNOWN_INSTRUCTION BRLAPI_ERROR_UNKNOWN_INSTRUCTION 1217 #define BRLERR_ILLEGAL_INSTRUCTION BRLAPI_ERROR_ILLEGAL_INSTRUCTION 1218 #define BRLERR_INVALID_PARAMETER BRLAPI_ERROR_INVALID_PARAMETER 1219 #define BRLERR_INVALID_PACKET BRLAPI_ERROR_INVALID_PACKET 1220 #define BRLERR_CONNREFUSED BRLAPI_ERROR_CONNREFUSED 1221 #define BRLERR_OPNOTSUPP BRLAPI_ERROR_OPNOTSUPP 1222 #define BRLERR_GAIERR BRLAPI_ERROR_GAIERR 1223 #define BRLERR_LIBCERR BRLAPI_ERROR_LIBCERR 1224 #define BRLERR_UNKNOWNTTY BRLAPI_ERROR_UNKNOWNTTY 1225 #define BRLERR_PROTOCOL_VERSION BRLAPI_ERROR_PROTOCOL_VERSION 1226 #define BRLERR_EOF BRLAPI_ERROR_EOF 1227 #define BRLERR_EMPTYKEY BRLAPI_ERROR_EMPTYKEY 1228 #define BRLERR_DRIVERERROR BRLAPI_ERROR_DRIVERERROR
#define BRLAPI_STDCALL
Definition: brlapi.h:58
int BRLAPI_STDCALL brlapi_ignoreKeyRanges(const brlapi_range_t ranges[], unsigned int count)
int BRLAPI_STDCALL brlapi_writeText(int cursor, const char *text)
int brlapi_fileDescriptor
Definition: brlapi.h:156
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:1010
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:1044
int BRLAPI_STDCALL brlapi__ignoreKeyRanges(brlapi_handle_t *handle, const brlapi_range_t ranges[], unsigned int count)
int BRLAPI_STDCALL brlapi_acceptKeyRanges(const brlapi_range_t ranges[], unsigned int count)
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:1181
unsigned int regionBegin
Definition: brlapi.h:1182
int BRLAPI_STDCALL brlapi__acceptKeyRanges(brlapi_handle_t *handle, const brlapi_range_t ranges[], unsigned int count)
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:1088
brlapi_keyCode_t first
Definition: brlapi.h:825
unsigned int regionSize
Definition: brlapi.h:1183
brlapi_keyCode_t last
Definition: brlapi.h:826
int BRLAPI_STDCALL brlapi__enterTtyModeWithPath(brlapi_handle_t *handle, int *ttys, int count, const char *driver)
void BRLAPI_STDCALL brlapi_closeConnection(void)
int cursor
Definition: brlapi.h:1188
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)
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__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:1048
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:1185
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:1046
brlapi_fileDescriptor BRLAPI_STDCALL brlapi_openConnection(const brlapi_connectionSettings_t *desiredSettings, brlapi_connectionSettings_t *actualSettings)
Definition: brlapi.h:1180
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:1008
#define BRLAPI_KEY_FLAGS_SHIFT
Definition: brlapi_keycodes.h:107
unsigned char * attrAnd
Definition: brlapi.h:1186
void BRLAPI_STDCALL brlapi__closeConnection(brlapi_handle_t *handle)
uint32_t brlapi_packetType_t
Definition: brlapi.h:1063
int BRLAPI_STDCALL brlapi__suspendDriver(brlapi_handle_t *handle, const char *driver)
#define brlapi_errfun
Definition: brlapi.h:1052
#define brlapi__acceptAllKeys(handle)
Definition: brlapi.h:818
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:1184
int BRLAPI_STDCALL brlapi__writeDots(brlapi_handle_t *handle, const unsigned char *dots)
#define brlapi_acceptAllKeys()
Definition: brlapi.h:815
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:1011
unsigned char * attrOr
Definition: brlapi.h:1187
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__getModelIdentifier(brlapi_handle_t *handle, char *buffer, size_t size)
int BRLAPI_STDCALL brlapi_setFocus(int tty)
brlapi_rangeType_t
Definition: brlapi.h:747
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:207
char * auth
Definition: brlapi.h:197
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:189
int BRLAPI_STDCALL brlapi_acceptKeys(brlapi_rangeType_t type, const brlapi_keyCode_t keys[], unsigned int count)
int libcerrno
Definition: brlapi.h:1009
Definition: brlapi.h:1007
char * charset
Definition: brlapi.h:1189
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:799
#define brlapi_gaierrno
Definition: brlapi.h:1050
const char *BRLAPI_STDCALL brlapi_strerror(const brlapi_error_t *error)
void(BRLAPI_STDCALL * brlapi_exceptionHandler_t)(int error, brlapi_packetType_t type, const void *packet, size_t size)
Definition: brlapi.h:1086
int BRLAPI_STDCALL brlapi_leaveTtyMode(void)
#define brlapi__ignoreAllKeys(handle)
Definition: brlapi.h:802
int BRLAPI_STDCALL brlapi_getModelIdentifier(char *buffer, size_t size)
ssize_t BRLAPI_STDCALL brlapi__recvRaw(brlapi_handle_t *handle, void *buffer, size_t size)