25 #ifndef BRLAPI_INCLUDED 26 #define BRLAPI_INCLUDED 38 #define BRLAPI_RELEASE "0.7.0" 41 #define BRLAPI_MAJOR 0 44 #define BRLAPI_MINOR 7 47 #define BRLAPI_REVISION 0 55 #include <sys/types.h> 59 #define BRLAPI_STDCALL __stdcall 61 #define BRLAPI_STDCALL 65 typedef __int64 uint64_t;
66 typedef __int32 uint32_t;
67 #define UINT64_C(x) (x ## Ui64) 69 typedef signed int ssize_t;
123 #define BRLAPI_SOCKETPORTNUM 4101 124 #define BRLAPI_SOCKETPORT "4101" 127 #define BRLAPI_SOCKETPATH "/var/lib/BrlAPI" 133 #define BRLAPI_ETCDIR "/etc" 138 #define BRLAPI_AUTHKEYFILE "brlapi.key" 143 #define BRLAPI_DEFAUTH "none" 145 #define BRLAPI_DEFAUTH_KEYFILE "keyfile:" BRLAPI_ETCDIR "/" BRLAPI_AUTHKEYFILE 148 #define BRLAPI_DEFAUTH_POLKIT "+polkit" 150 #define BRLAPI_DEFAUTH_POLKIT "" 153 #define BRLAPI_DEFAUTH BRLAPI_DEFAUTH_KEYFILE BRLAPI_DEFAUTH_POLKIT 216 #define BRLAPI_SETTINGS_INITIALIZER { NULL, NULL } 263 #ifndef BRLAPI_NO_SINGLE_SESSION 275 #ifndef BRLAPI_NO_SINGLE_SESSION 293 #ifndef BRLAPI_NO_SINGLE_SESSION 303 #ifndef BRLAPI_NO_SINGLE_SESSION 323 #define BRLAPI_MAXNAMELENGTH 31 337 #ifndef BRLAPI_NO_SINGLE_SESSION 354 #ifndef BRLAPI_NO_SINGLE_SESSION 361 #ifndef BRLAPI_NO_SINGLE_SESSION 409 #ifndef BRLAPI_NO_SINGLE_SESSION 423 #define BRLAPI_TTY_DEFAULT -1 437 #ifndef BRLAPI_NO_SINGLE_SESSION 449 #ifndef BRLAPI_NO_SINGLE_SESSION 465 #ifndef BRLAPI_NO_SINGLE_SESSION 514 #ifndef BRLAPI_NO_SINGLE_SESSION 532 #ifndef BRLAPI_NO_SINGLE_SESSION 545 #ifndef BRLAPI_NO_SINGLE_SESSION 554 unsigned int regionBegin ;
555 unsigned int regionSize ;
558 unsigned char *andMask ;
559 unsigned char *orMask ;
568 #define BRLAPI_DISPLAY_DEFAULT -1 574 #define BRLAPI_CURSOR_LEAVE -1 580 #define BRLAPI_CURSOR_OFF 0 592 #define BRLAPI_WRITEARGUMENTS_INITIALIZER { \ 593 .displayNumber = BRLAPI_DISPLAY_DEFAULT, \ 600 .cursor = BRLAPI_CURSOR_LEAVE, \ 640 #ifndef BRLAPI_NO_SINGLE_SESSION 666 unsigned int command ;
667 unsigned int argument ;
685 const char *command ;
686 unsigned int argument ;
703 #define BRLAPI_UC_ROW 0x2800UL 772 #ifndef BRLAPI_NO_SINGLE_SESSION 794 #ifndef BRLAPI_NO_SINGLE_SESSION 821 #ifndef BRLAPI_NO_SINGLE_SESSION 839 #ifndef BRLAPI_NO_SINGLE_SESSION 850 #ifndef BRLAPI_NO_SINGLE_SESSION 852 #define brlapi_ignoreAllKeys() brlapi_ignoreKeys(brlapi_rangeType_all, NULL, 0) 855 #define brlapi__ignoreAllKeys(handle) brlapi__ignoreKeys(handle, brlapi_rangeType_all, NULL, 0) 866 #ifndef BRLAPI_NO_SINGLE_SESSION 868 #define brlapi_acceptAllKeys() brlapi_acceptKeys(brlapi_rangeType_all, NULL, 0) 871 #define brlapi__acceptAllKeys(handle) brlapi__acceptKeys(handle, brlapi_rangeType_all, NULL, 0) 893 #ifndef BRLAPI_NO_SINGLE_SESSION 909 #ifndef BRLAPI_NO_SINGLE_SESSION 943 #ifndef BRLAPI_NO_SINGLE_SESSION 951 #ifndef BRLAPI_NO_SINGLE_SESSION 962 #ifndef BRLAPI_NO_SINGLE_SESSION 974 #ifndef BRLAPI_NO_SINGLE_SESSION 984 #ifndef BRLAPI_NO_SINGLE_SESSION 993 #ifndef BRLAPI_NO_SINGLE_SESSION 1021 #define BRLAPI_ERROR_SUCCESS 0 1022 #define BRLAPI_ERROR_NOMEM 1 1023 #define BRLAPI_ERROR_TTYBUSY 2 1024 #define BRLAPI_ERROR_DEVICEBUSY 3 1025 #define BRLAPI_ERROR_UNKNOWN_INSTRUCTION 4 1026 #define BRLAPI_ERROR_ILLEGAL_INSTRUCTION 5 1027 #define BRLAPI_ERROR_INVALID_PARAMETER 6 1028 #define BRLAPI_ERROR_INVALID_PACKET 7 1029 #define BRLAPI_ERROR_CONNREFUSED 8 1030 #define BRLAPI_ERROR_OPNOTSUPP 9 1031 #define BRLAPI_ERROR_GAIERR 10 1032 #define BRLAPI_ERROR_LIBCERR 11 1033 #define BRLAPI_ERROR_UNKNOWNTTY 12 1034 #define BRLAPI_ERROR_PROTOCOL_VERSION 13 1035 #define BRLAPI_ERROR_EOF 14 1036 #define BRLAPI_ERROR_EMPTYKEY 15 1037 #define BRLAPI_ERROR_DRIVERERROR 16 1038 #define BRLAPI_ERROR_AUTHENTICATION 17 1097 #define brlapi_error (*brlapi_error_location()) 1099 #define brlapi_errno (brlapi_error.brlerrno) 1101 #define brlapi_libcerrno (brlapi_error.libcerrno) 1103 #define brlapi_gaierrno (brlapi_error.gaierrno) 1105 #define brlapi_errfun (brlapi_error.errfun) 1138 #ifndef BRLAPI_NO_SINGLE_SESSION 1153 #ifndef BRLAPI_NO_SINGLE_SESSION 1167 #ifndef BRLAPI_NO_SINGLE_SESSION 1172 #ifndef BRLAPI_NO_SINGLE_SESSION 1181 #ifndef BRLAPI_NO_SINGLE_SESSION 1182 int BRLAPI_STDCALL brlapi_writeTextWin(
int cursor,
const void *str,
int wide);
1186 #ifndef BRLAPI_NO_SINGLE_SESSION 1192 #ifndef BRLAPI_NO_SINGLE_SESSION 1193 #define brlapi_writeText(cursor, str) brlapi_writeTextWin(cursor, str, 1) 1195 #define brlapi__writeText(handle, cursor, str) brlapi__writeTextWin(handle, cursor, str, 1) 1197 #ifndef BRLAPI_NO_SINGLE_SESSION 1198 #define brlapi_write(s) brlapi_writeWin(s, 1) 1200 #define brlapi__write(handle, s) brlapi__writeWin(handle, s, 1) 1204 #ifndef BRLAPI_NO_SINGLE_SESSION 1205 #define brlapi_writeText(cursor, str) brlapi_writeTextWin(cursor, str, 0) 1207 #define brlapi__writeText(handle, cursor, str) brlapi__writeTextWin(handle, cursor, str, 0) 1209 #ifndef BRLAPI_NO_SINGLE_SESSION 1210 #define brlapi_write(s) brlapi_writeWin(s, 0) 1212 #define brlapi__write(handle, s) brlapi__writeWin(handle, s, 0) 1217 #ifndef BRLAPI_NO_DEPRECATED 1230 #define brlapi_settings_t brlapi_connectionSettings_t 1244 #define BRLAPI_WRITESTRUCT_INITIALIZER BRLAPI_WRITEARGUMENTS_INITIALIZER 1246 #define brl_keycode_t brlapi_keyCode_t 1247 #define brl_type_t brlapi_packetType_t 1249 #define BRLCOMMANDS NULL 1250 #define BRL_KEYCODE_MAX BRLAPI_KEY_MAX 1252 #ifndef BRLAPI_NO_SINGLE_SESSION 1253 #define brlapi_initializeConnection brlapi_openConnection 1254 #define brlapi_getTty brlapi_enterTtyMode 1255 #define brlapi_getTtyPath brlapi_enterTtyModeWithPath 1256 #define brlapi_leaveTty brlapi_leaveTtyMode 1257 #define brlapi_unignoreKeyRange brlapi_acceptKeyRange 1258 #define brlapi_unignoreKeySet brlapi_acceptKeySet 1259 #define brlapi_getRaw brlapi_enterRawMode 1260 #define brlapi_leaveRaw brlapi_leaveRawMode 1261 #define brlapi_suspend brlapi_suspendDriver 1262 #define brlapi_resume brlapi_resumeDriver 1265 #define BRLERR_SUCCESS BRLAPI_ERROR_SUCCESS 1266 #define BRLERR_NOMEM BRLAPI_ERROR_NOMEM 1267 #define BRLERR_TTYBUSY BRLAPI_ERROR_TTYBUSY 1268 #define BRLERR_DEVICEBUSY BRLAPI_ERROR_DEVICEBUSY 1269 #define BRLERR_UNKNOWN_INSTRUCTION BRLAPI_ERROR_UNKNOWN_INSTRUCTION 1270 #define BRLERR_ILLEGAL_INSTRUCTION BRLAPI_ERROR_ILLEGAL_INSTRUCTION 1271 #define BRLERR_INVALID_PARAMETER BRLAPI_ERROR_INVALID_PARAMETER 1272 #define BRLERR_INVALID_PACKET BRLAPI_ERROR_INVALID_PACKET 1273 #define BRLERR_CONNREFUSED BRLAPI_ERROR_CONNREFUSED 1274 #define BRLERR_OPNOTSUPP BRLAPI_ERROR_OPNOTSUPP 1275 #define BRLERR_GAIERR BRLAPI_ERROR_GAIERR 1276 #define BRLERR_LIBCERR BRLAPI_ERROR_LIBCERR 1277 #define BRLERR_UNKNOWNTTY BRLAPI_ERROR_UNKNOWNTTY 1278 #define BRLERR_PROTOCOL_VERSION BRLAPI_ERROR_PROTOCOL_VERSION 1279 #define BRLERR_EOF BRLAPI_ERROR_EOF 1280 #define BRLERR_EMPTYKEY BRLAPI_ERROR_EMPTYKEY 1281 #define BRLERR_DRIVERERROR BRLAPI_ERROR_DRIVERERROR int BRLAPI_STDCALL brlapi_readKeyWithTimeout(int timeout_ms, brlapi_keyCode_t *code)
#define BRLAPI_STDCALL
Definition: brlapi.h:61
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:159
int BRLAPI_STDCALL brlapi_writeDots(const unsigned char *dots)
struct brlapi_handle_t brlapi_handle_t
Definition: brlapi.h:105
ssize_t BRLAPI_STDCALL brlapi__sendRaw(brlapi_handle_t *handle, const void *buffer, size_t size)
void brlapi_getLibraryVersion(int *major, int *minor, int *revision)
int BRLAPI_STDCALL brlapi_resumeDriver(void)
const char * brlapi_errlist[]
size_t BRLAPI_STDCALL brlapi_getHandleSize(void)
int gaierrno
Definition: brlapi.h:1063
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:1097
void *BRLAPI_STDCALL brlapi_getClientData(void)
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)
int BRLAPI_STDCALL brlapi__readKeyWithTimeout(brlapi_handle_t *handle, int timeout_ms, brlapi_keyCode_t *code)
ssize_t BRLAPI_STDCALL brlapi_recvRaw(void *buffer, size_t size)
int displayNumber
Definition: brlapi.h:1234
unsigned int regionBegin
Definition: brlapi.h:1235
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:1141
brlapi_keyCode_t first
Definition: brlapi.h:878
unsigned int regionSize
Definition: brlapi.h:1236
void BRLAPI_STDCALL brlapi__setClientData(brlapi_handle_t *handle, void *data)
void BRLAPI_STDCALL brlapi_setClientData(void *data)
brlapi_keyCode_t last
Definition: brlapi.h:879
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:1241
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:1101
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:1238
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:1099
brlapi_fileDescriptor BRLAPI_STDCALL brlapi_openConnection(const brlapi_connectionSettings_t *desiredSettings, brlapi_connectionSettings_t *actualSettings)
Definition: brlapi.h:1233
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:1061
#define BRLAPI_KEY_FLAGS_SHIFT
Definition: brlapi_keycodes.h:107
unsigned char * attrAnd
Definition: brlapi.h:1239
void BRLAPI_STDCALL brlapi__closeConnection(brlapi_handle_t *handle)
uint32_t brlapi_packetType_t
Definition: brlapi.h:1116
int BRLAPI_STDCALL brlapi__suspendDriver(brlapi_handle_t *handle, const char *driver)
#define brlapi_errfun
Definition: brlapi.h:1105
#define brlapi__acceptAllKeys(handle)
Definition: brlapi.h:871
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:1237
int BRLAPI_STDCALL brlapi__writeDots(brlapi_handle_t *handle, const unsigned char *dots)
#define brlapi_acceptAllKeys()
Definition: brlapi.h:868
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:1064
unsigned char * attrOr
Definition: brlapi.h:1240
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:800
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:210
char * auth
Definition: brlapi.h:200
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:192
int BRLAPI_STDCALL brlapi_acceptKeys(brlapi_rangeType_t type, const brlapi_keyCode_t keys[], unsigned int count)
int libcerrno
Definition: brlapi.h:1062
Definition: brlapi.h:1060
char * charset
Definition: brlapi.h:1242
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:852
void *BRLAPI_STDCALL brlapi__getClientData(brlapi_handle_t *handle)
#define brlapi_gaierrno
Definition: brlapi.h:1103
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:1139
int BRLAPI_STDCALL brlapi_leaveTtyMode(void)
#define brlapi__ignoreAllKeys(handle)
Definition: brlapi.h:855
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)