OLD | NEW |
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2012 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_NACL_IO_H_ | 5 #ifndef LIBRARIES_NACL_IO_NACL_IO_H_ |
6 #define LIBRARIES_NACL_IO_NACL_IO_H_ | 6 #define LIBRARIES_NACL_IO_NACL_IO_H_ |
7 | 7 |
8 #include <ppapi/c/pp_instance.h> | 8 #include <ppapi/c/pp_instance.h> |
9 #include <ppapi/c/ppb.h> | 9 #include <ppapi/c/ppb.h> |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 const void* data, | 22 const void* data, |
23 dev_t dev, | 23 dev_t dev, |
24 void* user_data); | 24 void* user_data); |
25 | 25 |
26 /** | 26 /** |
27 * Initialize nacl_io. | 27 * Initialize nacl_io. |
28 * | 28 * |
29 * NOTE: If you initialize nacl_io with this constructor, you cannot | 29 * NOTE: If you initialize nacl_io with this constructor, you cannot |
30 * use any filesystems that require PPAPI; e.g. persistent storage, etc. | 30 * use any filesystems that require PPAPI; e.g. persistent storage, etc. |
31 */ | 31 */ |
32 void nacl_io_init(); | 32 int nacl_io_init(); |
33 | 33 |
34 /** | 34 /** |
35 * Initialize nacl_io with PPAPI support. | 35 * Initialize nacl_io with PPAPI support. |
36 * | 36 * |
37 * Usage: | 37 * Usage: |
38 * PP_Instance instance; | 38 * PP_Instance instance; |
39 * PPB_GetInterface get_interface; | 39 * PPB_GetInterface get_interface; |
40 * nacl_io_init(instance, get_interface); | 40 * nacl_io_init(instance, get_interface); |
41 * | 41 * |
42 * If you are using the PPAPI C interface: | 42 * If you are using the PPAPI C interface: |
43 * |instance| is passed to your instance in the DidCreate function. | 43 * |instance| is passed to your instance in the DidCreate function. |
44 * |get_interface| is passed to your module in the PPP_InitializeModule | 44 * |get_interface| is passed to your module in the PPP_InitializeModule |
45 * function. | 45 * function. |
46 * | 46 * |
47 * If you are using the PPAPI C++ interface: | 47 * If you are using the PPAPI C++ interface: |
48 * |instance| can be retrieved via the pp::Instance::pp_instance() method. | 48 * |instance| can be retrieved via the pp::Instance::pp_instance() method. |
49 * |get_interface| can be retrieved via | 49 * |get_interface| can be retrieved via |
50 * pp::Module::Get()->get_browser_interface() | 50 * pp::Module::Get()->get_browser_interface() |
51 */ | 51 */ |
52 void nacl_io_init_ppapi(PP_Instance instance, PPB_GetInterface get_interface); | 52 int nacl_io_init_ppapi(PP_Instance instance, PPB_GetInterface get_interface); |
53 | 53 |
54 /** | 54 /** |
55 * Uninitialize nacl_io. | 55 * Uninitialize nacl_io. |
56 * | 56 * |
57 * This removes interception for POSIX C-library function and releases | 57 * This removes interception for POSIX C-library function and releases |
58 * any associated resources. | 58 * any associated resources. |
59 */ | 59 */ |
60 void nacl_io_uninit(); | 60 int nacl_io_uninit(); |
61 | 61 |
62 void nacl_io_set_exit_callback(nacl_io_exit_callback_t exit_callback, | 62 void nacl_io_set_exit_callback(nacl_io_exit_callback_t exit_callback, |
63 void* user_data); | 63 void* user_data); |
64 | 64 |
65 /** | 65 /** |
66 * Mount a new filesystem type. | 66 * Mount a new filesystem type. |
67 * | 67 * |
68 * This function is declared in <sys/mount.h>, but we document it here | 68 * This function is declared in <sys/mount.h>, but we document it here |
69 * because nacl_io is controlled primarily through mount(2)/umount(2). | 69 * because nacl_io is controlled primarily through mount(2)/umount(2). |
70 * | 70 * |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 * @param[in] callback The callback to set, or NULL. | 213 * @param[in] callback The callback to set, or NULL. |
214 * @param[in] user_data User data that will be passed to the callback. | 214 * @param[in] user_data User data that will be passed to the callback. |
215 * @return 0 on success, -1 on failure. | 215 * @return 0 on success, -1 on failure. |
216 */ | 216 */ |
217 void nacl_io_set_mount_callback(nacl_io_mount_callback_t callback, | 217 void nacl_io_set_mount_callback(nacl_io_mount_callback_t callback, |
218 void* user_data); | 218 void* user_data); |
219 | 219 |
220 EXTERN_C_END | 220 EXTERN_C_END |
221 | 221 |
222 #endif /* LIBRARIES_NACL_IO_NACL_IO_H_ */ | 222 #endif /* LIBRARIES_NACL_IO_NACL_IO_H_ */ |
OLD | NEW |