OLD | NEW |
1 /* Copyright 2013 The Chromium Authors. All rights reserved. | 1 /* Copyright 2013 The Chromium Authors. All rights reserved. |
2 * Use of this source code is governed by a BSD-style license that can be | 2 * Use of this source code is governed by a BSD-style license that can be |
3 * found in the LICENSE file. */ | 3 * found in the LICENSE file. */ |
4 | 4 |
5 #ifndef LIBRARIES_NACL_IO_IOCTL_H_ | 5 #ifndef LIBRARIES_NACL_IO_IOCTL_H_ |
6 #define LIBRARIES_NACL_IO_IOCTL_H_ | 6 #define LIBRARIES_NACL_IO_IOCTL_H_ |
7 | 7 |
8 #include <sys/types.h> | 8 #include <sys/types.h> |
9 | 9 |
10 /* | 10 /* |
(...skipping 15 matching lines...) Expand all Loading... |
26 #define TIOCNACLOUTPUT 0xadcd03 | 26 #define TIOCNACLOUTPUT 0xadcd03 |
27 | 27 |
28 /* | 28 /* |
29 * ioctl used to set a name for a JavaScript pipe. The name | 29 * ioctl used to set a name for a JavaScript pipe. The name |
30 * is a string that is used to uniquely identify messages posted to and from | 30 * is a string that is used to uniquely identify messages posted to and from |
31 * JavaScript which signifies that the message is destined for a | 31 * JavaScript which signifies that the message is destined for a |
32 * particular pipe device. For this reason each device must have a | 32 * particular pipe device. For this reason each device must have a |
33 * unique prefix. Until a prefix is set on a given pipe any I/O operations | 33 * unique prefix. Until a prefix is set on a given pipe any I/O operations |
34 * will return EIO. | 34 * will return EIO. |
35 */ | 35 */ |
36 #define TIOCNACLPIPENAME 0xadcd04 | 36 #define NACL_IOC_PIPE_SETNAME 0xadcd04 |
37 | 37 |
38 typedef char* tioc_nacl_jspipe_name; | 38 /* |
| 39 * Find out how much space is available in a nacl_io pipe. |
| 40 * Argument type is "int*" which will be set to the amount of space in the |
| 41 * pipe in bytes. |
| 42 */ |
| 43 #define NACL_IOC_PIPE_GETOSPACE 0xadcd06 |
| 44 #define NACL_IOC_PIPE_GETISPACE 0xadcd07 |
| 45 |
| 46 /* |
| 47 * ioctl used to pass messages from JavaScript to a jspipe node. |
| 48 * Argument type is "struct PP_Var*". |
| 49 */ |
| 50 #define NACL_IOC_HANDLEMESSAGE 0xadcd05 |
| 51 |
| 52 typedef char* naclioc_jspipe_name; |
39 | 53 |
40 struct tioc_nacl_input_string { | 54 struct tioc_nacl_input_string { |
41 size_t length; | 55 size_t length; |
42 const char* buffer; | 56 const char* buffer; |
43 }; | 57 }; |
44 | 58 |
45 | 59 |
46 typedef ssize_t (*tioc_nacl_output_handler_t)(const char* buf, | 60 typedef ssize_t (*tioc_nacl_output_handler_t)(const char* buf, |
47 size_t count, | 61 size_t count, |
48 void* user_data); | 62 void* user_data); |
49 | 63 |
50 struct tioc_nacl_output { | 64 struct tioc_nacl_output { |
51 tioc_nacl_output_handler_t handler; | 65 tioc_nacl_output_handler_t handler; |
52 void* user_data; | 66 void* user_data; |
53 }; | 67 }; |
54 | 68 |
55 | 69 |
56 #endif /* LIBRARIES_NACL_IO_NACL_IO_H_ */ | 70 #endif /* LIBRARIES_NACL_IO_NACL_IO_H_ */ |
OLD | NEW |