source: xplra/src/client/c/hu/varadiistvan/xplra/xplra.h@ 58:f0fa93354e15

Last change on this file since 58:f0fa93354e15 was 58:f0fa93354e15, checked in by István Váradi <ivaradi@…>, 11 years ago

Added the safe unregistration support to the C client interface

File size: 26.2 KB
Line 
1/* Copyright (c) 2013 by István Váradi
2 *
3 * This file is part of XPLRA, a remote-access plugin for X-Plane
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright notice, this
9 * list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice,
11 * this list of conditions and the following disclaimer in the documentation
12 * and/or other materials provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 *
25 * The views and conclusions contained in the software and documentation are those
26 * of the authors and should not be interpreted as representing official policies,
27 * either expressed or implied, of the FreeBSD Project.
28 */
29
30#ifndef HU_VARADIISTVAN_XPLRA_XPLRA_H
31#define HU_VARADIISTVAN_XPLRA_XPLRA_H
32/*----------------------------------------------------------------------------*/
33
34#include <stdlib.h>
35#include <inttypes.h>
36
37/*----------------------------------------------------------------------------*/
38
39#ifdef __cplusplus
40extern "C" {
41#endif
42
43/*----------------------------------------------------------------------------*/
44
45/** No error occured */
46#define ERROR_NONE 0
47
48/**
49 * An I/O error has occured. The subcode is the errno value on Linux, or the
50 * Windows error code.
51 */
52#define ERROR_IO 1
53
54/**
55 * A protocol error has occured. The subcode is one of the
56 * ERROR_PROTOCOL_XXX values.
57 */
58#define ERROR_PROTOCOL 2
59
60/** Invalid command was passed to the plugin */
61#define ERROR_PROTOCOL_INVALID_COMMAND = 1
62
63/** An unknown dataref was specified */
64#define ERROR_PROTOCOL_UNKNOWN_DATAREF = 2
65
66/** An invalid type was specified */
67#define ERROR_PROTOCOL_INVALID_TYPE = 3
68
69/** An invalid length was specified */
70#define ERROR_PROTOCOL_INVALID_LENGTH = 4
71
72/** An invalid offset was specified */
73#define ERROR_PROTOCOL_INVALID_OFFSET = 5
74
75/** An invalid count was specified */
76#define ERROR_PROTOCOL_INVALID_COUNT = 6
77
78/** An invalid ID was specified */
79#define ERROR_PROTOCOL_INVALID_ID = 7
80
81/** An invalid duration was specified */
82#define ERROR_PROTOCOL_INVALID_DURATION = 8
83
84/** Other protocol error */
85#define ERROR_PROTOCOL_OTHER = 255
86
87/** A function requiring a connection is called without a connection */
88#define ERROR_NOT_CONNECTED 3
89
90/** A type-specific function was called for a dataref of a different type */
91#define ERROR_TYPE_MISMATCH 4
92
93/** An invalid ID was passed to a function */
94#define ERROR_INVALID_ID 5
95
96/** Some other error */
97#define ERROR_OTHER 255
98
99/*----------------------------------------------------------------------------*/
100
101/** Hotkey modifier: Shift */
102#define HOTKEY_MODIFIER_SHIFT 0x01
103
104/** Hotkey modifier: Control */
105#define HOTKEY_MODIFIER_CONTROL 0x02
106
107/*----------------------------------------------------------------------------*/
108
109#define INVALID_DATAREF_ID ((size_t)-1)
110
111/*----------------------------------------------------------------------------*/
112
113/**
114 * Get the last error code with the subcode.
115 *
116 * @return the last error code, or -1 if the given connection ID is invalid.
117 */
118int xplra_get_last_error(int connectionID, unsigned long* subCode);
119
120/**
121 * Get a string representation of the last error.
122 *
123 * @return the string representation of the last error, or 0 if there
124 * was no last error, or the connection ID is invalid.
125 */
126const char* xplra_get_last_error_string(int connectionID);
127
128/**
129 * Clear the last error.
130 */
131void xplra_clear_last_error(int connectionID);
132
133/*----------------------------------------------------------------------------*/
134
135/**
136 * Connect to the simulator.
137 *
138 * @return an ID for the created connection, or -1 on error.
139 */
140int xplra_connect();
141
142/*----------------------------------------------------------------------------*/
143
144/**
145 * Get the versions of X-Plane, the XPLM library and XPLRA
146 */
147int xplra_get_versions(int connectionID,
148 int* xplaneVersion, int* xplmVersion,
149 int* xplraVersion);
150
151/*----------------------------------------------------------------------------*/
152
153/**
154 * Reload the plugins in X-Plane. After this the connection fails.
155 */
156int xplra_reload_plugins(int connectionID);
157
158/*----------------------------------------------------------------------------*/
159/* Single dataref support */
160/*----------------------------------------------------------------------------*/
161
162/**
163 * Get an integer value from the simulator.
164 *
165 * @return 0 on success, -1 on error
166 */
167int xplra_get_int(int* value, int connectionID, const char* name);
168
169/*----------------------------------------------------------------------------*/
170
171/**
172 * Get a float value from the simulator.
173 *
174 * @return 0 on success, -1 on error
175 */
176int xplra_get_float(float* value, int connectionID, const char* name);
177
178/*----------------------------------------------------------------------------*/
179
180/**
181 * Get a double value from the simulator.
182 *
183 * @return 0 on success, -1 on error
184 */
185int xplra_get_double(double* value, int connectionID, const char* name);
186
187/*----------------------------------------------------------------------------*/
188
189/**
190 * Get an array of floats into a buffer.
191 *
192 * @param dest the array into which to get the data
193 * @param length the length of the destination buffer
194 * @param offset the offset from which to query the array
195 *
196 * @return the actual number of elements returned in case of success,
197 * -1 on error
198 */
199ssize_t xplra_get_float_array(float* dest, size_t length, size_t offset,
200 int connectionID, const char* name);
201
202/*----------------------------------------------------------------------------*/
203
204/**
205 * Get an array of floats into a newly allocated buffer.
206 *
207 * @param length pointer to a variable containing the length to
208 * query. On return it will be set to the actual length, which can be
209 * less than or equal to the input value.
210 * @param offset the offset from which to query the array
211 *
212 * @return the new array on success, 0 on error
213 */
214float* xplra_get_float_array_new(size_t* length, size_t offset,
215 int connectionID, const char* name);
216
217/*----------------------------------------------------------------------------*/
218
219/**
220 * Get an array of integers into a buffer.
221 *
222 * @param dest the array into which to get the data
223 * @param length the length of the destination buffer
224 * @param offset the offset from which to query the array
225 *
226 * @return the actual number of elements returned in case of success,
227 * -1 on error
228 */
229ssize_t xplra_get_int_array(int32_t* dest, size_t length, size_t offset,
230 int connectionID, const char* name);
231
232/*----------------------------------------------------------------------------*/
233
234/**
235 * Get an array of integers into a newly allocated buffer.
236 *
237 * @param length pointer to a variable containing the length to
238 * query. On return it will be set to the actual length, which can be
239 * less than or equal to the input value.
240 * @param offset the offset from which to query the array
241 *
242 * @return the new array on success, 0 on error
243 */
244int32_t* xplra_get_int_array_new(size_t* length, size_t offset,
245 int connectionID, const char* name);
246
247/*----------------------------------------------------------------------------*/
248
249/**
250 * Get an array of bytes into a buffer.
251 *
252 * @param dest the array into which to get the data
253 * @param length the length of the destination buffer
254 * @param offset the offset from which to query the array
255 *
256 * @return the actual number of elements returned in case of success,
257 * -1 on error
258 */
259ssize_t xplra_get_byte_array(void* dest, size_t length, size_t offset,
260 int connectionID, const char* name);
261
262/*----------------------------------------------------------------------------*/
263
264/**
265 * Get an array of bytes into a newly allocated buffer.
266 *
267 * @param length pointer to a variable containing the length to
268 * query. On return it will be set to the actual length, which can be
269 * less than or equal to the input value.
270 * @param offset the offset from which to query the array
271 *
272 * @return the new array on success, 0 on error
273 */
274uint8_t* xplra_get_byte_array_new(size_t* length, size_t offset,
275 int connectionID, const char* name);
276
277/*----------------------------------------------------------------------------*/
278
279/**
280 * Set the integer dataref with the given name to the given value.
281 *
282 * @return 0 on success, -1 on error.
283 */
284int xplra_set_int(int connectionID, const char* name, int value);
285
286/*----------------------------------------------------------------------------*/
287
288/**
289 * Set the float dataref with the given name to the given value.
290 *
291 * @return 0 on success, -1 on error.
292 */
293int xplra_set_float(int connectionID, const char* name, float value);
294
295/*----------------------------------------------------------------------------*/
296
297/**
298 * Set the double dataref with the given name to the given value.
299 *
300 * @return 0 on success, -1 on error.
301 */
302int xplra_set_double(int connectionID, const char* name, double value);
303
304/*----------------------------------------------------------------------------*/
305
306/**
307 * Set the array of float values with the given name from the given
308 * buffer.
309 *
310 * @return 0 on success, -1 on error.
311 */
312int xplra_set_float_array(int connectionID, const char* name,
313 const float* values, size_t length, size_t offset);
314
315/*----------------------------------------------------------------------------*/
316
317/**
318 * Set the array of integer values with the given name from the given
319 * buffer.
320 *
321 * @return 0 on success, -1 on error.
322 */
323int xplra_set_int_array(int connectionID, const char* name,
324 const int32_t* values, size_t length, size_t offset);
325
326/*----------------------------------------------------------------------------*/
327
328/**
329 * Set the array of byte values with the given name from the given
330 * buffer.
331 *
332 * @return 0 on success, -1 on error.
333 */
334int xplra_set_byte_array(int connectionID, const char* name,
335 const void* values, size_t length, size_t offset);
336
337/*----------------------------------------------------------------------------*/
338
339/**
340 * Set the array of byte values with the given name from the given
341 * string. The string will be padded with 0 if it has a length less
342 * than the given length.
343 *
344 * @return 0 on success, -1 on error.
345 */
346int xplra_set_string(int connectionID, const char* name,
347 const char* value, size_t length, size_t offset);
348
349/*----------------------------------------------------------------------------*/
350/* Multi-dataref support */
351/*----------------------------------------------------------------------------*/
352
353/**
354 * Create a multi-dataref getter for the given connection.
355 *
356 * @return the ID of the new getter, or -1 on error
357 */
358int xplra_multi_create_getter(int connectionID);
359
360/*----------------------------------------------------------------------------*/
361
362/**
363 * Create a multi-dataref setter for the given connection.
364 *
365 * @return the ID of the new setter, or -1 on error
366 */
367int xplra_multi_create_setter(int connectionID);
368
369/*----------------------------------------------------------------------------*/
370
371/**
372 * Add an integer dataref to a multi-dataref buffer.
373 *
374 * @return the ID of the dataref that can be used later. If the buffer
375 * ID is invalid, INVALID_DATAREF_ID is returned.
376 */
377size_t xplra_multi_add_int(int bufferID, const char* name);
378
379/*----------------------------------------------------------------------------*/
380
381/**
382 * Add a float dataref to a multi-dataref buffer.
383 *
384 * @return the ID of the dataref that can be used later. If the buffer
385 * ID is invalid, INVALID_DATAREF_ID is returned.
386 */
387size_t xplra_multi_add_float(int bufferID, const char* name);
388
389/*----------------------------------------------------------------------------*/
390
391/**
392 * Add a double dataref to a multi-dataref buffer.
393 *
394 * @return the ID of the dataref that can be used later. If the buffer
395 * ID is invalid, INVALID_DATAREF_ID is returned.
396 */
397size_t xplra_multi_add_double(int bufferID, const char* name);
398
399/*----------------------------------------------------------------------------*/
400
401/**
402 * Add a float array dataref to a multi-dataref buffer.
403 *
404 * @return the ID of the dataref that can be used later. If the buffer
405 * ID is invalid, INVALID_DATAREF_ID is returned.
406 */
407size_t xplra_multi_add_float_array(int bufferID, const char* name,
408 size_t length, size_t offset);
409
410/*----------------------------------------------------------------------------*/
411
412/**
413 * Add an integer array dataref to a multi-dataref buffer.
414 *
415 * @return the ID of the dataref that can be used later. If the buffer
416 * ID is invalid, INVALID_DATAREF_ID is returned.
417 */
418size_t xplra_multi_add_int_array(int bufferID, const char* name,
419 size_t length, size_t offset);
420
421/*----------------------------------------------------------------------------*/
422
423/**
424 * Add a byte array dataref to a multi-dataref buffer.
425 *
426 * @return the ID of the dataref that can be used later. If the buffer
427 * ID is invalid, INVALID_DATAREF_ID is returned.
428 */
429size_t xplra_multi_add_byte_array(int bufferID, const char* name,
430 size_t length, size_t offset);
431
432/*----------------------------------------------------------------------------*/
433
434/**
435 * Finalize the given buffer, if not finalized yet.
436 *
437 * @return -1 on error (if the buffer ID is invalid), 0 if there is no
438 * data in the buffer, 1 if there is data in it.
439 */
440int xplra_multi_finalize(int bufferID);
441
442/*----------------------------------------------------------------------------*/
443
444/**
445 * Register the buffer with the given ID in X-Plane. If needed, it
446 * will be finalized too.
447 *
448 * @return 0 on success, -1 on error
449 */
450int xplra_multi_register(int bufferID);
451
452/*----------------------------------------------------------------------------*/
453
454/**
455 * Unregister the buffer with the given ID from X-Plane.
456 *
457 * @return 0 on success, -1 on error
458 */
459int xplra_multi_unregister(int bufferID);
460
461/*----------------------------------------------------------------------------*/
462
463/**
464 * Unregister the buffer with the given ID from X-Plane safely,
465 * i.e. the registration ID will be cleared anyway to support re-registration.
466 *
467 * @return -1 if the buffer ID is invalid, 0 if the unregistration
468 * call failed, 1 if it was successful.
469 */
470int xplra_multi_unregister_safely(int bufferID);
471
472/*----------------------------------------------------------------------------*/
473
474/**
475 * Execute the buffer with the given ID. If the buffer is not
476 * finalized, it will be finalized. If it is not finalized, but
477 * registered, the registration will be cleared, and it will be
478 * re-registered after finalizing.
479 *
480 * @return 0 on success, -1 on error
481 */
482int xplra_multi_execute(int bufferID);
483
484/*----------------------------------------------------------------------------*/
485
486/**
487 * Set the value of an integer dataref with the given ID.
488 *
489 * @return 0 on success, -1 on error.
490 */
491int xplra_multi_set_int(int bufferID, size_t datarefID, int value);
492
493/*----------------------------------------------------------------------------*/
494
495/**
496 * Get the value of an integer dataref with the given ID.
497 *
498 * @param dest pointer to the variable that will receive the value
499 *
500 * @return 0 on success, -1 on error.
501 */
502int xplra_multi_get_int(int* dest, int bufferID, size_t datarefID);
503
504/*----------------------------------------------------------------------------*/
505
506/**
507 * Get a const pointer to the integer dataref with the given ID
508 *
509 * @return the pointer or success, 0 on error.
510 */
511const int32_t* xplra_multi_get_int_const_ptr(int bufferID, size_t datarefID);
512
513/*----------------------------------------------------------------------------*/
514
515/**
516 * Get a pointer to the integer dataref with the given ID
517 *
518 * @return the pointer or success, 0 on error.
519 */
520int32_t* xplra_multi_get_int_ptr(int bufferID, size_t datarefID);
521
522/*----------------------------------------------------------------------------*/
523
524/**
525 * Set the value of a float dataref with the given ID.
526 *
527 * @return 0 on success, -1 on error.
528 */
529int xplra_multi_set_float(int bufferID, size_t datarefID, float value);
530
531/*----------------------------------------------------------------------------*/
532
533/**
534 * Get the value of a float dataref with the given ID.
535 *
536 * @param dest pointer to the variable that will receive the value
537 *
538 * @return 0 on success, -1 on error.
539 */
540int xplra_multi_get_float(float* dest, int bufferID, size_t datarefID);
541
542/*----------------------------------------------------------------------------*/
543
544/**
545 * Get a const pointer to the float dataref with the given ID
546 *
547 * @return the pointer or success, 0 on error.
548 */
549const float* xplra_multi_get_float_const_ptr(int bufferID, size_t datarefID);
550
551/*----------------------------------------------------------------------------*/
552
553/**
554 * Get a pointer to the float dataref with the given ID
555 *
556 * @return the pointer or success, 0 on error.
557 */
558float* xplra_multi_get_float_ptr(int bufferID, size_t datarefID);
559
560/*----------------------------------------------------------------------------*/
561
562/**
563 * Set the value of a double dataref with the given ID.
564 *
565 * @return 0 on success, -1 on error.
566 */
567int xplra_multi_set_double(int bufferID, size_t datarefID, double value);
568
569/*----------------------------------------------------------------------------*/
570
571/**
572 * Get the value of a double dataref with the given ID.
573 *
574 * @param dest pointer to the variable that will receive the value
575 *
576 * @return 0 on success, -1 on error.
577 */
578int xplra_multi_get_double(double* dest, int bufferID, size_t datarefID);
579
580/*----------------------------------------------------------------------------*/
581
582/**
583 * Get a const pointer to the double dataref with the given ID
584 *
585 * @return the pointer or success, 0 on error.
586 */
587const double* xplra_multi_get_double_const_ptr(int bufferID, size_t datarefID);
588
589/*----------------------------------------------------------------------------*/
590
591/**
592 * Get a pointer to the double dataref with the given ID
593 *
594 * @return the pointer or success, 0 on error.
595 */
596double* xplra_multi_get_double_ptr(int bufferID, size_t datarefID);
597
598/*----------------------------------------------------------------------------*/
599
600/**
601 * Set the contents of the float array dataref with the given ID.
602 *
603 * @param length the amount of data. If 0, it is assumed to be the
604 * length of the data in the buffer minus the offset.
605 * @param offset the offset within the buffer to set the data from
606 *
607 * @return the number of data items set, or -1 on error.
608 */
609ssize_t xplra_multi_set_float_array(int bufferID, size_t datarefID,
610 const float* value, size_t length,
611 size_t offset);
612
613/*----------------------------------------------------------------------------*/
614
615/**
616 * Get the contents of the float array with the given ID.
617 *
618 * @param length the amount of data. If 0, it is assumed to be the
619 * length of the data in the buffer minus the offset.
620 * @param offset the offset within the buffer to get the data from
621 *
622 * @return the number of data items retrieved, or -1 on error.
623 */
624ssize_t xplra_multi_get_float_array(float* value,
625 size_t length, size_t offset,
626 int bufferID, size_t datarefID);
627
628/*----------------------------------------------------------------------------*/
629
630/**
631 * Get a pointer to the float array with the given ID.
632 *
633 * @param offset the offset within the buffer.
634 *
635 * @return the pointer on success, 0 on error.
636 */
637const float* xplra_multi_get_float_array_ptr(int bufferID, size_t datarefID,
638 size_t offset);
639
640/*----------------------------------------------------------------------------*/
641
642/**
643 * Set the contents of the integer array dataref with the given ID.
644 *
645 * @param length the amount of data. If 0, it is assumed to be the
646 * length of the data in the buffer minus the offset.
647 * @param offset the offset within the buffer to set the data from
648 *
649 * @return the number of data items set, or -1 on error.
650 */
651ssize_t xplra_multi_set_int_array(int bufferID, size_t datarefID,
652 const int32_t* value, size_t length,
653 size_t offset);
654
655/*----------------------------------------------------------------------------*/
656
657/**
658 * Get the contents of the integer array with the given ID.
659 *
660 * @param length the amount of data. If 0, it is assumed to be the
661 * length of the data in the buffer minus the offset.
662 * @param offset the offset within the buffer to get the data from
663 *
664 * @return the number of data items retrieved, or -1 on error.
665 */
666ssize_t xplra_multi_get_int_array(int32_t* value,
667 size_t length, size_t offset,
668 int bufferID, size_t datarefID);
669
670/*----------------------------------------------------------------------------*/
671
672/**
673 * Get a pointer to the integer array with the given ID.
674 *
675 * @param offset the offset within the buffer.
676 *
677 * @return the pointer on success, 0 on error.
678 */
679const int32_t* xplra_multi_get_int_array_ptr(int bufferID, size_t datarefID,
680 size_t offset);
681
682/*----------------------------------------------------------------------------*/
683
684/**
685 * Set the contents of the byte array dataref with the given ID.
686 *
687 * @param length the amount of data. If 0, it is assumed to be the
688 * length of the data in the buffer minus the offset.
689 * @param offset the offset within the buffer to set the data from
690 *
691 * @return the number of data items set, or -1 on error.
692 */
693ssize_t xplra_multi_set_byte_array(int bufferID, size_t datarefID,
694 const void* value, size_t length,
695 size_t offset);
696
697/*----------------------------------------------------------------------------*/
698
699/**
700 * Get the contents of the byte array with the given ID.
701 *
702 * @param length the amount of data. If 0, it is assumed to be the
703 * length of the data in the buffer minus the offset.
704 * @param offset the offset within the buffer to get the data from
705 *
706 * @return the number of data items retrieved, or -1 on error.
707 */
708ssize_t xplra_multi_get_byte_array(void* value,
709 size_t length, size_t offset,
710 int bufferID, size_t datarefID);
711
712/*----------------------------------------------------------------------------*/
713
714/**
715 * Get a pointer to the byte array with the given ID.
716 *
717 * @param offset the offset within the buffer.
718 *
719 * @return the pointer on success, 0 on error.
720 */
721const uint8_t* xplra_multi_get_byte_array_ptr(int bufferID, size_t datarefID,
722 size_t offset);
723
724/*----------------------------------------------------------------------------*/
725
726/**
727 * Set the value of the byte array with the given ID from the given
728 * string. If the string is shorter than the array, the rest will be
729 * filled with 0s.
730 *
731 * @return the number of bytes set, or -1 on error
732 */
733ssize_t xplra_multi_set_string(int bufferID, size_t datarefID,
734 const char* value, size_t offset);
735
736/*----------------------------------------------------------------------------*/
737
738/**
739 * Get a pointer as a string pointer to the byte array with the given
740 * ID.
741 *
742 * @return the pointer on success, 0 on error.
743 */
744const char* xplra_multi_get_string_ptr(int bufferID, size_t datarefID,
745 size_t offset);
746
747/*----------------------------------------------------------------------------*/
748
749/**
750 * Destroy a multi-dataref buffer for the given connection.
751 *
752 * @param connectionID the ID of the connection for which the buffer
753 * has been created.
754 *
755 * @return 0 on success, -1 on error.
756 */
757int xplra_multi_destroy_buffer(int connectionID, int bufferID);
758
759/*----------------------------------------------------------------------------*/
760/*----------------------------------------------------------------------------*/
761
762/**
763 * Show a message in the simulator window for the given duration.
764 */
765int xplra_show_message(int connectionID, const char* message, float duration);
766
767/*----------------------------------------------------------------------------*/
768/*----------------------------------------------------------------------------*/
769
770/**
771 * Register the given hotkey codes for listening. If there is an
772 * existing set of hotkeys registered, those will be overwritten.
773 */
774int xplra_register_hotkeys(int connectionID,
775 const uint16_t* codes, size_t length);
776
777/*----------------------------------------------------------------------------*/
778
779/**
780 * Query the registered hotkeys whether they were pressed.
781 */
782int xplra_query_hotkeys(int connectionID, uint8_t* states, size_t length);
783
784/*----------------------------------------------------------------------------*/
785
786/**
787 * Unregister the hotkeys.
788 */
789int xplra_unregister_hotkeys(int connectionID);
790
791/*----------------------------------------------------------------------------*/
792/*----------------------------------------------------------------------------*/
793
794/**
795 * Destroy the connection with the given ID.
796 *
797 * @return 0 on success, -1 on error.
798 */
799int xplra_disconnect(int connectionID);
800
801/*----------------------------------------------------------------------------*/
802
803#ifdef __cplusplus
804} // extern "C"
805#endif
806
807/*----------------------------------------------------------------------------*/
808#endif // HU_VARADIISTVAN_XPLRA_XPLRA_H
Note: See TracBrowser for help on using the repository browser.