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-2023 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.5"
39 
41 #define BRLAPI_MAJOR 0
42 
44 #define BRLAPI_MINOR 8
45 
47 #define BRLAPI_REVISION 5
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 */
280 #ifndef BRLAPI_NO_SINGLE_SESSION
282 #endif /* BRLAPI_NO_SINGLE_SESSION */
284 
285 /* brlapi_fileDescriptor */
293 #ifndef BRLAPI_NO_SINGLE_SESSION
295 #endif /* BRLAPI_NO_SINGLE_SESSION */
297 
298 
299 /* brlapi_closeConnection */
306 #ifndef BRLAPI_NO_SINGLE_SESSION
308 #endif /* BRLAPI_NO_SINGLE_SESSION */
310 
319 /* brlapi__setClientData */
324 #ifndef BRLAPI_NO_SINGLE_SESSION
326 #endif /* BRLAPI_NO_SINGLE_SESSION */
328 
329 /* brlapi__getClientData */
334 #ifndef BRLAPI_NO_SINGLE_SESSION
336 #endif /* BRLAPI_NO_SINGLE_SESSION */
338 
354 #define BRLAPI_MAXNAMELENGTH 31
355 
356 /* brlapi_getDriverName */
369 #ifndef BRLAPI_NO_SINGLE_SESSION
370 int BRLAPI_STDCALL brlapi_getDriverName(char *buffer, size_t size);
371 #endif /* BRLAPI_NO_SINGLE_SESSION */
372 int BRLAPI_STDCALL brlapi__getDriverName(brlapi_handle_t *handle, char *buffer, size_t size);
373 
374 /* brlapi_getModelIdentifier */
387 #ifndef BRLAPI_NO_SINGLE_SESSION
388 int BRLAPI_STDCALL brlapi_getModelIdentifier(char *buffer, size_t size);
389 #endif /* BRLAPI_NO_SINGLE_SESSION */
390 int BRLAPI_STDCALL brlapi__getModelIdentifier(brlapi_handle_t *handle, char *buffer, size_t size);
391 
392 /* brlapi_getDisplaySize */
394 #ifndef BRLAPI_NO_SINGLE_SESSION
395 int BRLAPI_STDCALL brlapi_getDisplaySize(unsigned int *x, unsigned int *y);
396 #endif /* BRLAPI_NO_SINGLE_SESSION */
397 int BRLAPI_STDCALL brlapi__getDisplaySize(brlapi_handle_t *handle, unsigned int *x, unsigned int *y);
398 
422 /* brlapi_enterTtyMode */
446 #ifndef BRLAPI_NO_SINGLE_SESSION
447 int BRLAPI_STDCALL brlapi_enterTtyMode(int tty, const char *driver);
448 #endif /* BRLAPI_NO_SINGLE_SESSION */
449 int BRLAPI_STDCALL brlapi__enterTtyMode(brlapi_handle_t *handle, int tty, const char *driver);
450 
460 #define BRLAPI_TTY_DEFAULT -1
461 
462 /* brlapi_enterTtyModeWithPath */
481 #ifndef BRLAPI_NO_SINGLE_SESSION
482 int BRLAPI_STDCALL brlapi_enterTtyModeWithPath(const int *ttys, int count, const char *driver);
483 #endif /* BRLAPI_NO_SINGLE_SESSION */
484 int BRLAPI_STDCALL brlapi__enterTtyModeWithPath(brlapi_handle_t *handle, const int *ttys, int count, const char *driver);
485 
486 /* brlapi_leaveTtyMode */
493 #ifndef BRLAPI_NO_SINGLE_SESSION
495 #endif /* BRLAPI_NO_SINGLE_SESSION */
497 
498 /* brlapi_setFocus */
509 #ifndef BRLAPI_NO_SINGLE_SESSION
511 #endif /* BRLAPI_NO_SINGLE_SESSION */
513 
546 /* brlapi_writeText */
561 #ifndef BRLAPI_NO_SINGLE_SESSION
562 int BRLAPI_STDCALL brlapi_writeText(int cursor, const char *text);
563 #endif /* BRLAPI_NO_SINGLE_SESSION */
564 int BRLAPI_STDCALL brlapi__writeText(brlapi_handle_t *handle, int cursor, const char *text);
565 
566 /* brlapi_writeWText */
579 #ifndef BRLAPI_NO_SINGLE_SESSION
580 int BRLAPI_STDCALL brlapi_writeWText(int cursor, const wchar_t *text);
581 #endif /* BRLAPI_NO_SINGLE_SESSION */
582 int BRLAPI_STDCALL brlapi__writeWText(brlapi_handle_t *handle, int cursor, const wchar_t *text);
583 
584 /* brlapi_writeDots */
592 #ifndef BRLAPI_NO_SINGLE_SESSION
593 int BRLAPI_STDCALL brlapi_writeDots(const unsigned char *dots);
594 #endif /* BRLAPI_NO_SINGLE_SESSION */
595 int BRLAPI_STDCALL brlapi__writeDots(brlapi_handle_t *handle, const unsigned char *dots);
596 
597 /* brlapi_writeArguments_t */
599 typedef struct {
600  int displayNumber ;
601  unsigned int regionBegin ;
602  int regionSize ;
603  const char *text ;
604  int textSize ;
605  const unsigned char *andMask ;
606  const unsigned char *orMask ;
607  int cursor ;
608  const char *charset ;
610 
615 #define BRLAPI_DISPLAY_DEFAULT -1
616 
621 #define BRLAPI_CURSOR_LEAVE -1
622 
627 #define BRLAPI_CURSOR_OFF 0
628 
629 /* BRLAPI_WRITEARGUMENTS_INITIALIZER */
639 #define BRLAPI_WRITEARGUMENTS_INITIALIZER { \
640  .displayNumber = BRLAPI_DISPLAY_DEFAULT, \
641  .regionBegin = 0, \
642  .regionSize = 0, \
643  .text = NULL, \
644  .textSize = -1, \
645  .andMask = NULL, \
646  .orMask = NULL, \
647  .cursor = BRLAPI_CURSOR_LEAVE, \
648  .charset = NULL \
649 }
650 
651 /* brlapi_write */
687 #ifndef BRLAPI_NO_SINGLE_SESSION
689 #endif /* BRLAPI_NO_SINGLE_SESSION */
691 
694 #include "brlapi_keycodes.h"
695 
709 /* brlapi_expandedKeyCode_t */
711 typedef struct {
712  unsigned int type ;
713  unsigned int command ;
714  unsigned int argument ;
715  unsigned int flags ;
717 
718 /* brlapi_expandKeyCode */
727 
728 /* brlapi_describedKeyCode_t */
730 typedef struct {
731  const char *type ;
732  const char *command ;
733  unsigned int argument ;
734  unsigned int flags ;
735  const char *flag[64 - BRLAPI_KEY_FLAGS_SHIFT] ;
738 
739 /* brlapi_describeKeyCode */
748 
750 #define BRLAPI_UC_ROW 0x2800UL
751 
752 /* brlapi_readKey */
821 #ifndef BRLAPI_NO_SINGLE_SESSION
823 #endif /* BRLAPI_NO_SINGLE_SESSION */
825 
826 /* brlapi_readKeyWithTimeout */
847 #ifndef BRLAPI_NO_SINGLE_SESSION
849 #endif /* BRLAPI_NO_SINGLE_SESSION */
851 
853 typedef enum {
860 
861 /* brlapi_ignoreKeys */
873 #ifndef BRLAPI_NO_SINGLE_SESSION
874 int BRLAPI_STDCALL brlapi_ignoreKeys(brlapi_rangeType_t type, const brlapi_keyCode_t keys[], unsigned int count);
875 #endif /* BRLAPI_NO_SINGLE_SESSION */
876 int BRLAPI_STDCALL brlapi__ignoreKeys(brlapi_handle_t *handle, brlapi_rangeType_t type, const brlapi_keyCode_t keys[], unsigned int count);
877 
878 /* brlapi_acceptKeys */
890 #ifndef BRLAPI_NO_SINGLE_SESSION
891 int BRLAPI_STDCALL brlapi_acceptKeys(brlapi_rangeType_t type, const brlapi_keyCode_t keys[], unsigned int count);
892 #endif /* BRLAPI_NO_SINGLE_SESSION */
893 int BRLAPI_STDCALL brlapi__acceptKeys(brlapi_handle_t *handle, brlapi_rangeType_t type, const brlapi_keyCode_t keys[], unsigned int count);
894 
895 /* brlapi_ignoreAllKeys */
903 #ifndef BRLAPI_NO_SINGLE_SESSION
905 #define brlapi_ignoreAllKeys() brlapi_ignoreKeys(brlapi_rangeType_all, NULL, 0)
906 #endif /* BRLAPI_NO_SINGLE_SESSION */
908 #define brlapi__ignoreAllKeys(handle) brlapi__ignoreKeys(handle, brlapi_rangeType_all, NULL, 0)
909 
910 /* brlapi_acceptAllKeys */
921 #ifndef BRLAPI_NO_SINGLE_SESSION
923 #define brlapi_acceptAllKeys() brlapi_acceptKeys(brlapi_rangeType_all, NULL, 0)
924 #endif /* BRLAPI_NO_SINGLE_SESSION */
926 #define brlapi__acceptAllKeys(handle) brlapi__acceptKeys(handle, brlapi_rangeType_all, NULL, 0)
927 
932 typedef struct {
936 
937 /* brlapi_ignoreKeyRanges */
948 #ifndef BRLAPI_NO_SINGLE_SESSION
949 int BRLAPI_STDCALL brlapi_ignoreKeyRanges(const brlapi_range_t ranges[], unsigned int count);
950 #endif /* BRLAPI_NO_SINGLE_SESSION */
951 int BRLAPI_STDCALL brlapi__ignoreKeyRanges(brlapi_handle_t *handle, const brlapi_range_t ranges[], unsigned int count);
952 
953 /* brlapi_acceptKeyRanges */
964 #ifndef BRLAPI_NO_SINGLE_SESSION
965 int BRLAPI_STDCALL brlapi_acceptKeyRanges(const brlapi_range_t ranges[], unsigned int count);
966 #endif /* BRLAPI_NO_SINGLE_SESSION */
967 int BRLAPI_STDCALL brlapi__acceptKeyRanges(brlapi_handle_t *handle, const brlapi_range_t ranges[], unsigned int count);
993 /* brlapi_enterRawMode */
1001 #ifndef BRLAPI_NO_SINGLE_SESSION
1002 int BRLAPI_STDCALL brlapi_enterRawMode(const char *driver);
1003 #endif /* BRLAPI_NO_SINGLE_SESSION */
1004 int BRLAPI_STDCALL brlapi__enterRawMode(brlapi_handle_t *handle, const char *driver);
1005 
1006 /* brlapi_leaveRawMode */
1009 #ifndef BRLAPI_NO_SINGLE_SESSION
1011 #endif /* BRLAPI_NO_SINGLE_SESSION */
1013 
1014 /* brlapi_sendRaw */
1020 #ifndef BRLAPI_NO_SINGLE_SESSION
1021 ssize_t BRLAPI_STDCALL brlapi_sendRaw(const void *buffer, size_t size);
1022 #endif /* BRLAPI_NO_SINGLE_SESSION */
1023 ssize_t BRLAPI_STDCALL brlapi__sendRaw(brlapi_handle_t *handle, const void *buffer, size_t size);
1024 
1025 /* brlapi_recvRaw */
1034 #ifndef BRLAPI_NO_SINGLE_SESSION
1035 ssize_t BRLAPI_STDCALL brlapi_recvRaw(void *buffer, size_t size);
1036 #endif /* BRLAPI_NO_SINGLE_SESSION */
1037 ssize_t BRLAPI_STDCALL brlapi__recvRaw(brlapi_handle_t *handle, void *buffer, size_t size);
1038 
1039 /* brlapi_suspendDriver */
1044 #ifndef BRLAPI_NO_SINGLE_SESSION
1045 int BRLAPI_STDCALL brlapi_suspendDriver(const char *driver);
1046 #endif /* BRLAPI_NO_SINGLE_SESSION */
1047 int BRLAPI_STDCALL brlapi__suspendDriver(brlapi_handle_t *handle, const char *driver);
1048 
1049 /* brlapi_resumeDriver */
1053 #ifndef BRLAPI_NO_SINGLE_SESSION
1055 #endif /* BRLAPI_NO_SINGLE_SESSION */
1059 #include "brlapi_param.h"
1060 
1085 typedef uint32_t brlapi_param_flags_t;
1086 #define BRLAPI_PARAMF_LOCAL 0X00
1087 #define BRLAPI_PARAMF_GLOBAL 0X01
1088 #define BRLAPI_PARAMF_SELF 0X02
1090 /* brlapi_getParameter */
1103 #ifndef BRLAPI_NO_SINGLE_SESSION
1104 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);
1105 #endif
1106 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);
1107 
1108 /* brlapi_getParameterAlloc */
1121 #ifndef BRLAPI_NO_SINGLE_SESSION
1123 #endif
1125 
1126 /* brlapi_setParameter */
1139 #ifndef BRLAPI_NO_SINGLE_SESSION
1140 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);
1141 #endif
1142 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);
1143 
1144 /* brlapi_paramCallback_t */
1160 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);
1161 
1162 /* brlapi_paramCallbackDescriptor_t */
1168 
1169 /* brlapi_watchParameter */
1192 #ifndef BRLAPI_NO_SINGLE_SESSION
1194 #endif
1196 
1197 /* brlapi_unwatchParameter */
1208 #ifndef BRLAPI_NO_SINGLE_SESSION
1210 #endif
1212 
1218 /* brlapi_pause */
1225 #ifndef BRLAPI_NO_SINGLE_SESSION
1226 int BRLAPI_STDCALL brlapi_pause(int timeout_ms);
1227 #endif
1228 int BRLAPI_STDCALL brlapi__pause(brlapi_handle_t *handle, int timeout_ms);
1229 
1230 /* brlapi_sync */
1238 #ifndef BRLAPI_NO_SINGLE_SESSION
1240 #endif
1242 
1269 #define BRLAPI_ERROR_SUCCESS 0
1271 #define BRLAPI_ERROR_NOMEM BRLAPI_ERROR_NOMEM
1273 #define BRLAPI_ERROR_TTYBUSY BRLAPI_ERROR_TTYBUSY
1275 #define BRLAPI_ERROR_DEVICEBUSY BRLAPI_ERROR_DEVICEBUSY
1277 #define BRLAPI_ERROR_UNKNOWN_INSTRUCTION BRLAPI_ERROR_UNKNOWN_INSTRUCTION
1279 #define BRLAPI_ERROR_ILLEGAL_INSTRUCTION BRLAPI_ERROR_ILLEGAL_INSTRUCTION
1281 #define BRLAPI_ERROR_INVALID_PARAMETER BRLAPI_ERROR_INVALID_PARAMETER
1283 #define BRLAPI_ERROR_INVALID_PACKET BRLAPI_ERROR_INVALID_PACKET
1285 #define BRLAPI_ERROR_CONNREFUSED BRLAPI_ERROR_CONNREFUSED
1287 #define BRLAPI_ERROR_OPNOTSUPP BRLAPI_ERROR_OPNOTSUPP
1289 #define BRLAPI_ERROR_GAIERR BRLAPI_ERROR_GAIERR
1291 #define BRLAPI_ERROR_LIBCERR BRLAPI_ERROR_LIBCERR
1293 #define BRLAPI_ERROR_UNKNOWNTTY BRLAPI_ERROR_UNKNOWNTTY
1295 #define BRLAPI_ERROR_PROTOCOL_VERSION BRLAPI_ERROR_PROTOCOL_VERSION
1297 #define BRLAPI_ERROR_EOF BRLAPI_ERROR_EOF
1299 #define BRLAPI_ERROR_EMPTYKEY BRLAPI_ERROR_EMPTYKEY
1301 #define BRLAPI_ERROR_DRIVERERROR BRLAPI_ERROR_DRIVERERROR
1303 #define BRLAPI_ERROR_AUTHENTICATION BRLAPI_ERROR_AUTHENTICATION
1305 #define BRLAPI_ERROR_READONLY_PARAMETER BRLAPI_ERROR_READONLY_PARAMETER
1306 };
1307 
1308 /* brlapi_errlist */
1313 extern const char *brlapi_errlist[];
1314 
1315 /* brlapi_nerr */
1317 extern const int brlapi_nerr;
1318 
1319 /* brlapi_perror */
1324 void BRLAPI_STDCALL brlapi_perror(const char *s);
1325 
1326 /* brlapi_error_t */
1328 typedef struct {
1329  enum brlapi_error brlerrno;
1332  const char *errfun;
1333 } brlapi_error_t;
1334 
1344 
1354 
1356 extern enum brlapi_error brlapi_errno;
1358 extern int brlapi_libcerrno;
1360 extern int brlapi_gaierrno;
1362 extern const char *brlapi_errfun;
1363 
1365 #define brlapi_error (*brlapi_error_location())
1367 #define brlapi_errno (brlapi_error.brlerrno)
1369 #define brlapi_libcerrno (brlapi_error.libcerrno)
1371 #define brlapi_gaierrno (brlapi_error.gaierrno)
1373 #define brlapi_errfun (brlapi_error.errfun)
1374 
1375 /* brlapi_strerror */
1383 const char * BRLAPI_STDCALL brlapi_strerror(const brlapi_error_t *error);
1384 
1385 /* brlapi_strerror_r */
1402 size_t BRLAPI_STDCALL brlapi_strerror_r(const brlapi_error_t *error, char *buf, size_t buflen);
1403 
1405 typedef uint32_t brlapi_packetType_t;
1406 
1407 /* brlapi_getPacketTypeName */
1414 
1415 /* brlapi_exceptionHandler_t */
1426 #ifndef BRLAPI_NO_SINGLE_SESSION
1427 typedef void (BRLAPI_STDCALL *brlapi_exceptionHandler_t)(int error, brlapi_packetType_t type, const void *packet, size_t size);
1428 #endif /* BRLAPI_NO_SINGLE_SESSION */
1429 typedef void (BRLAPI_STDCALL *brlapi__exceptionHandler_t)(brlapi_handle_t *handle, int error, brlapi_packetType_t type, const void *packet, size_t size);
1430 
1431 /* brlapi_strexception */
1441 #ifndef BRLAPI_NO_SINGLE_SESSION
1442 int BRLAPI_STDCALL brlapi_strexception(char *buffer, size_t bufferSize, int error, brlapi_packetType_t type, const void *packet, size_t packetSize);
1443 #endif /* BRLAPI_NO_SINGLE_SESSION */
1444 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);
1445 
1446 /* brlapi_setExceptionHandler */
1455 #ifndef BRLAPI_NO_SINGLE_SESSION
1457 #endif /* BRLAPI_NO_SINGLE_SESSION */
1459 
1460 #ifndef BRLAPI_NO_SINGLE_SESSION
1461 void BRLAPI_STDCALL brlapi_defaultExceptionHandler(int error, brlapi_packetType_t type, const void *packet, size_t size);
1462 #endif /* BRLAPI_NO_SINGLE_SESSION */
1463 void BRLAPI_STDCALL brlapi__defaultExceptionHandler(brlapi_handle_t *handle, int error, brlapi_packetType_t type, const void *packet, size_t size);
1464 
1467 /* Windows-specific tricks - don't look at this */
1468 #ifdef BRLAPI_WIN32
1469 #ifndef BRLAPI_NO_SINGLE_SESSION
1470 int BRLAPI_STDCALL brlapi_writeTextWin(int cursor, const void *str, int wide);
1471 #endif /* BRLAPI_NO_SINGLE_SESSION */
1472 int BRLAPI_STDCALL brlapi__writeTextWin(brlapi_handle_t *handle, int cursor, const void *str, int wide);
1473 
1474 #ifndef BRLAPI_NO_SINGLE_SESSION
1475 int BRLAPI_STDCALL brlapi_writeWin(const brlapi_writeArguments_t *s, int wide);
1476 #endif /* BRLAPI_NO_SINGLE_SESSION */
1477 int BRLAPI_STDCALL brlapi__writeWin(brlapi_handle_t *handle, const brlapi_writeArguments_t *s, int wide);
1478 
1479 #ifdef UNICODE
1480 #ifndef BRLAPI_NO_SINGLE_SESSION
1481 #define brlapi_writeText(cursor, str) brlapi_writeTextWin(cursor, str, 1)
1482 #endif /* BRLAPI_NO_SINGLE_SESSION */
1483 #define brlapi__writeText(handle, cursor, str) brlapi__writeTextWin(handle, cursor, str, 1)
1484 
1485 #ifndef BRLAPI_NO_SINGLE_SESSION
1486 #define brlapi_write(s) brlapi_writeWin(s, 1)
1487 #endif /* BRLAPI_NO_SINGLE_SESSION */
1488 #define brlapi__write(handle, s) brlapi__writeWin(handle, s, 1)
1489 
1490 #else /* UNICODE */
1491 
1492 #ifndef BRLAPI_NO_SINGLE_SESSION
1493 #define brlapi_writeText(cursor, str) brlapi_writeTextWin(cursor, str, 0)
1494 #endif /* BRLAPI_NO_SINGLE_SESSION */
1495 #define brlapi__writeText(handle, cursor, str) brlapi__writeTextWin(handle, cursor, str, 0)
1496 
1497 #ifndef BRLAPI_NO_SINGLE_SESSION
1498 #define brlapi_write(s) brlapi_writeWin(s, 0)
1499 #endif /* BRLAPI_NO_SINGLE_SESSION */
1500 #define brlapi__write(handle, s) brlapi__writeWin(handle, s, 0)
1501 
1502 #endif /* UNICODE */
1503 #endif /* BRLAPI_WIN32 */
1504 
1505 #ifndef BRLAPI_NO_DEPRECATED
1518 #define brlapi_settings_t brlapi_connectionSettings_t
1519 
1521 typedef struct {
1523  unsigned int regionBegin;
1524  unsigned int regionSize;
1525  const char *text;
1527  const unsigned char *attrAnd;
1528  const unsigned char *attrOr;
1529  int cursor;
1530  const char *charset;
1532 #define BRLAPI_WRITESTRUCT_INITIALIZER BRLAPI_WRITEARGUMENTS_INITIALIZER
1533 
1534 #define brl_keycode_t brlapi_keyCode_t
1535 #define brl_type_t brlapi_packetType_t
1536 
1537 #define BRLCOMMANDS NULL
1538 #define BRL_KEYCODE_MAX BRLAPI_KEY_MAX
1539 
1540 #ifndef BRLAPI_NO_SINGLE_SESSION
1541 #define brlapi_initializeConnection brlapi_openConnection
1542 #define brlapi_getTty brlapi_enterTtyMode
1543 #define brlapi_getTtyPath brlapi_enterTtyModeWithPath
1544 #define brlapi_leaveTty brlapi_leaveTtyMode
1545 #define brlapi_unignoreKeyRange brlapi_acceptKeyRange
1546 #define brlapi_unignoreKeySet brlapi_acceptKeySet
1547 #define brlapi_getRaw brlapi_enterRawMode
1548 #define brlapi_leaveRaw brlapi_leaveRawMode
1549 #define brlapi_suspend brlapi_suspendDriver
1550 #define brlapi_resume brlapi_resumeDriver
1551 #endif /* BRLAPI_NO_SINGLE_SESSION */
1552 
1553 #define BRLERR_SUCCESS BRLAPI_ERROR_SUCCESS
1554 #define BRLERR_NOMEM BRLAPI_ERROR_NOMEM
1555 #define BRLERR_TTYBUSY BRLAPI_ERROR_TTYBUSY
1556 #define BRLERR_DEVICEBUSY BRLAPI_ERROR_DEVICEBUSY
1557 #define BRLERR_UNKNOWN_INSTRUCTION BRLAPI_ERROR_UNKNOWN_INSTRUCTION
1558 #define BRLERR_ILLEGAL_INSTRUCTION BRLAPI_ERROR_ILLEGAL_INSTRUCTION
1559 #define BRLERR_INVALID_PARAMETER BRLAPI_ERROR_INVALID_PARAMETER
1560 #define BRLERR_INVALID_PACKET BRLAPI_ERROR_INVALID_PACKET
1561 #define BRLERR_CONNREFUSED BRLAPI_ERROR_CONNREFUSED
1562 #define BRLERR_OPNOTSUPP BRLAPI_ERROR_OPNOTSUPP
1563 #define BRLERR_GAIERR BRLAPI_ERROR_GAIERR
1564 #define BRLERR_LIBCERR BRLAPI_ERROR_LIBCERR
1565 #define BRLERR_UNKNOWNTTY BRLAPI_ERROR_UNKNOWNTTY
1566 #define BRLERR_PROTOCOL_VERSION BRLAPI_ERROR_PROTOCOL_VERSION
1567 #define BRLERR_EOF BRLAPI_ERROR_EOF
1568 #define BRLERR_EMPTYKEY BRLAPI_ERROR_EMPTYKEY
1569 #define BRLERR_DRIVERERROR BRLAPI_ERROR_DRIVERERROR
1570 
1572 #endif /* BRLAPI_NO_DEPRECATED */
1573 
1574 #ifdef __cplusplus
1575 }
1576 #endif /* __cplusplus */
1577 
1578 #endif /* BRLAPI_INCLUDED */
#define BRLAPI_ERROR_INVALID_PARAMETER
Definition: brlapi.h:1281
#define BRLAPI_ERROR_DEVICEBUSY
Definition: brlapi.h:1275
#define BRLAPI_ERROR_TTYBUSY
Definition: brlapi.h:1273
#define BRLAPI_ERROR_UNKNOWNTTY
Definition: brlapi.h:1293
#define BRLAPI_ERROR_DRIVERERROR
Definition: brlapi.h:1301
#define BRLAPI_ERROR_AUTHENTICATION
Definition: brlapi.h:1303
#define BRLAPI_ERROR_LIBCERR
Definition: brlapi.h:1291
#define BRLAPI_ERROR_GAIERR
Definition: brlapi.h:1289
#define BRLAPI_ERROR_OPNOTSUPP
Definition: brlapi.h:1287
#define BRLAPI_ERROR_ILLEGAL_INSTRUCTION
Definition: brlapi.h:1279
#define BRLAPI_ERROR_EMPTYKEY
Definition: brlapi.h:1299
#define BRLAPI_ERROR_SUCCESS
Definition: brlapi.h:1269
#define BRLAPI_STDCALL
Definition: brlapi.h:61
#define BRLAPI_ERROR_INVALID_PACKET
Definition: brlapi.h:1283
#define BRLAPI_ERROR_READONLY_PARAMETER
Definition: brlapi.h:1305
#define BRLAPI_ERROR_NOMEM
Definition: brlapi.h:1271
#define BRLAPI_ERROR_EOF
Definition: brlapi.h:1297
#define BRLAPI_ERROR_CONNREFUSED
Definition: brlapi.h:1285
#define BRLAPI_ERROR_PROTOCOL_VERSION
Definition: brlapi.h:1295
#define BRLAPI_ERROR_UNKNOWN_INSTRUCTION
Definition: brlapi.h:1277
uint64_t brlapi_param_subparam_t
Definition: brlapi_param.h:112
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:1427
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)
size_t BRLAPI_STDCALL brlapi_strerror_r(const brlapi_error_t *error, char *buf, size_t buflen)
#define brlapi_errno
Definition: brlapi.h:1367
const char * brlapi_errlist[]
const int brlapi_nerr
#define brlapi_errfun
Definition: brlapi.h:1373
#define brlapi_error
Definition: brlapi.h:1365
void BRLAPI_STDCALL brlapi_perror(const char *s)
brlapi_error
Definition: brlapi.h:1267
#define brlapi_gaierrno
Definition: brlapi.h:1371
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:1369
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:1405
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:1429
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:109
#define BRLAPI_KEY_FLAGS_SHIFT
Definition: brlapi_keycodes.h:130
brlapi_rangeType_t
Definition: brlapi.h:853
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:908
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:926
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:905
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:923
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:854
@ brlapi_rangeType_key
Definition: brlapi.h:857
@ brlapi_rangeType_command
Definition: brlapi.h:856
@ brlapi_rangeType_type
Definition: brlapi.h:855
@ brlapi_rangeType_code
Definition: brlapi.h:858
int BRLAPI_STDCALL brlapi__pause(brlapi_handle_t *handle, int timeout_ms)
int BRLAPI_STDCALL brlapi_pause(int timeout_ms)
int BRLAPI_STDCALL brlapi_sync(void)
int BRLAPI_STDCALL brlapi__sync(brlapi_handle_t *handle)
void * brlapi_paramCallbackDescriptor_t
Definition: brlapi.h:1167
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:1085
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:1160
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_enterTtyModeWithPath(const int *ttys, int count, const char *driver)
int BRLAPI_STDCALL brlapi_setFocus(int tty)
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)
int BRLAPI_STDCALL brlapi__enterTtyModeWithPath(brlapi_handle_t *handle, const int *ttys, int count, const char *driver)
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:730
Definition: brlapi.h:1328
int gaierrno
Definition: brlapi.h:1331
const char * errfun
Definition: brlapi.h:1332
int libcerrno
Definition: brlapi.h:1330
Definition: brlapi.h:711
Definition: brlapi.h:932
brlapi_keyCode_t first
Definition: brlapi.h:933
Definition: brlapi.h:599
Definition: brlapi.h:1521
int displayNumber
Definition: brlapi.h:1522
int cursor
Definition: brlapi.h:1529
unsigned int regionBegin
Definition: brlapi.h:1523
unsigned int regionSize
Definition: brlapi.h:1524
const char * text
Definition: brlapi.h:1525
const unsigned char * attrOr
Definition: brlapi.h:1528
const char * charset
Definition: brlapi.h:1530
const unsigned char * attrAnd
Definition: brlapi.h:1527
int textSize
Definition: brlapi.h:1526