Chromium Code Reviews| 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 |
| 11 #include "nacl_io/kernel_wrap.h" | |
| 12 #include "sdk_util/macros.h" | 11 #include "sdk_util/macros.h" |
| 13 | 12 |
| 14 EXTERN_C_BEGIN | 13 EXTERN_C_BEGIN |
| 15 | 14 |
| 16 | 15 /** |
| 17 /** Initialize nacl_io. | 16 * Initialize nacl_io. |
| 18 * | 17 * |
| 19 * NOTE: If you initialize nacl_io with this constructor, you cannot | 18 * NOTE: If you initialize nacl_io with this constructor, you cannot |
| 20 * use any mounts that require PPAPI; e.g. persistent storage, etc. | 19 * use any mounts that require PPAPI; e.g. persistent storage, etc. |
| 21 */ | |
| 22 void nacl_io_init(); | |
| 23 | |
| 24 /** Initialize nacl_io with PPAPI support. | |
| 25 * | 20 * |
| 26 * Usage: | 21 * Once nacl_io is initialised the mount(2)/umount(2) system calls |
|
binji
2013/08/09 21:10:39
we use initialize above, so be consistent. :)
Sam Clegg
2013/08/09 21:19:02
Removed.
| |
| 27 * PP_Instance instance; | 22 * can be used to mount a new filesystem types. |
| 28 * PPB_GetInterface get_interface; | |
| 29 * nacl_io_init(instance, get_interface); | |
| 30 * | 23 * |
| 31 * If you are using the PPAPI C interface: | 24 * The parameters to pass to mount(2) are dependent on the filesystem type |
|
binji
2013/08/09 21:10:39
I don't really like combining this documentation h
Sam Clegg
2013/08/09 21:19:02
Done.
| |
| 32 * |instance| is passed to your instance in the DidCreate function. | 25 * being mounted. |
| 33 * |get_interface| is passed to your module in the PPP_InitializeModule | |
| 34 * function. | |
| 35 * | |
| 36 * If you are using the PPAPI C++ interface: | |
| 37 * |instance| can be retrieved via the pp::Instance::pp_instance() method. | |
| 38 * |get_interface| can be retrieved via | |
| 39 * pp::Module::Get()->get_browser_interface() | |
| 40 */ | |
| 41 void nacl_io_init_ppapi(PP_Instance instance, | |
| 42 PPB_GetInterface get_interface); | |
| 43 | |
| 44 | |
| 45 /** Mount a new filesystem type. | |
| 46 * | |
| 47 * Some parameters are dependent on the filesystem type being mounted. | |
| 48 * | 26 * |
| 49 * The |data| parameter, if used, is always parsed as a string of comma | 27 * The |data| parameter, if used, is always parsed as a string of comma |
| 50 * separated key-value pairs: | 28 * separated key-value pairs: |
| 51 * e.g. "key1=param1,key2=param2" | 29 * e.g. "key1=param1,key2=param2" |
| 52 * | 30 * |
| 53 * | 31 * |
| 54 * filesystem types: | 32 * filesystem types: |
| 55 * "memfs": An in-memory filesystem. | 33 * "memfs": An in-memory filesystem. |
| 56 * source: Unused. | 34 * source: Unused. |
| 57 * data: Unused. | 35 * data: Unused. |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 100 * source: Unused. | 78 * source: Unused. |
| 101 * data: Unused. | 79 * data: Unused. |
| 102 * | 80 * |
| 103 * | 81 * |
| 104 * @param[in] source Depends on the filesystem type. See above. | 82 * @param[in] source Depends on the filesystem type. See above. |
| 105 * @param[in] target The absolute path to mount the filesystem. | 83 * @param[in] target The absolute path to mount the filesystem. |
| 106 * @param[in] filesystemtype The name of the filesystem type to mount. See | 84 * @param[in] filesystemtype The name of the filesystem type to mount. See |
| 107 * above for examples. | 85 * above for examples. |
| 108 * @param[in] mountflags Unused. | 86 * @param[in] mountflags Unused. |
| 109 * @param[in] data Depends on the filesystem type. See above. | 87 * @param[in] data Depends on the filesystem type. See above. |
| 110 * @return 0 on success, -1 on failure (with errno set). | |
| 111 */ | 88 */ |
| 112 int mount(const char* source, const char* target, const char* filesystemtype, | 89 void nacl_io_init(); |
| 113 unsigned long mountflags, const void *data) NOTHROW; | 90 |
| 91 /** | |
| 92 * Initialize nacl_io with PPAPI support. | |
| 93 * | |
| 94 * Usage: | |
| 95 * PP_Instance instance; | |
| 96 * PPB_GetInterface get_interface; | |
| 97 * nacl_io_init(instance, get_interface); | |
| 98 * | |
| 99 * If you are using the PPAPI C interface: | |
| 100 * |instance| is passed to your instance in the DidCreate function. | |
| 101 * |get_interface| is passed to your module in the PPP_InitializeModule | |
| 102 * function. | |
| 103 * | |
| 104 * If you are using the PPAPI C++ interface: | |
| 105 * |instance| can be retrieved via the pp::Instance::pp_instance() method. | |
| 106 * |get_interface| can be retrieved via | |
| 107 * pp::Module::Get()->get_browser_interface() | |
| 108 */ | |
| 109 void nacl_io_init_ppapi(PP_Instance instance, | |
| 110 PPB_GetInterface get_interface); | |
| 114 | 111 |
| 115 EXTERN_C_END | 112 EXTERN_C_END |
| 116 | 113 |
| 117 #endif /* LIBRARIES_NACL_IO_NACL_IO_H_ */ | 114 #endif /* LIBRARIES_NACL_IO_NACL_IO_H_ */ |
| OLD | NEW |