BrlAPI  0.8
brlapi.h
Go to the documentation of this file.
1 /* Programs/brlapi.h. Generated from brlapi.h.in by configure. */
2 /*
3  * libbrlapi - A library providing access to braille terminals for applications.
4  *
5  * Copyright (C) 2002-2021 by
6  * Samuel Thibault <Samuel.Thibault@ens-lyon.org>
7  * Sébastien Hinderer <Sebastien.Hinderer@ens-lyon.org>
8  *
9  * libbrlapi comes with ABSOLUTELY NO WARRANTY.
10  *
11  * This is free software, placed under the terms of the
12  * GNU Lesser General Public License, as published by the Free Software
13  * Foundation; either version 2.1 of the License, or (at your option) any
14  * later version. Please see the file LICENSE-LGPL for details.
15  *
16  * Web Page: http://brltty.app/
17  *
18  * This software is maintained by Dave Mielke <dave@mielke.cc>.
19  */
20 
25 #ifndef BRLAPI_INCLUDED
26 #define BRLAPI_INCLUDED
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif /* __cplusplus */
31 
32 /* #undef BRLAPI_WIN32 */
33 
38 #define BRLAPI_RELEASE "0.8.2"
39 
41 #define BRLAPI_MAJOR 0
42 
44 #define BRLAPI_MINOR 8
45 
47 #define BRLAPI_REVISION 2
48 
50 void brlapi_getLibraryVersion(int *major, int *minor, int *revision);
51 
54 /* Types are defined there */
55 #include <sys/types.h>
56 
57 #ifdef BRLAPI_WIN32
58 #include <windows.h>
59 #define BRLAPI_STDCALL __stdcall
60 #else /* BRLAPI_WIN32 */
61 #define BRLAPI_STDCALL
62 #endif /* BRLAPI_WIN32 */
63 
64 #ifdef _MSC_VER
65 typedef __int64 uint64_t;
66 typedef __int32 uint32_t;
67 #define UINT64_C(x) (x ## Ui64)
68 #define PRIx64 "I64x"
69 typedef signed int ssize_t;
70 #else /* _MSC_VER */
71 
72 /* this is for uint*_t */
73 #include <stdint.h>
74 
75 /* NULL is defined there */
76 #include <unistd.h>
77 
78 #include <inttypes.h> /* For PRIx64 */
79 #endif /* _MSC_VER */
80 
81 #include <wchar.h>
82 
105 typedef struct brlapi_handle_t brlapi_handle_t;
106 
109 
123 #define BRLAPI_SOCKETPORTNUM 4101
124 #define BRLAPI_SOCKETPORT "4101"
125 
127 #define BRLAPI_SOCKETPATH "/var/lib/BrlAPI"
128 
133 #define BRLAPI_ETCDIR "/etc"
134 
138 #define BRLAPI_AUTHKEYFILE "brlapi.key"
139 
141 #ifdef BRLAPI_WIN32
142 /* No authentication by default on Windows */
143 #define BRLAPI_DEFAUTH "none"
144 #else /* BRLAPI_WIN32 */
145 #define BRLAPI_DEFAUTH_KEYFILE "keyfile:" BRLAPI_ETCDIR "/" BRLAPI_AUTHKEYFILE
146 
147 #ifdef HAVE_POLKIT
148 #define BRLAPI_DEFAUTH_POLKIT "+polkit"
149 #else /* HAVE_POLKIT */
150 #define BRLAPI_DEFAUTH_POLKIT ""
151 #endif /* HAVE_POLKIT */
152 
153 #define BRLAPI_DEFAUTH BRLAPI_DEFAUTH_KEYFILE BRLAPI_DEFAUTH_POLKIT
154 #endif /* BRLAPI_WIN32 */
155 
161 #ifdef __MINGW32__
162 typedef HANDLE brlapi_fileDescriptor;
163 #else /* __MINGW32__ */
165 #endif /* __MINGW32__ */
166 
171 #ifdef __MINGW32__
172 #define BRLAPI_INVALID_FILE_DESCRIPTOR INVALID_HANDLE_VALUE
173 #else /* __MINGW32__ */
174 #define BRLAPI_INVALID_FILE_DESCRIPTOR -1
175 #endif /* __MINGW32__ */
176 
207 typedef struct {
215  const char *auth;
216 
225  const char *host;
227 
228 /* BRLAPI_SETTINGS_INITIALIZER */
231 #define BRLAPI_SETTINGS_INITIALIZER { NULL, NULL }
232 
233 /* brlapi_openConnection */
278 #ifndef BRLAPI_NO_SINGLE_SESSION
280 #endif /* BRLAPI_NO_SINGLE_SESSION */
282 
283 /* brlapi_fileDescriptor */
291 #ifndef BRLAPI_NO_SINGLE_SESSION
293 #endif /* BRLAPI_NO_SINGLE_SESSION */
295 
296 
297 /* brlapi_closeConnection */
304 #ifndef BRLAPI_NO_SINGLE_SESSION
306 #endif /* BRLAPI_NO_SINGLE_SESSION */
308 
317 /* brlapi__setClientData */
322 #ifndef BRLAPI_NO_SINGLE_SESSION
324 #endif /* BRLAPI_NO_SINGLE_SESSION */
326 
327 /* brlapi__getClientData */
332 #ifndef BRLAPI_NO_SINGLE_SESSION
334 #endif /* BRLAPI_NO_SINGLE_SESSION */
336 
352 #define BRLAPI_MAXNAMELENGTH 31
353 
354 /* brlapi_getDriverName */
367 #ifndef BRLAPI_NO_SINGLE_SESSION
368 int BRLAPI_STDCALL brlapi_getDriverName(char *buffer, size_t size);
369 #endif /* BRLAPI_NO_SINGLE_SESSION */
370 int BRLAPI_STDCALL brlapi__getDriverName(brlapi_handle_t *handle, char *buffer, size_t size);
371 
372 /* brlapi_getModelIdentifier */
385 #ifndef BRLAPI_NO_SINGLE_SESSION
386 int BRLAPI_STDCALL brlapi_getModelIdentifier(char *buffer, size_t size);
387 #endif /* BRLAPI_NO_SINGLE_SESSION */
388 int BRLAPI_STDCALL brlapi__getModelIdentifier(brlapi_handle_t *handle, char *buffer, size_t size);
389 
390 /* brlapi_getDisplaySize */
392 #ifndef BRLAPI_NO_SINGLE_SESSION
393 int BRLAPI_STDCALL brlapi_getDisplaySize(unsigned int *x, unsigned int *y);
394 #endif /* BRLAPI_NO_SINGLE_SESSION */
395 int BRLAPI_STDCALL brlapi__getDisplaySize(brlapi_handle_t *handle, unsigned int *x, unsigned int *y);
396 
420 /* brlapi_enterTtyMode */
439 #ifndef BRLAPI_NO_SINGLE_SESSION
440 int BRLAPI_STDCALL brlapi_enterTtyMode(int tty, const char *driver);
441 #endif /* BRLAPI_NO_SINGLE_SESSION */
442 int BRLAPI_STDCALL brlapi__enterTtyMode(brlapi_handle_t *handle, int tty, const char *driver);
443 
453 #define BRLAPI_TTY_DEFAULT -1
454 
455 /* brlapi_enterTtyModeWithPath */
467 #ifndef BRLAPI_NO_SINGLE_SESSION
468 int BRLAPI_STDCALL brlapi_enterTtyModeWithPath(int *ttys, int count, const char *driver);
469 #endif /* BRLAPI_NO_SINGLE_SESSION */
470 int BRLAPI_STDCALL brlapi__enterTtyModeWithPath(brlapi_handle_t *handle, int *ttys, int count, const char *driver);
471 
472 /* brlapi_leaveTtyMode */
479 #ifndef BRLAPI_NO_SINGLE_SESSION
481 #endif /* BRLAPI_NO_SINGLE_SESSION */
483 
484 /* brlapi_setFocus */
495 #ifndef BRLAPI_NO_SINGLE_SESSION
497 #endif /* BRLAPI_NO_SINGLE_SESSION */
499 
529 /* brlapi_writeText */
544 #ifndef BRLAPI_NO_SINGLE_SESSION
545 int BRLAPI_STDCALL brlapi_writeText(int cursor, const char *text);
546 #endif /* BRLAPI_NO_SINGLE_SESSION */
547 int BRLAPI_STDCALL brlapi__writeText(brlapi_handle_t *handle, int cursor, const char *text);
548 
549 /* brlapi_writeWText */
562 #ifndef BRLAPI_NO_SINGLE_SESSION
563 int BRLAPI_STDCALL brlapi_writeWText(int cursor, const wchar_t *text);
564 #endif /* BRLAPI_NO_SINGLE_SESSION */
565 int BRLAPI_STDCALL brlapi__writeWText(brlapi_handle_t *handle, int cursor, const wchar_t *text);
566 
567 /* brlapi_writeDots */
575 #ifndef BRLAPI_NO_SINGLE_SESSION
576 int BRLAPI_STDCALL brlapi_writeDots(const unsigned char *dots);
577 #endif /* BRLAPI_NO_SINGLE_SESSION */
578 int BRLAPI_STDCALL brlapi__writeDots(brlapi_handle_t *handle, const unsigned char *dots);
579 
580 /* brlapi_writeArguments_t */
582 typedef struct {
583  int displayNumber ;
584  unsigned int regionBegin ;
585  unsigned int regionSize ;
586  char *text ;
587  int textSize ;
588  unsigned char *andMask ;
589  unsigned char *orMask ;
590  int cursor ;
591  char *charset ;
593 
598 #define BRLAPI_DISPLAY_DEFAULT -1
599 
604 #define BRLAPI_CURSOR_LEAVE -1
605 
610 #define BRLAPI_CURSOR_OFF 0
611 
612 /* BRLAPI_WRITEARGUMENTS_INITIALIZER */
622 #define BRLAPI_WRITEARGUMENTS_INITIALIZER { \
623  .displayNumber = BRLAPI_DISPLAY_DEFAULT, \
624  .regionBegin = 0, \
625  .regionSize = 0, \
626  .text = NULL, \
627  .textSize = -1, \
628  .andMask = NULL, \
629  .orMask = NULL, \
630  .cursor = BRLAPI_CURSOR_LEAVE, \
631  .charset = NULL \
632 }
633 
634 /* brlapi_write */
670 #ifndef BRLAPI_NO_SINGLE_SESSION
672 #endif /* BRLAPI_NO_SINGLE_SESSION */
674 
677 #include "brlapi_keycodes.h"
678 
692 /* brlapi_expandedKeyCode_t */
694 typedef struct {
695  unsigned int type ;
696  unsigned int command ;
697  unsigned int argument ;
698  unsigned int flags ;
700 
701 /* brlapi_expandKeyCode */
710 
711 /* brlapi_describedKeyCode_t */
713 typedef struct {
714  const char *type ;
715  const char *command ;
716  unsigned int argument ;
717  unsigned int flags ;
718  const char *flag[64 - BRLAPI_KEY_FLAGS_SHIFT] ;
721 
722 /* brlapi_describeKeyCode */
731 
733 #define BRLAPI_UC_ROW 0x2800UL
734 
735 /* brlapi_readKey */
804 #ifndef BRLAPI_NO_SINGLE_SESSION
806 #endif /* BRLAPI_NO_SINGLE_SESSION */
808 
809 /* brlapi_readKeyWithTimeout */
830 #ifndef BRLAPI_NO_SINGLE_SESSION
832 #endif /* BRLAPI_NO_SINGLE_SESSION */
834 
836 typedef enum {
843 
844 /* brlapi_ignoreKeys */
854 #ifndef BRLAPI_NO_SINGLE_SESSION
855 int BRLAPI_STDCALL brlapi_ignoreKeys(brlapi_rangeType_t type, const brlapi_keyCode_t keys[], unsigned int count);
856 #endif /* BRLAPI_NO_SINGLE_SESSION */
857 int BRLAPI_STDCALL brlapi__ignoreKeys(brlapi_handle_t *handle, brlapi_rangeType_t type, const brlapi_keyCode_t keys[], unsigned int count);
858 
859 /* brlapi_acceptKeys */
869 #ifndef BRLAPI_NO_SINGLE_SESSION
870 int BRLAPI_STDCALL brlapi_acceptKeys(brlapi_rangeType_t type, const brlapi_keyCode_t keys[], unsigned int count);
871 #endif /* BRLAPI_NO_SINGLE_SESSION */
872 int BRLAPI_STDCALL brlapi__acceptKeys(brlapi_handle_t *handle, brlapi_rangeType_t type, const brlapi_keyCode_t keys[], unsigned int count);
873 
874 /* brlapi_ignoreAllKeys */
880 #ifndef BRLAPI_NO_SINGLE_SESSION
882 #define brlapi_ignoreAllKeys() brlapi_ignoreKeys(brlapi_rangeType_all, NULL, 0)
883 #endif /* BRLAPI_NO_SINGLE_SESSION */
885 #define brlapi__ignoreAllKeys(handle) brlapi__ignoreKeys(handle, brlapi_rangeType_all, NULL, 0)
886 
887 /* brlapi_acceptAllKeys */
896 #ifndef BRLAPI_NO_SINGLE_SESSION
898 #define brlapi_acceptAllKeys() brlapi_acceptKeys(brlapi_rangeType_all, NULL, 0)
899 #endif /* BRLAPI_NO_SINGLE_SESSION */
901 #define brlapi__acceptAllKeys(handle) brlapi__acceptKeys(handle, brlapi_rangeType_all, NULL, 0)
902 
907 typedef struct {
911 
912 /* brlapi_ignoreKeyRanges */
921 #ifndef BRLAPI_NO_SINGLE_SESSION
922 int BRLAPI_STDCALL brlapi_ignoreKeyRanges(const brlapi_range_t ranges[], unsigned int count);
923 #endif /* BRLAPI_NO_SINGLE_SESSION */
924 int BRLAPI_STDCALL brlapi__ignoreKeyRanges(brlapi_handle_t *handle, const brlapi_range_t ranges[], unsigned int count);
925 
926 /* brlapi_acceptKeyRanges */
935 #ifndef BRLAPI_NO_SINGLE_SESSION
936 int BRLAPI_STDCALL brlapi_acceptKeyRanges(const brlapi_range_t ranges[], unsigned int count);
937 #endif /* BRLAPI_NO_SINGLE_SESSION */
938 int BRLAPI_STDCALL brlapi__acceptKeyRanges(brlapi_handle_t *handle, const brlapi_range_t ranges[], unsigned int count);
964 /* brlapi_enterRawMode */
969 #ifndef BRLAPI_NO_SINGLE_SESSION
970 int BRLAPI_STDCALL brlapi_enterRawMode(const char *driver);
971 #endif /* BRLAPI_NO_SINGLE_SESSION */
972 int BRLAPI_STDCALL brlapi__enterRawMode(brlapi_handle_t *handle, const char *driver);
973 
974 /* brlapi_leaveRawMode */
977 #ifndef BRLAPI_NO_SINGLE_SESSION
979 #endif /* BRLAPI_NO_SINGLE_SESSION */
981 
982 /* brlapi_sendRaw */
988 #ifndef BRLAPI_NO_SINGLE_SESSION
989 ssize_t BRLAPI_STDCALL brlapi_sendRaw(const void *buffer, size_t size);
990 #endif /* BRLAPI_NO_SINGLE_SESSION */
991 ssize_t BRLAPI_STDCALL brlapi__sendRaw(brlapi_handle_t *handle, const void *buffer, size_t size);
992 
993 /* brlapi_recvRaw */
1002 #ifndef BRLAPI_NO_SINGLE_SESSION
1003 ssize_t BRLAPI_STDCALL brlapi_recvRaw(void *buffer, size_t size);
1004 #endif /* BRLAPI_NO_SINGLE_SESSION */
1005 ssize_t BRLAPI_STDCALL brlapi__recvRaw(brlapi_handle_t *handle, void *buffer, size_t size);
1006 
1007 /* brlapi_suspendDriver */
1012 #ifndef BRLAPI_NO_SINGLE_SESSION
1013 int BRLAPI_STDCALL brlapi_suspendDriver(const char *driver);
1014 #endif /* BRLAPI_NO_SINGLE_SESSION */
1015 int BRLAPI_STDCALL brlapi__suspendDriver(brlapi_handle_t *handle, const char *driver);
1016 
1017 /* brlapi_resumeDriver */
1021 #ifndef BRLAPI_NO_SINGLE_SESSION
1023 #endif /* BRLAPI_NO_SINGLE_SESSION */
1027 #include "brlapi_param.h"
1028 
1053 typedef uint32_t brlapi_param_flags_t;
1054 #define BRLAPI_PARAMF_LOCAL 0X00
1055 #define BRLAPI_PARAMF_GLOBAL 0X01
1056 #define BRLAPI_PARAMF_SELF 0X02
1058 /* brlapi_getParameter */
1071 #ifndef BRLAPI_NO_SINGLE_SESSION
1072 ssize_t BRLAPI_STDCALL brlapi_getParameter(brlapi_param_t parameter, brlapi_param_subparam_t subparam, brlapi_param_flags_t flags, void* data, size_t len);
1073 #endif
1074 ssize_t BRLAPI_STDCALL brlapi__getParameter(brlapi_handle_t *handle, brlapi_param_t parameter, brlapi_param_subparam_t subparam, brlapi_param_flags_t flags, void* data, size_t len);
1075 
1076 /* brlapi_getParameterAlloc */
1089 #ifndef BRLAPI_NO_SINGLE_SESSION
1091 #endif
1093 
1094 /* brlapi_setParameter */
1107 #ifndef BRLAPI_NO_SINGLE_SESSION
1108 int BRLAPI_STDCALL brlapi_setParameter(brlapi_param_t parameter, brlapi_param_subparam_t subparam, brlapi_param_flags_t flags, const void* data, size_t len);
1109 #endif
1110 int BRLAPI_STDCALL brlapi__setParameter(brlapi_handle_t *handle, brlapi_param_t parameter, brlapi_param_subparam_t subparam, brlapi_param_flags_t flags, const void* data, size_t len);
1111 
1112 /* brlapi_paramCallback_t */
1127 typedef void (*brlapi_paramCallback_t)(brlapi_param_t parameter, brlapi_param_subparam_t subparam, brlapi_param_flags_t flags, void *priv, const void *data, size_t len);
1128 
1129 /* brlapi_paramCallbackDescriptor_t */
1135 
1136 /* brlapi_watchParameter */
1159 #ifndef BRLAPI_NO_SINGLE_SESSION
1161 #endif
1163 
1164 /* brlapi_unwatchParameter */
1175 #ifndef BRLAPI_NO_SINGLE_SESSION
1177 #endif
1179 
1185 /* brlapi_pause */
1192 #ifndef BRLAPI_NO_SINGLE_SESSION
1193 int BRLAPI_STDCALL brlapi_pause(int timeout_ms);
1194 #endif
1195 int BRLAPI_STDCALL brlapi__pause(brlapi_handle_t *handle, int timeout_ms);
1196 
1220 /* Error codes */
1221 #define BRLAPI_ERROR_SUCCESS 0
1222 #define BRLAPI_ERROR_NOMEM 1
1223 #define BRLAPI_ERROR_TTYBUSY 2
1224 #define BRLAPI_ERROR_DEVICEBUSY 3
1225 #define BRLAPI_ERROR_UNKNOWN_INSTRUCTION 4
1226 #define BRLAPI_ERROR_ILLEGAL_INSTRUCTION 5
1227 #define BRLAPI_ERROR_INVALID_PARAMETER 6
1228 #define BRLAPI_ERROR_INVALID_PACKET 7
1229 #define BRLAPI_ERROR_CONNREFUSED 8
1230 #define BRLAPI_ERROR_OPNOTSUPP 9
1231 #define BRLAPI_ERROR_GAIERR 10
1232 #define BRLAPI_ERROR_LIBCERR 11
1233 #define BRLAPI_ERROR_UNKNOWNTTY 12
1234 #define BRLAPI_ERROR_PROTOCOL_VERSION 13
1235 #define BRLAPI_ERROR_EOF 14
1236 #define BRLAPI_ERROR_EMPTYKEY 15
1237 #define BRLAPI_ERROR_DRIVERERROR 16
1238 #define BRLAPI_ERROR_AUTHENTICATION 17
1239 #define BRLAPI_ERROR_READONLY_PARAMETER 18
1241 /* brlapi_errlist */
1246 extern const char *brlapi_errlist[];
1247 
1248 /* brlapi_nerr */
1250 extern const int brlapi_nerr;
1251 
1252 /* brlapi_perror */
1257 void BRLAPI_STDCALL brlapi_perror(const char *s);
1258 
1259 /* brlapi_error_t */
1261 typedef struct {
1265  const char *errfun;
1266 } brlapi_error_t;
1267 
1277 
1287 
1289 extern int brlapi_errno;
1291 extern int brlapi_libcerrno;
1293 extern int brlapi_gaierrno;
1295 extern const char *brlapi_errfun;
1296 
1298 #define brlapi_error (*brlapi_error_location())
1300 #define brlapi_errno (brlapi_error.brlerrno)
1302 #define brlapi_libcerrno (brlapi_error.libcerrno)
1304 #define brlapi_gaierrno (brlapi_error.gaierrno)
1306 #define brlapi_errfun (brlapi_error.errfun)
1307 
1308 /* brlapi_strerror */
1314 const char * BRLAPI_STDCALL brlapi_strerror(const brlapi_error_t *error);
1315 
1317 typedef uint32_t brlapi_packetType_t;
1318 
1319 /* brlapi_getPacketTypeName */
1326 
1327 /* brlapi_exceptionHandler_t */
1339 #ifndef BRLAPI_NO_SINGLE_SESSION
1340 typedef void (BRLAPI_STDCALL *brlapi_exceptionHandler_t)(int error, brlapi_packetType_t type, const void *packet, size_t size);
1341 #endif /* BRLAPI_NO_SINGLE_SESSION */
1342 typedef void (BRLAPI_STDCALL *brlapi__exceptionHandler_t)(brlapi_handle_t *handle, int error, brlapi_packetType_t type, const void *packet, size_t size);
1343 
1344 /* brlapi_strexception */
1354 #ifndef BRLAPI_NO_SINGLE_SESSION
1355 int BRLAPI_STDCALL brlapi_strexception(char *buffer, size_t bufferSize, int error, brlapi_packetType_t type, const void *packet, size_t packetSize);
1356 #endif /* BRLAPI_NO_SINGLE_SESSION */
1357 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);
1358 
1359 /* brlapi_setExceptionHandler */
1368 #ifndef BRLAPI_NO_SINGLE_SESSION
1370 #endif /* BRLAPI_NO_SINGLE_SESSION */
1372 
1373 #ifndef BRLAPI_NO_SINGLE_SESSION
1374 void BRLAPI_STDCALL brlapi_defaultExceptionHandler(int error, brlapi_packetType_t type, const void *packet, size_t size);
1375 #endif /* BRLAPI_NO_SINGLE_SESSION */
1376 void BRLAPI_STDCALL brlapi__defaultExceptionHandler(brlapi_handle_t *handle, int error, brlapi_packetType_t type, const void *packet, size_t size);
1377 
1380 /* Windows-specific tricks - don't look at this */
1381 #ifdef BRLAPI_WIN32
1382 #ifndef BRLAPI_NO_SINGLE_SESSION
1383 int BRLAPI_STDCALL brlapi_writeTextWin(int cursor, const void *str, int wide);
1384 #endif /* BRLAPI_NO_SINGLE_SESSION */
1385 int BRLAPI_STDCALL brlapi__writeTextWin(brlapi_handle_t *handle, int cursor, const void *str, int wide);
1386 
1387 #ifndef BRLAPI_NO_SINGLE_SESSION
1388 int BRLAPI_STDCALL brlapi_writeWin(const brlapi_writeArguments_t *s, int wide);
1389 #endif /* BRLAPI_NO_SINGLE_SESSION */
1390 int BRLAPI_STDCALL brlapi__writeWin(brlapi_handle_t *handle, const brlapi_writeArguments_t *s, int wide);
1391 
1392 #ifdef UNICODE
1393 #ifndef BRLAPI_NO_SINGLE_SESSION
1394 #define brlapi_writeText(cursor, str) brlapi_writeTextWin(cursor, str, 1)
1395 #endif /* BRLAPI_NO_SINGLE_SESSION */
1396 #define brlapi__writeText(handle, cursor, str) brlapi__writeTextWin(handle, cursor, str, 1)
1397 
1398 #ifndef BRLAPI_NO_SINGLE_SESSION
1399 #define brlapi_write(s) brlapi_writeWin(s, 1)
1400 #endif /* BRLAPI_NO_SINGLE_SESSION */
1401 #define brlapi__write(handle, s) brlapi__writeWin(handle, s, 1)
1402 
1403 #else /* UNICODE */
1404 
1405 #ifndef BRLAPI_NO_SINGLE_SESSION
1406 #define brlapi_writeText(cursor, str) brlapi_writeTextWin(cursor, str, 0)
1407 #endif /* BRLAPI_NO_SINGLE_SESSION */
1408 #define brlapi__writeText(handle, cursor, str) brlapi__writeTextWin(handle, cursor, str, 0)
1409 
1410 #ifndef BRLAPI_NO_SINGLE_SESSION
1411 #define brlapi_write(s) brlapi_writeWin(s, 0)
1412 #endif /* BRLAPI_NO_SINGLE_SESSION */
1413 #define brlapi__write(handle, s) brlapi__writeWin(handle, s, 0)
1414 
1415 #endif /* UNICODE */
1416 #endif /* BRLAPI_WIN32 */
1417 
1418 #ifndef BRLAPI_NO_DEPRECATED
1431 #define brlapi_settings_t brlapi_connectionSettings_t
1432 
1434 typedef struct {
1436  unsigned int regionBegin;
1437  unsigned int regionSize;
1438  char *text;
1440  unsigned char *attrAnd;
1441  unsigned char *attrOr;
1442  int cursor;
1443  char *charset;
1445 #define BRLAPI_WRITESTRUCT_INITIALIZER BRLAPI_WRITEARGUMENTS_INITIALIZER
1446 
1447 #define brl_keycode_t brlapi_keyCode_t
1448 #define brl_type_t brlapi_packetType_t
1449 
1450 #define BRLCOMMANDS NULL
1451 #define BRL_KEYCODE_MAX BRLAPI_KEY_MAX
1452 
1453 #ifndef BRLAPI_NO_SINGLE_SESSION
1454 #define brlapi_initializeConnection brlapi_openConnection
1455 #define brlapi_getTty brlapi_enterTtyMode
1456 #define brlapi_getTtyPath brlapi_enterTtyModeWithPath
1457 #define brlapi_leaveTty brlapi_leaveTtyMode
1458 #define brlapi_unignoreKeyRange brlapi_acceptKeyRange
1459 #define brlapi_unignoreKeySet brlapi_acceptKeySet
1460 #define brlapi_getRaw brlapi_enterRawMode
1461 #define brlapi_leaveRaw brlapi_leaveRawMode
1462 #define brlapi_suspend brlapi_suspendDriver
1463 #define brlapi_resume brlapi_resumeDriver
1464 #endif /* BRLAPI_NO_SINGLE_SESSION */
1465 
1466 #define BRLERR_SUCCESS BRLAPI_ERROR_SUCCESS
1467 #define BRLERR_NOMEM BRLAPI_ERROR_NOMEM
1468 #define BRLERR_TTYBUSY BRLAPI_ERROR_TTYBUSY
1469 #define BRLERR_DEVICEBUSY BRLAPI_ERROR_DEVICEBUSY
1470 #define BRLERR_UNKNOWN_INSTRUCTION BRLAPI_ERROR_UNKNOWN_INSTRUCTION
1471 #define BRLERR_ILLEGAL_INSTRUCTION BRLAPI_ERROR_ILLEGAL_INSTRUCTION
1472 #define BRLERR_INVALID_PARAMETER BRLAPI_ERROR_INVALID_PARAMETER
1473 #define BRLERR_INVALID_PACKET BRLAPI_ERROR_INVALID_PACKET
1474 #define BRLERR_CONNREFUSED BRLAPI_ERROR_CONNREFUSED
1475 #define BRLERR_OPNOTSUPP BRLAPI_ERROR_OPNOTSUPP
1476 #define BRLERR_GAIERR BRLAPI_ERROR_GAIERR
1477 #define BRLERR_LIBCERR BRLAPI_ERROR_LIBCERR
1478 #define BRLERR_UNKNOWNTTY BRLAPI_ERROR_UNKNOWNTTY
1479 #define BRLERR_PROTOCOL_VERSION BRLAPI_ERROR_PROTOCOL_VERSION
1480 #define BRLERR_EOF BRLAPI_ERROR_EOF
1481 #define BRLERR_EMPTYKEY BRLAPI_ERROR_EMPTYKEY
1482 #define BRLERR_DRIVERERROR BRLAPI_ERROR_DRIVERERROR
1483 
1485 #endif /* BRLAPI_NO_DEPRECATED */
1486 
1487 #ifdef __cplusplus
1488 }
1489 #endif /* __cplusplus */
1490 
1491 #endif /* BRLAPI_INCLUDED */
#define BRLAPI_STDCALL
Definition: brlapi.h:61
uint64_t brlapi_param_subparam_t
Definition: brlapi_param.h:108
void BRLAPI_STDCALL brlapi_setClientData(void *data)
void *BRLAPI_STDCALL brlapi__getClientData(brlapi_handle_t *handle)
void *BRLAPI_STDCALL brlapi_getClientData(void)
void BRLAPI_STDCALL brlapi__setClientData(brlapi_handle_t *handle, void *data)
int brlapi_fileDescriptor
Definition: brlapi.h:164
brlapi_fileDescriptor BRLAPI_STDCALL brlapi__getFileDescriptor(brlapi_handle_t *handle)
void BRLAPI_STDCALL brlapi_closeConnection(void)
void BRLAPI_STDCALL brlapi__closeConnection(brlapi_handle_t *handle)
brlapi_fileDescriptor BRLAPI_STDCALL brlapi__openConnection(brlapi_handle_t *handle, const brlapi_connectionSettings_t *desiredSettings, brlapi_connectionSettings_t *actualSettings)
brlapi_fileDescriptor BRLAPI_STDCALL brlapi_openConnection(const brlapi_connectionSettings_t *desiredSettings, brlapi_connectionSettings_t *actualSettings)
brlapi_fileDescriptor BRLAPI_STDCALL brlapi_getFileDescriptor(void)
int BRLAPI_STDCALL brlapi_resumeDriver(void)
int BRLAPI_STDCALL brlapi__leaveRawMode(brlapi_handle_t *handle)
int BRLAPI_STDCALL brlapi__resumeDriver(brlapi_handle_t *handle)
ssize_t BRLAPI_STDCALL brlapi__sendRaw(brlapi_handle_t *handle, const void *buffer, size_t size)
int BRLAPI_STDCALL brlapi__enterRawMode(brlapi_handle_t *handle, const char *driver)
int BRLAPI_STDCALL brlapi__suspendDriver(brlapi_handle_t *handle, const char *driver)
int BRLAPI_STDCALL brlapi_leaveRawMode(void)
ssize_t BRLAPI_STDCALL brlapi_sendRaw(const void *buffer, size_t size)
ssize_t BRLAPI_STDCALL brlapi__recvRaw(brlapi_handle_t *handle, void *buffer, size_t size)
int BRLAPI_STDCALL brlapi_enterRawMode(const char *driver)
int BRLAPI_STDCALL brlapi_suspendDriver(const char *driver)
ssize_t BRLAPI_STDCALL brlapi_recvRaw(void *buffer, size_t size)
void(BRLAPI_STDCALL * brlapi_exceptionHandler_t)(int error, brlapi_packetType_t type, const void *packet, size_t size)
Definition: brlapi.h:1340
const char *BRLAPI_STDCALL brlapi_strerror(const brlapi_error_t *error)
int BRLAPI_STDCALL brlapi_strexception(char *buffer, size_t bufferSize, int error, brlapi_packetType_t type, const void *packet, size_t packetSize)
void BRLAPI_STDCALL brlapi__defaultExceptionHandler(brlapi_handle_t *handle, int error, brlapi_packetType_t type, const void *packet, size_t size)
void BRLAPI_STDCALL brlapi_defaultExceptionHandler(int error, brlapi_packetType_t type, const void *packet, size_t size)
#define brlapi_errno
Definition: brlapi.h:1300
const char * brlapi_errlist[]
const int brlapi_nerr
#define brlapi_errfun
Definition: brlapi.h:1306
#define brlapi_error
Definition: brlapi.h:1298
void BRLAPI_STDCALL brlapi_perror(const char *s)
#define brlapi_gaierrno
Definition: brlapi.h:1304
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)
#define brlapi_libcerrno
Definition: brlapi.h:1302
brlapi_exceptionHandler_t BRLAPI_STDCALL brlapi_setExceptionHandler(brlapi_exceptionHandler_t handler)
brlapi_error_t *BRLAPI_STDCALL brlapi_error_location(void)
brlapi__exceptionHandler_t BRLAPI_STDCALL brlapi__setExceptionHandler(brlapi_handle_t *handle, brlapi__exceptionHandler_t handler)
uint32_t brlapi_packetType_t
Definition: brlapi.h:1317
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:1342
const char *BRLAPI_STDCALL brlapi_getPacketTypeName(brlapi_packetType_t type)
struct brlapi_handle_t brlapi_handle_t
Definition: brlapi.h:105
size_t BRLAPI_STDCALL brlapi_getHandleSize(void)
int BRLAPI_STDCALL brlapi__getModelIdentifier(brlapi_handle_t *handle, char *buffer, size_t size)
int BRLAPI_STDCALL brlapi__getDriverName(brlapi_handle_t *handle, char *buffer, size_t size)
int BRLAPI_STDCALL brlapi_getDriverName(char *buffer, size_t size)
int BRLAPI_STDCALL brlapi_getDisplaySize(unsigned int *x, unsigned int *y)
int BRLAPI_STDCALL brlapi__getDisplaySize(brlapi_handle_t *handle, unsigned int *x, unsigned int *y)
int BRLAPI_STDCALL brlapi_getModelIdentifier(char *buffer, size_t size)
uint64_t brlapi_keyCode_t
Definition: brlapi_keycodes.h:90
#define BRLAPI_KEY_FLAGS_SHIFT
Definition: brlapi_keycodes.h:111
brlapi_rangeType_t
Definition: brlapi.h:836
int BRLAPI_STDCALL brlapi__acceptKeys(brlapi_handle_t *handle, brlapi_rangeType_t type, const brlapi_keyCode_t keys[], unsigned int count)
int BRLAPI_STDCALL brlapi_acceptKeys(brlapi_rangeType_t type, const brlapi_keyCode_t keys[], unsigned int count)
#define brlapi__ignoreAllKeys(handle)
Definition: brlapi.h:885
int BRLAPI_STDCALL brlapi_describeKeyCode(brlapi_keyCode_t code, brlapi_describedKeyCode_t *description)
int BRLAPI_STDCALL brlapi_readKey(int wait, brlapi_keyCode_t *code)
#define brlapi__acceptAllKeys(handle)
Definition: brlapi.h:901
int BRLAPI_STDCALL brlapi__ignoreKeyRanges(brlapi_handle_t *handle, const brlapi_range_t ranges[], unsigned int count)
int BRLAPI_STDCALL brlapi_ignoreKeys(brlapi_rangeType_t type, const brlapi_keyCode_t keys[], unsigned int count)
int BRLAPI_STDCALL brlapi__acceptKeyRanges(brlapi_handle_t *handle, const brlapi_range_t ranges[], unsigned int count)
int BRLAPI_STDCALL brlapi__readKey(brlapi_handle_t *handle, int wait, brlapi_keyCode_t *code)
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_acceptKeyRanges(const brlapi_range_t ranges[], unsigned int count)
#define brlapi_ignoreAllKeys()
Definition: brlapi.h:882
int BRLAPI_STDCALL brlapi_readKeyWithTimeout(int timeout_ms, brlapi_keyCode_t *code)
int BRLAPI_STDCALL brlapi__readKeyWithTimeout(brlapi_handle_t *handle, int timeout_ms, brlapi_keyCode_t *code)
#define brlapi_acceptAllKeys()
Definition: brlapi.h:898
int BRLAPI_STDCALL brlapi_ignoreKeyRanges(const brlapi_range_t ranges[], unsigned int count)
int BRLAPI_STDCALL brlapi_expandKeyCode(brlapi_keyCode_t code, brlapi_expandedKeyCode_t *expansion)
@ brlapi_rangeType_all
Definition: brlapi.h:837
@ brlapi_rangeType_key
Definition: brlapi.h:840
@ brlapi_rangeType_command
Definition: brlapi.h:839
@ brlapi_rangeType_type
Definition: brlapi.h:838
@ brlapi_rangeType_code
Definition: brlapi.h:841
int BRLAPI_STDCALL brlapi__pause(brlapi_handle_t *handle, int timeout_ms)
int BRLAPI_STDCALL brlapi_pause(int timeout_ms)
void * brlapi_paramCallbackDescriptor_t
Definition: brlapi.h:1134
brlapi_paramCallbackDescriptor_t BRLAPI_STDCALL brlapi_watchParameter(brlapi_param_t parameter, brlapi_param_subparam_t subparam, brlapi_param_flags_t flags, brlapi_paramCallback_t func, void *priv, void *data, size_t len)
int BRLAPI_STDCALL brlapi_setParameter(brlapi_param_t parameter, brlapi_param_subparam_t subparam, brlapi_param_flags_t flags, const void *data, size_t len)
void *BRLAPI_STDCALL brlapi_getParameterAlloc(brlapi_param_t parameter, brlapi_param_subparam_t subparam, brlapi_param_flags_t flags, size_t *len)
uint32_t brlapi_param_flags_t
Definition: brlapi.h:1053
brlapi_param_t
Definition: brlapi_param.h:36
ssize_t BRLAPI_STDCALL brlapi_getParameter(brlapi_param_t parameter, brlapi_param_subparam_t subparam, brlapi_param_flags_t flags, void *data, size_t len)
brlapi_paramCallbackDescriptor_t BRLAPI_STDCALL brlapi__watchParameter(brlapi_handle_t *handle, brlapi_param_t parameter, brlapi_param_subparam_t subparam, brlapi_param_flags_t flags, brlapi_paramCallback_t func, void *priv, void *data, size_t len)
int BRLAPI_STDCALL brlapi__setParameter(brlapi_handle_t *handle, brlapi_param_t parameter, brlapi_param_subparam_t subparam, brlapi_param_flags_t flags, const void *data, size_t len)
void *BRLAPI_STDCALL brlapi__getParameterAlloc(brlapi_handle_t *handle, brlapi_param_t parameter, brlapi_param_subparam_t subparam, brlapi_param_flags_t flags, size_t *len)
int BRLAPI_STDCALL brlapi_unwatchParameter(brlapi_paramCallbackDescriptor_t descriptor)
void(* brlapi_paramCallback_t)(brlapi_param_t parameter, brlapi_param_subparam_t subparam, brlapi_param_flags_t flags, void *priv, const void *data, size_t len)
Definition: brlapi.h:1127
int BRLAPI_STDCALL brlapi__unwatchParameter(brlapi_handle_t *handle, brlapi_paramCallbackDescriptor_t descriptor)
ssize_t BRLAPI_STDCALL brlapi__getParameter(brlapi_handle_t *handle, brlapi_param_t parameter, brlapi_param_subparam_t subparam, brlapi_param_flags_t flags, void *data, size_t len)
int BRLAPI_STDCALL brlapi_setFocus(int tty)
int BRLAPI_STDCALL brlapi__enterTtyModeWithPath(brlapi_handle_t *handle, int *ttys, int count, const char *driver)
int BRLAPI_STDCALL brlapi_enterTtyModeWithPath(int *ttys, int count, const char *driver)
int BRLAPI_STDCALL brlapi_leaveTtyMode(void)
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__leaveTtyMode(brlapi_handle_t *handle)
int BRLAPI_STDCALL brlapi__setFocus(brlapi_handle_t *handle, int tty)
void brlapi_getLibraryVersion(int *major, int *minor, int *revision)
int BRLAPI_STDCALL brlapi__writeWText(brlapi_handle_t *handle, int cursor, const wchar_t *text)
int BRLAPI_STDCALL brlapi_write(const brlapi_writeArguments_t *arguments)
int BRLAPI_STDCALL brlapi__writeText(brlapi_handle_t *handle, int cursor, const char *text)
int BRLAPI_STDCALL brlapi_writeWText(int cursor, const wchar_t *text)
int BRLAPI_STDCALL brlapi__writeDots(brlapi_handle_t *handle, const unsigned char *dots)
int BRLAPI_STDCALL brlapi_writeText(int cursor, const char *text)
int BRLAPI_STDCALL brlapi_writeDots(const unsigned char *dots)
int BRLAPI_STDCALL brlapi__write(brlapi_handle_t *handle, const brlapi_writeArguments_t *arguments)
Settings structure for BrlAPI connection.
Definition: brlapi.h:207
const char * host
Definition: brlapi.h:225
const char * auth
Definition: brlapi.h:215
Definition: brlapi.h:713
Definition: brlapi.h:1261
int gaierrno
Definition: brlapi.h:1264
int brlerrno
Definition: brlapi.h:1262
const char * errfun
Definition: brlapi.h:1265
int libcerrno
Definition: brlapi.h:1263
Definition: brlapi.h:694
Definition: brlapi.h:907
brlapi_keyCode_t last
Definition: brlapi.h:909
brlapi_keyCode_t first
Definition: brlapi.h:908
Definition: brlapi.h:582
Definition: brlapi.h:1434
int displayNumber
Definition: brlapi.h:1435
char * text
Definition: brlapi.h:1438
int cursor
Definition: brlapi.h:1442
unsigned int regionBegin
Definition: brlapi.h:1436
unsigned int regionSize
Definition: brlapi.h:1437
unsigned char * attrAnd
Definition: brlapi.h:1440
unsigned char * attrOr
Definition: brlapi.h:1441
int textSize
Definition: brlapi.h:1439
char * charset
Definition: brlapi.h:1443