25 #ifndef BRLAPI_INCLUDED
26 #define BRLAPI_INCLUDED
38 #define BRLAPI_RELEASE "0.6.0"
41 #define BRLAPI_MAJOR 0
44 #define BRLAPI_MINOR 6
47 #define BRLAPI_REVISION 0
52 #include <sys/types.h>
56 #define BRLAPI_STDCALL __stdcall
58 #define BRLAPI_STDCALL
62 typedef __int64 uint64_t;
63 typedef __int32 uint32_t;
64 #define UINT64_C(x) (x ## Ui64)
66 typedef signed int ssize_t;
120 #define BRLAPI_SOCKETPORTNUM 4101
121 #define BRLAPI_SOCKETPORT "4101"
124 #define BRLAPI_SOCKETPATH "/var/lib/BrlAPI"
130 #define BRLAPI_ETCDIR "/etc"
135 #define BRLAPI_AUTHKEYFILE "brlapi.key"
138 #define BRLAPI_DEFAUTH BRLAPI_ETCDIR "/" BRLAPI_AUTHKEYFILE
200 #define BRLAPI_SETTINGS_INITIALIZER { NULL, NULL }
247 #ifndef BRLAPI_NO_SINGLE_SESSION
259 #ifndef BRLAPI_NO_SINGLE_SESSION
279 #define BRLAPI_MAXNAMELENGTH 31
293 #ifndef BRLAPI_NO_SINGLE_SESSION
300 #ifndef BRLAPI_NO_SINGLE_SESSION
348 #ifndef BRLAPI_NO_SINGLE_SESSION
362 #define BRLAPI_TTY_DEFAULT -1
376 #ifndef BRLAPI_NO_SINGLE_SESSION
388 #ifndef BRLAPI_NO_SINGLE_SESSION
404 #ifndef BRLAPI_NO_SINGLE_SESSION
453 #ifndef BRLAPI_NO_SINGLE_SESSION
471 #ifndef BRLAPI_NO_SINGLE_SESSION
484 #ifndef BRLAPI_NO_SINGLE_SESSION
493 unsigned int regionBegin ;
494 unsigned int regionSize ;
497 unsigned char *andMask ;
498 unsigned char *orMask ;
507 #define BRLAPI_DISPLAY_DEFAULT -1
513 #define BRLAPI_CURSOR_LEAVE -1
519 #define BRLAPI_CURSOR_OFF 0
531 #define BRLAPI_WRITEARGUMENTS_INITIALIZER { BRLAPI_DISPLAY_DEFAULT, 0, 0, NULL, -1, NULL, NULL, BRLAPI_CURSOR_LEAVE, NULL }
569 #ifndef BRLAPI_NO_SINGLE_SESSION
595 unsigned int command ;
596 unsigned int argument ;
614 const char *command ;
615 unsigned int argument ;
632 #define BRLAPI_UC_ROW 0x2800UL
701 #ifndef BRLAPI_NO_SINGLE_SESSION
728 #ifndef BRLAPI_NO_SINGLE_SESSION
746 #ifndef BRLAPI_NO_SINGLE_SESSION
757 #ifndef BRLAPI_NO_SINGLE_SESSION
759 #define brlapi_ignoreAllKeys() brlapi_ignoreKeys(brlapi_rangeType_all, NULL, 0)
762 #define brlapi__ignoreAllKeys(handle) brlapi__ignoreKeys(handle, brlapi_rangeType_all, NULL, 0)
773 #ifndef BRLAPI_NO_SINGLE_SESSION
775 #define brlapi_acceptAllKeys() brlapi_acceptKeys(brlapi_rangeType_all, NULL, 0)
778 #define brlapi__acceptAllKeys(handle) brlapi__acceptKeys(handle, brlapi_rangeType_all, NULL, 0)
800 #ifndef BRLAPI_NO_SINGLE_SESSION
816 #ifndef BRLAPI_NO_SINGLE_SESSION
850 #ifndef BRLAPI_NO_SINGLE_SESSION
858 #ifndef BRLAPI_NO_SINGLE_SESSION
869 #ifndef BRLAPI_NO_SINGLE_SESSION
881 #ifndef BRLAPI_NO_SINGLE_SESSION
891 #ifndef BRLAPI_NO_SINGLE_SESSION
900 #ifndef BRLAPI_NO_SINGLE_SESSION
928 #define BRLAPI_ERROR_SUCCESS 0
929 #define BRLAPI_ERROR_NOMEM 1
930 #define BRLAPI_ERROR_TTYBUSY 2
931 #define BRLAPI_ERROR_DEVICEBUSY 3
932 #define BRLAPI_ERROR_UNKNOWN_INSTRUCTION 4
933 #define BRLAPI_ERROR_ILLEGAL_INSTRUCTION 5
934 #define BRLAPI_ERROR_INVALID_PARAMETER 6
935 #define BRLAPI_ERROR_INVALID_PACKET 7
936 #define BRLAPI_ERROR_CONNREFUSED 8
937 #define BRLAPI_ERROR_OPNOTSUPP 9
938 #define BRLAPI_ERROR_GAIERR 10
939 #define BRLAPI_ERROR_LIBCERR 11
940 #define BRLAPI_ERROR_UNKNOWNTTY 12
941 #define BRLAPI_ERROR_PROTOCOL_VERSION 13
942 #define BRLAPI_ERROR_EOF 14
943 #define BRLAPI_ERROR_EMPTYKEY 15
944 #define BRLAPI_ERROR_DRIVERERROR 16
945 #define BRLAPI_ERROR_AUTHENTICATION 17
1004 #define brlapi_error (*brlapi_error_location())
1006 #define brlapi_errno (brlapi_error.brlerrno)
1008 #define brlapi_libcerrno (brlapi_error.libcerrno)
1010 #define brlapi_gaierrno (brlapi_error.gaierrno)
1012 #define brlapi_errfun (brlapi_error.errfun)
1045 #ifndef BRLAPI_NO_SINGLE_SESSION
1060 #ifndef BRLAPI_NO_SINGLE_SESSION
1074 #ifndef BRLAPI_NO_SINGLE_SESSION
1079 #ifndef BRLAPI_NO_SINGLE_SESSION
1088 #ifndef BRLAPI_NO_SINGLE_SESSION
1089 int BRLAPI_STDCALL brlapi_writeTextWin(
int cursor,
const void *str,
int wide);
1093 #ifndef BRLAPI_NO_SINGLE_SESSION
1099 #ifndef BRLAPI_NO_SINGLE_SESSION
1100 #define brlapi_writeText(cursor, str) brlapi_writeTextWin(cursor, str, 1)
1102 #define brlapi__writeText(handle, cursor, str) brlapi__writeTextWin(handle, cursor, str, 1)
1104 #ifndef BRLAPI_NO_SINGLE_SESSION
1105 #define brlapi_write(s) brlapi_writeWin(s, 1)
1107 #define brlapi__write(handle, s) brlapi__writeWin(handle, s, 1)
1111 #ifndef BRLAPI_NO_SINGLE_SESSION
1112 #define brlapi_writeText(cursor, str) brlapi_writeTextWin(cursor, str, 0)
1114 #define brlapi__writeText(handle, cursor, str) brlapi__writeTextWin(handle, cursor, str, 0)
1116 #ifndef BRLAPI_NO_SINGLE_SESSION
1117 #define brlapi_write(s) brlapi_writeWin(s, 0)
1119 #define brlapi__write(handle, s) brlapi__writeWin(handle, s, 0)
1124 #ifndef BRLAPI_NO_DEPRECATED
1137 #define brlapi_settings_t brlapi_connectionSettings_t
1151 #define BRLAPI_WRITESTRUCT_INITIALIZER BRLAPI_WRITEARGUMENTS_INITIALIZER
1153 #define brl_keycode_t brlapi_keyCode_t
1154 #define brl_type_t brlapi_packetType_t
1156 #define BRLCOMMANDS NULL
1157 #define BRL_KEYCODE_MAX BRLAPI_KEY_MAX
1159 #ifndef BRLAPI_NO_SINGLE_SESSION
1160 #define brlapi_initializeConnection brlapi_openConnection
1161 #define brlapi_getTty brlapi_enterTtyMode
1162 #define brlapi_getTtyPath brlapi_enterTtyModeWithPath
1163 #define brlapi_leaveTty brlapi_leaveTtyMode
1164 #define brlapi_unignoreKeyRange brlapi_acceptKeyRange
1165 #define brlapi_unignoreKeySet brlapi_acceptKeySet
1166 #define brlapi_getRaw brlapi_enterRawMode
1167 #define brlapi_leaveRaw brlapi_leaveRawMode
1168 #define brlapi_suspend brlapi_suspendDriver
1169 #define brlapi_resume brlapi_resumeDriver
1172 #define BRLERR_SUCCESS BRLAPI_ERROR_SUCCESS
1173 #define BRLERR_NOMEM BRLAPI_ERROR_NOMEM
1174 #define BRLERR_TTYBUSY BRLAPI_ERROR_TTYBUSY
1175 #define BRLERR_DEVICEBUSY BRLAPI_ERROR_DEVICEBUSY
1176 #define BRLERR_UNKNOWN_INSTRUCTION BRLAPI_ERROR_UNKNOWN_INSTRUCTION
1177 #define BRLERR_ILLEGAL_INSTRUCTION BRLAPI_ERROR_ILLEGAL_INSTRUCTION
1178 #define BRLERR_INVALID_PARAMETER BRLAPI_ERROR_INVALID_PARAMETER
1179 #define BRLERR_INVALID_PACKET BRLAPI_ERROR_INVALID_PACKET
1180 #define BRLERR_CONNREFUSED BRLAPI_ERROR_CONNREFUSED
1181 #define BRLERR_OPNOTSUPP BRLAPI_ERROR_OPNOTSUPP
1182 #define BRLERR_GAIERR BRLAPI_ERROR_GAIERR
1183 #define BRLERR_LIBCERR BRLAPI_ERROR_LIBCERR
1184 #define BRLERR_UNKNOWNTTY BRLAPI_ERROR_UNKNOWNTTY
1185 #define BRLERR_PROTOCOL_VERSION BRLAPI_ERROR_PROTOCOL_VERSION
1186 #define BRLERR_EOF BRLAPI_ERROR_EOF
1187 #define BRLERR_EMPTYKEY BRLAPI_ERROR_EMPTYKEY
1188 #define BRLERR_DRIVERERROR BRLAPI_ERROR_DRIVERERROR