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-2022 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.4"
39 
41 #define BRLAPI_MAJOR 0
42 
44 #define BRLAPI_MINOR 8
45 
47 #define BRLAPI_REVISION 4
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 
543 /* brlapi_writeText */
558 #ifndef BRLAPI_NO_SINGLE_SESSION
559 int BRLAPI_STDCALL brlapi_writeText(int cursor, const char *text);
560 #endif /* BRLAPI_NO_SINGLE_SESSION */
561 int BRLAPI_STDCALL brlapi__writeText(brlapi_handle_t *handle, int cursor, const char *text);
562 
563 /* brlapi_writeWText */
576 #ifndef BRLAPI_NO_SINGLE_SESSION
577 int BRLAPI_STDCALL brlapi_writeWText(int cursor, const wchar_t *text);
578 #endif /* BRLAPI_NO_SINGLE_SESSION */
579 int BRLAPI_STDCALL brlapi__writeWText(brlapi_handle_t *handle, int cursor, const wchar_t *text);
580 
581 /* brlapi_writeDots */
589 #ifndef BRLAPI_NO_SINGLE_SESSION
590 int BRLAPI_STDCALL brlapi_writeDots(const unsigned char *dots);
591 #endif /* BRLAPI_NO_SINGLE_SESSION */
592 int BRLAPI_STDCALL brlapi__writeDots(brlapi_handle_t *handle, const unsigned char *dots);
593 
594 /* brlapi_writeArguments_t */
596 typedef struct {
597  int displayNumber ;
598  unsigned int regionBegin ;
599  int regionSize ;
600  const char *text ;
601  int textSize ;
602  const unsigned char *andMask ;
603  const unsigned char *orMask ;
604  int cursor ;
605  const char *charset ;
607 
612 #define BRLAPI_DISPLAY_DEFAULT -1
613 
618 #define BRLAPI_CURSOR_LEAVE -1
619 
624 #define BRLAPI_CURSOR_OFF 0
625 
626 /* BRLAPI_WRITEARGUMENTS_INITIALIZER */
636 #define BRLAPI_WRITEARGUMENTS_INITIALIZER { \
637  .displayNumber = BRLAPI_DISPLAY_DEFAULT, \
638  .regionBegin = 0, \
639  .regionSize = 0, \
640  .text = NULL, \
641  .textSize = -1, \
642  .andMask = NULL, \
643  .orMask = NULL, \
644  .cursor = BRLAPI_CURSOR_LEAVE, \
645  .charset = NULL \
646 }
647 
648 /* brlapi_write */
684 #ifndef BRLAPI_NO_SINGLE_SESSION
686 #endif /* BRLAPI_NO_SINGLE_SESSION */
688 
691 #include "brlapi_keycodes.h"
692 
706 /* brlapi_expandedKeyCode_t */
708 typedef struct {
709  unsigned int type ;
710  unsigned int command ;
711  unsigned int argument ;
712  unsigned int flags ;
714 
715 /* brlapi_expandKeyCode */
724 
725 /* brlapi_describedKeyCode_t */
727 typedef struct {
728  const char *type ;
729  const char *command ;
730  unsigned int argument ;
731  unsigned int flags ;
732  const char *flag[64 - BRLAPI_KEY_FLAGS_SHIFT] ;
735 
736 /* brlapi_describeKeyCode */
745 
747 #define BRLAPI_UC_ROW 0x2800UL
748 
749 /* brlapi_readKey */
818 #ifndef BRLAPI_NO_SINGLE_SESSION
820 #endif /* BRLAPI_NO_SINGLE_SESSION */
822 
823 /* brlapi_readKeyWithTimeout */
844 #ifndef BRLAPI_NO_SINGLE_SESSION
846 #endif /* BRLAPI_NO_SINGLE_SESSION */
848 
850 typedef enum {
857 
858 /* brlapi_ignoreKeys */
870 #ifndef BRLAPI_NO_SINGLE_SESSION
871 int BRLAPI_STDCALL brlapi_ignoreKeys(brlapi_rangeType_t type, const brlapi_keyCode_t keys[], unsigned int count);
872 #endif /* BRLAPI_NO_SINGLE_SESSION */
873 int BRLAPI_STDCALL brlapi__ignoreKeys(brlapi_handle_t *handle, brlapi_rangeType_t type, const brlapi_keyCode_t keys[], unsigned int count);
874 
875 /* brlapi_acceptKeys */
887 #ifndef BRLAPI_NO_SINGLE_SESSION
888 int BRLAPI_STDCALL brlapi_acceptKeys(brlapi_rangeType_t type, const brlapi_keyCode_t keys[], unsigned int count);
889 #endif /* BRLAPI_NO_SINGLE_SESSION */
890 int BRLAPI_STDCALL brlapi__acceptKeys(brlapi_handle_t *handle, brlapi_rangeType_t type, const brlapi_keyCode_t keys[], unsigned int count);
891 
892 /* brlapi_ignoreAllKeys */
900 #ifndef BRLAPI_NO_SINGLE_SESSION
902 #define brlapi_ignoreAllKeys() brlapi_ignoreKeys(brlapi_rangeType_all, NULL, 0)
903 #endif /* BRLAPI_NO_SINGLE_SESSION */
905 #define brlapi__ignoreAllKeys(handle) brlapi__ignoreKeys(handle, brlapi_rangeType_all, NULL, 0)
906 
907 /* brlapi_acceptAllKeys */
918 #ifndef BRLAPI_NO_SINGLE_SESSION
920 #define brlapi_acceptAllKeys() brlapi_acceptKeys(brlapi_rangeType_all, NULL, 0)
921 #endif /* BRLAPI_NO_SINGLE_SESSION */
923 #define brlapi__acceptAllKeys(handle) brlapi__acceptKeys(handle, brlapi_rangeType_all, NULL, 0)
924 
929 typedef struct {
933 
934 /* brlapi_ignoreKeyRanges */
945 #ifndef BRLAPI_NO_SINGLE_SESSION
946 int BRLAPI_STDCALL brlapi_ignoreKeyRanges(const brlapi_range_t ranges[], unsigned int count);
947 #endif /* BRLAPI_NO_SINGLE_SESSION */
948 int BRLAPI_STDCALL brlapi__ignoreKeyRanges(brlapi_handle_t *handle, const brlapi_range_t ranges[], unsigned int count);
949 
950 /* brlapi_acceptKeyRanges */
961 #ifndef BRLAPI_NO_SINGLE_SESSION
962 int BRLAPI_STDCALL brlapi_acceptKeyRanges(const brlapi_range_t ranges[], unsigned int count);
963 #endif /* BRLAPI_NO_SINGLE_SESSION */
964 int BRLAPI_STDCALL brlapi__acceptKeyRanges(brlapi_handle_t *handle, const brlapi_range_t ranges[], unsigned int count);
990 /* brlapi_enterRawMode */
998 #ifndef BRLAPI_NO_SINGLE_SESSION
999 int BRLAPI_STDCALL brlapi_enterRawMode(const char *driver);
1000 #endif /* BRLAPI_NO_SINGLE_SESSION */
1001 int BRLAPI_STDCALL brlapi__enterRawMode(brlapi_handle_t *handle, const char *driver);
1002 
1003 /* brlapi_leaveRawMode */
1006 #ifndef BRLAPI_NO_SINGLE_SESSION
1008 #endif /* BRLAPI_NO_SINGLE_SESSION */
1010 
1011 /* brlapi_sendRaw */
1017 #ifndef BRLAPI_NO_SINGLE_SESSION
1018 ssize_t BRLAPI_STDCALL brlapi_sendRaw(const void *buffer, size_t size);
1019 #endif /* BRLAPI_NO_SINGLE_SESSION */
1020 ssize_t BRLAPI_STDCALL brlapi__sendRaw(brlapi_handle_t *handle, const void *buffer, size_t size);
1021 
1022 /* brlapi_recvRaw */
1031 #ifndef BRLAPI_NO_SINGLE_SESSION
1032 ssize_t BRLAPI_STDCALL brlapi_recvRaw(void *buffer, size_t size);
1033 #endif /* BRLAPI_NO_SINGLE_SESSION */
1034 ssize_t BRLAPI_STDCALL brlapi__recvRaw(brlapi_handle_t *handle, void *buffer, size_t size);
1035 
1036 /* brlapi_suspendDriver */
1041 #ifndef BRLAPI_NO_SINGLE_SESSION
1042 int BRLAPI_STDCALL brlapi_suspendDriver(const char *driver);
1043 #endif /* BRLAPI_NO_SINGLE_SESSION */
1044 int BRLAPI_STDCALL brlapi__suspendDriver(brlapi_handle_t *handle, const char *driver);
1045 
1046 /* brlapi_resumeDriver */
1050 #ifndef BRLAPI_NO_SINGLE_SESSION
1052 #endif /* BRLAPI_NO_SINGLE_SESSION */
1056 #include "brlapi_param.h"
1057 
1082 typedef uint32_t brlapi_param_flags_t;
1083 #define BRLAPI_PARAMF_LOCAL 0X00
1084 #define BRLAPI_PARAMF_GLOBAL 0X01
1085 #define BRLAPI_PARAMF_SELF 0X02
1087 /* brlapi_getParameter */
1100 #ifndef BRLAPI_NO_SINGLE_SESSION
1101 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);
1102 #endif
1103 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);
1104 
1105 /* brlapi_getParameterAlloc */
1118 #ifndef BRLAPI_NO_SINGLE_SESSION
1120 #endif
1122 
1123 /* brlapi_setParameter */
1136 #ifndef BRLAPI_NO_SINGLE_SESSION
1137 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);
1138 #endif
1139 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);
1140 
1141 /* brlapi_paramCallback_t */
1157 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);
1158 
1159 /* brlapi_paramCallbackDescriptor_t */
1165 
1166 /* brlapi_watchParameter */
1189 #ifndef BRLAPI_NO_SINGLE_SESSION
1191 #endif
1193 
1194 /* brlapi_unwatchParameter */
1205 #ifndef BRLAPI_NO_SINGLE_SESSION
1207 #endif
1209 
1215 /* brlapi_pause */
1222 #ifndef BRLAPI_NO_SINGLE_SESSION
1223 int BRLAPI_STDCALL brlapi_pause(int timeout_ms);
1224 #endif
1225 int BRLAPI_STDCALL brlapi__pause(brlapi_handle_t *handle, int timeout_ms);
1226 
1227 /* brlapi_sync */
1235 #ifndef BRLAPI_NO_SINGLE_SESSION
1237 #endif
1239 
1266 #define BRLAPI_ERROR_SUCCESS 0
1268 #define BRLAPI_ERROR_NOMEM BRLAPI_ERROR_NOMEM
1270 #define BRLAPI_ERROR_TTYBUSY BRLAPI_ERROR_TTYBUSY
1272 #define BRLAPI_ERROR_DEVICEBUSY BRLAPI_ERROR_DEVICEBUSY
1274 #define BRLAPI_ERROR_UNKNOWN_INSTRUCTION BRLAPI_ERROR_UNKNOWN_INSTRUCTION
1276 #define BRLAPI_ERROR_ILLEGAL_INSTRUCTION BRLAPI_ERROR_ILLEGAL_INSTRUCTION
1278 #define BRLAPI_ERROR_INVALID_PARAMETER BRLAPI_ERROR_INVALID_PARAMETER
1280 #define BRLAPI_ERROR_INVALID_PACKET BRLAPI_ERROR_INVALID_PACKET
1282 #define BRLAPI_ERROR_CONNREFUSED BRLAPI_ERROR_CONNREFUSED
1284 #define BRLAPI_ERROR_OPNOTSUPP BRLAPI_ERROR_OPNOTSUPP
1286 #define BRLAPI_ERROR_GAIERR BRLAPI_ERROR_GAIERR
1288 #define BRLAPI_ERROR_LIBCERR BRLAPI_ERROR_LIBCERR
1290 #define BRLAPI_ERROR_UNKNOWNTTY BRLAPI_ERROR_UNKNOWNTTY
1292 #define BRLAPI_ERROR_PROTOCOL_VERSION BRLAPI_ERROR_PROTOCOL_VERSION
1294 #define BRLAPI_ERROR_EOF BRLAPI_ERROR_EOF
1296 #define BRLAPI_ERROR_EMPTYKEY BRLAPI_ERROR_EMPTYKEY
1298 #define BRLAPI_ERROR_DRIVERERROR BRLAPI_ERROR_DRIVERERROR
1300 #define BRLAPI_ERROR_AUTHENTICATION BRLAPI_ERROR_AUTHENTICATION
1302 #define BRLAPI_ERROR_READONLY_PARAMETER BRLAPI_ERROR_READONLY_PARAMETER
1303 };
1304 
1305 /* brlapi_errlist */
1310 extern const char *brlapi_errlist[];
1311 
1312 /* brlapi_nerr */
1314 extern const int brlapi_nerr;
1315 
1316 /* brlapi_perror */
1321 void BRLAPI_STDCALL brlapi_perror(const char *s);
1322 
1323 /* brlapi_error_t */
1325 typedef struct {
1326  enum brlapi_error brlerrno;
1329  const char *errfun;
1330 } brlapi_error_t;
1331 
1341 
1351 
1353 extern enum brlapi_error brlapi_errno;
1355 extern int brlapi_libcerrno;
1357 extern int brlapi_gaierrno;
1359 extern const char *brlapi_errfun;
1360 
1362 #define brlapi_error (*brlapi_error_location())
1364 #define brlapi_errno (brlapi_error.brlerrno)
1366 #define brlapi_libcerrno (brlapi_error.libcerrno)
1368 #define brlapi_gaierrno (brlapi_error.gaierrno)
1370 #define brlapi_errfun (brlapi_error.errfun)
1371 
1372 /* brlapi_strerror */
1380 const char * BRLAPI_STDCALL brlapi_strerror(const brlapi_error_t *error);
1381 
1382 /* brlapi_strerror_r */
1399 size_t BRLAPI_STDCALL brlapi_strerror_r(const brlapi_error_t *error, char *buf, size_t buflen);
1400 
1402 typedef uint32_t brlapi_packetType_t;
1403 
1404 /* brlapi_getPacketTypeName */
1411 
1412 /* brlapi_exceptionHandler_t */
1423 #ifndef BRLAPI_NO_SINGLE_SESSION
1424 typedef void (BRLAPI_STDCALL *brlapi_exceptionHandler_t)(int error, brlapi_packetType_t type, const void *packet, size_t size);
1425 #endif /* BRLAPI_NO_SINGLE_SESSION */
1426 typedef void (BRLAPI_STDCALL *brlapi__exceptionHandler_t)(brlapi_handle_t *handle, int error, brlapi_packetType_t type, const void *packet, size_t size);
1427 
1428 /* brlapi_strexception */
1438 #ifndef BRLAPI_NO_SINGLE_SESSION
1439 int BRLAPI_STDCALL brlapi_strexception(char *buffer, size_t bufferSize, int error, brlapi_packetType_t type, const void *packet, size_t packetSize);
1440 #endif /* BRLAPI_NO_SINGLE_SESSION */
1441 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);
1442 
1443 /* brlapi_setExceptionHandler */
1452 #ifndef BRLAPI_NO_SINGLE_SESSION
1454 #endif /* BRLAPI_NO_SINGLE_SESSION */
1456 
1457 #ifndef BRLAPI_NO_SINGLE_SESSION
1458 void BRLAPI_STDCALL brlapi_defaultExceptionHandler(int error, brlapi_packetType_t type, const void *packet, size_t size);
1459 #endif /* BRLAPI_NO_SINGLE_SESSION */
1460 void BRLAPI_STDCALL brlapi__defaultExceptionHandler(brlapi_handle_t *handle, int error, brlapi_packetType_t type, const void *packet, size_t size);
1461 
1464 /* Windows-specific tricks - don't look at this */
1465 #ifdef BRLAPI_WIN32
1466 #ifndef BRLAPI_NO_SINGLE_SESSION
1467 int BRLAPI_STDCALL brlapi_writeTextWin(int cursor, const void *str, int wide);
1468 #endif /* BRLAPI_NO_SINGLE_SESSION */
1469 int BRLAPI_STDCALL brlapi__writeTextWin(brlapi_handle_t *handle, int cursor, const void *str, int wide);
1470 
1471 #ifndef BRLAPI_NO_SINGLE_SESSION
1472 int BRLAPI_STDCALL brlapi_writeWin(const brlapi_writeArguments_t *s, int wide);
1473 #endif /* BRLAPI_NO_SINGLE_SESSION */
1474 int BRLAPI_STDCALL brlapi__writeWin(brlapi_handle_t *handle, const brlapi_writeArguments_t *s, int wide);
1475 
1476 #ifdef UNICODE
1477 #ifndef BRLAPI_NO_SINGLE_SESSION
1478 #define brlapi_writeText(cursor, str) brlapi_writeTextWin(cursor, str, 1)
1479 #endif /* BRLAPI_NO_SINGLE_SESSION */
1480 #define brlapi__writeText(handle, cursor, str) brlapi__writeTextWin(handle, cursor, str, 1)
1481 
1482 #ifndef BRLAPI_NO_SINGLE_SESSION
1483 #define brlapi_write(s) brlapi_writeWin(s, 1)
1484 #endif /* BRLAPI_NO_SINGLE_SESSION */
1485 #define brlapi__write(handle, s) brlapi__writeWin(handle, s, 1)
1486 
1487 #else /* UNICODE */
1488 
1489 #ifndef BRLAPI_NO_SINGLE_SESSION
1490 #define brlapi_writeText(cursor, str) brlapi_writeTextWin(cursor, str, 0)
1491 #endif /* BRLAPI_NO_SINGLE_SESSION */
1492 #define brlapi__writeText(handle, cursor, str) brlapi__writeTextWin(handle, cursor, str, 0)
1493 
1494 #ifndef BRLAPI_NO_SINGLE_SESSION
1495 #define brlapi_write(s) brlapi_writeWin(s, 0)
1496 #endif /* BRLAPI_NO_SINGLE_SESSION */
1497 #define brlapi__write(handle, s) brlapi__writeWin(handle, s, 0)
1498 
1499 #endif /* UNICODE */
1500 #endif /* BRLAPI_WIN32 */
1501 
1502 #ifndef BRLAPI_NO_DEPRECATED
1515 #define brlapi_settings_t brlapi_connectionSettings_t
1516 
1518 typedef struct {
1520  unsigned int regionBegin;
1521  unsigned int regionSize;
1522  const char *text;
1524  const unsigned char *attrAnd;
1525  const unsigned char *attrOr;
1526  int cursor;
1527  const char *charset;
1529 #define BRLAPI_WRITESTRUCT_INITIALIZER BRLAPI_WRITEARGUMENTS_INITIALIZER
1530 
1531 #define brl_keycode_t brlapi_keyCode_t
1532 #define brl_type_t brlapi_packetType_t
1533 
1534 #define BRLCOMMANDS NULL
1535 #define BRL_KEYCODE_MAX BRLAPI_KEY_MAX
1536 
1537 #ifndef BRLAPI_NO_SINGLE_SESSION
1538 #define brlapi_initializeConnection brlapi_openConnection
1539 #define brlapi_getTty brlapi_enterTtyMode
1540 #define brlapi_getTtyPath brlapi_enterTtyModeWithPath
1541 #define brlapi_leaveTty brlapi_leaveTtyMode
1542 #define brlapi_unignoreKeyRange brlapi_acceptKeyRange
1543 #define brlapi_unignoreKeySet brlapi_acceptKeySet
1544 #define brlapi_getRaw brlapi_enterRawMode
1545 #define brlapi_leaveRaw brlapi_leaveRawMode
1546 #define brlapi_suspend brlapi_suspendDriver
1547 #define brlapi_resume brlapi_resumeDriver
1548 #endif /* BRLAPI_NO_SINGLE_SESSION */
1549 
1550 #define BRLERR_SUCCESS BRLAPI_ERROR_SUCCESS
1551 #define BRLERR_NOMEM BRLAPI_ERROR_NOMEM
1552 #define BRLERR_TTYBUSY BRLAPI_ERROR_TTYBUSY
1553 #define BRLERR_DEVICEBUSY BRLAPI_ERROR_DEVICEBUSY
1554 #define BRLERR_UNKNOWN_INSTRUCTION BRLAPI_ERROR_UNKNOWN_INSTRUCTION
1555 #define BRLERR_ILLEGAL_INSTRUCTION BRLAPI_ERROR_ILLEGAL_INSTRUCTION
1556 #define BRLERR_INVALID_PARAMETER BRLAPI_ERROR_INVALID_PARAMETER
1557 #define BRLERR_INVALID_PACKET BRLAPI_ERROR_INVALID_PACKET
1558 #define BRLERR_CONNREFUSED BRLAPI_ERROR_CONNREFUSED
1559 #define BRLERR_OPNOTSUPP BRLAPI_ERROR_OPNOTSUPP
1560 #define BRLERR_GAIERR BRLAPI_ERROR_GAIERR
1561 #define BRLERR_LIBCERR BRLAPI_ERROR_LIBCERR
1562 #define BRLERR_UNKNOWNTTY BRLAPI_ERROR_UNKNOWNTTY
1563 #define BRLERR_PROTOCOL_VERSION BRLAPI_ERROR_PROTOCOL_VERSION
1564 #define BRLERR_EOF BRLAPI_ERROR_EOF
1565 #define BRLERR_EMPTYKEY BRLAPI_ERROR_EMPTYKEY
1566 #define BRLERR_DRIVERERROR BRLAPI_ERROR_DRIVERERROR
1567 
1569 #endif /* BRLAPI_NO_DEPRECATED */
1570 
1571 #ifdef __cplusplus
1572 }
1573 #endif /* __cplusplus */
1574 
1575 #endif /* BRLAPI_INCLUDED */
#define BRLAPI_ERROR_INVALID_PARAMETER
Definition: brlapi.h:1278
#define BRLAPI_ERROR_DEVICEBUSY
Definition: brlapi.h:1272
#define BRLAPI_ERROR_TTYBUSY
Definition: brlapi.h:1270
#define BRLAPI_ERROR_UNKNOWNTTY
Definition: brlapi.h:1290
#define BRLAPI_ERROR_DRIVERERROR
Definition: brlapi.h:1298
#define BRLAPI_ERROR_AUTHENTICATION
Definition: brlapi.h:1300
#define BRLAPI_ERROR_LIBCERR
Definition: brlapi.h:1288
#define BRLAPI_ERROR_GAIERR
Definition: brlapi.h:1286
#define BRLAPI_ERROR_OPNOTSUPP
Definition: brlapi.h:1284
#define BRLAPI_ERROR_ILLEGAL_INSTRUCTION
Definition: brlapi.h:1276
#define BRLAPI_ERROR_EMPTYKEY
Definition: brlapi.h:1296
#define BRLAPI_ERROR_SUCCESS
Definition: brlapi.h:1266
#define BRLAPI_STDCALL
Definition: brlapi.h:61
#define BRLAPI_ERROR_INVALID_PACKET
Definition: brlapi.h:1280
#define BRLAPI_ERROR_READONLY_PARAMETER
Definition: brlapi.h:1302
#define BRLAPI_ERROR_NOMEM
Definition: brlapi.h:1268
#define BRLAPI_ERROR_EOF
Definition: brlapi.h:1294
#define BRLAPI_ERROR_CONNREFUSED
Definition: brlapi.h:1282
#define BRLAPI_ERROR_PROTOCOL_VERSION
Definition: brlapi.h:1292
#define BRLAPI_ERROR_UNKNOWN_INSTRUCTION
Definition: brlapi.h:1274
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:1424
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:1364
const char * brlapi_errlist[]
const int brlapi_nerr
#define brlapi_errfun
Definition: brlapi.h:1370
#define brlapi_error
Definition: brlapi.h:1362
void BRLAPI_STDCALL brlapi_perror(const char *s)
brlapi_error
Definition: brlapi.h:1264
#define brlapi_gaierrno
Definition: brlapi.h:1368
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:1366
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:1402
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:1426
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:850
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:905
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:923
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:902
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:920
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:851
@ brlapi_rangeType_key
Definition: brlapi.h:854
@ brlapi_rangeType_command
Definition: brlapi.h:853
@ brlapi_rangeType_type
Definition: brlapi.h:852
@ brlapi_rangeType_code
Definition: brlapi.h:855
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:1164
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:1082
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:1157
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:727
Definition: brlapi.h:1325
int gaierrno
Definition: brlapi.h:1328
const char * errfun
Definition: brlapi.h:1329
int libcerrno
Definition: brlapi.h:1327
Definition: brlapi.h:708
Definition: brlapi.h:929
brlapi_keyCode_t first
Definition: brlapi.h:930
Definition: brlapi.h:596
Definition: brlapi.h:1518
int displayNumber
Definition: brlapi.h:1519
int cursor
Definition: brlapi.h:1526
unsigned int regionBegin
Definition: brlapi.h:1520
unsigned int regionSize
Definition: brlapi.h:1521
const char * text
Definition: brlapi.h:1522
const unsigned char * attrOr
Definition: brlapi.h:1525
const char * charset
Definition: brlapi.h:1527
const unsigned char * attrAnd
Definition: brlapi.h:1524
int textSize
Definition: brlapi.h:1523