Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(639)

Side by Side Diff: native_client_sdk/src/libraries/nacl_io/nacl_io.h

Issue 22642016: [NaCL SDK] Ship sys/mount.h for newlib/pnacl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add extern C Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « native_client_sdk/src/libraries/nacl_io/library.dsc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 */ 20 */
22 void nacl_io_init(); 21 void nacl_io_init();
23 22
24 /** Initialize nacl_io with PPAPI support. 23 /**
24 * Initialize nacl_io with PPAPI support.
25 * 25 *
26 * Usage: 26 * Usage:
27 * PP_Instance instance; 27 * PP_Instance instance;
28 * PPB_GetInterface get_interface; 28 * PPB_GetInterface get_interface;
29 * nacl_io_init(instance, get_interface); 29 * nacl_io_init(instance, get_interface);
30 * 30 *
31 * If you are using the PPAPI C interface: 31 * If you are using the PPAPI C interface:
32 * |instance| is passed to your instance in the DidCreate function. 32 * |instance| is passed to your instance in the DidCreate function.
33 * |get_interface| is passed to your module in the PPP_InitializeModule 33 * |get_interface| is passed to your module in the PPP_InitializeModule
34 * function. 34 * function.
35 * 35 *
36 * If you are using the PPAPI C++ interface: 36 * If you are using the PPAPI C++ interface:
37 * |instance| can be retrieved via the pp::Instance::pp_instance() method. 37 * |instance| can be retrieved via the pp::Instance::pp_instance() method.
38 * |get_interface| can be retrieved via 38 * |get_interface| can be retrieved via
39 * pp::Module::Get()->get_browser_interface() 39 * pp::Module::Get()->get_browser_interface()
40 */ 40 */
41 void nacl_io_init_ppapi(PP_Instance instance, 41 void nacl_io_init_ppapi(PP_Instance instance,
42 PPB_GetInterface get_interface); 42 PPB_GetInterface get_interface);
43 43
44 44
45 /** Mount a new filesystem type. 45 /**
46 * Mount a new filesystem type.
47 *
48 * This function is declared in <sys/mount.h>, but we document it here
49 * because nacl_io is controlled primarily through mount(2)/umount(2).
46 * 50 *
47 * Some parameters are dependent on the filesystem type being mounted. 51 * Some parameters are dependent on the filesystem type being mounted.
48 * 52 *
49 * The |data| parameter, if used, is always parsed as a string of comma 53 * The |data| parameter, if used, is always parsed as a string of comma
50 * separated key-value pairs: 54 * separated key-value pairs:
51 * e.g. "key1=param1,key2=param2" 55 * e.g. "key1=param1,key2=param2"
52 * 56 *
53 * 57 *
54 * filesystem types: 58 * filesystem types:
55 * "memfs": An in-memory filesystem. 59 * "memfs": An in-memory filesystem.
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 * data: Unused. 105 * data: Unused.
102 * 106 *
103 * 107 *
104 * @param[in] source Depends on the filesystem type. See above. 108 * @param[in] source Depends on the filesystem type. See above.
105 * @param[in] target The absolute path to mount the filesystem. 109 * @param[in] target The absolute path to mount the filesystem.
106 * @param[in] filesystemtype The name of the filesystem type to mount. See 110 * @param[in] filesystemtype The name of the filesystem type to mount. See
107 * above for examples. 111 * above for examples.
108 * @param[in] mountflags Unused. 112 * @param[in] mountflags Unused.
109 * @param[in] data Depends on the filesystem type. See above. 113 * @param[in] data Depends on the filesystem type. See above.
110 * @return 0 on success, -1 on failure (with errno set). 114 * @return 0 on success, -1 on failure (with errno set).
115 *
116 * int mount(const char* source, const char* target, const char* filesystemtype,
117 * unsigned long mountflags, const void *data) NOTHROW;
111 */ 118 */
112 int mount(const char* source, const char* target, const char* filesystemtype,
113 unsigned long mountflags, const void *data) NOTHROW;
114 119
115 EXTERN_C_END 120 EXTERN_C_END
116 121
117 #endif /* LIBRARIES_NACL_IO_NACL_IO_H_ */ 122 #endif /* LIBRARIES_NACL_IO_NACL_IO_H_ */
OLDNEW
« no previous file with comments | « native_client_sdk/src/libraries/nacl_io/library.dsc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698