imfs
1# This file was automatically generated by SWIG (https://www.swig.org). 2# Version 4.2.1 3# 4# Do not make changes to this file unless you know what you are doing - modify 5# the SWIG interface file instead. 6 7from sys import version_info as _swig_python_version_info 8from mock_rtems import _imfs as _imfs 9 10try: 11 import builtins as __builtin__ 12except ImportError: 13 import __builtin__ 14 15def _swig_repr(self): 16 try: 17 strthis = "proxy of " + self.this.__repr__() 18 except __builtin__.Exception: 19 strthis = "" 20 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) 21 22 23def _swig_setattr_nondynamic_instance_variable(set): 24 def set_instance_attr(self, name, value): 25 if name == "this": 26 set(self, name, value) 27 elif name == "thisown": 28 self.this.own(value) 29 elif hasattr(self, name) and isinstance(getattr(type(self), name), property): 30 set(self, name, value) 31 else: 32 raise AttributeError("You cannot add instance attributes to %s" % self) 33 return set_instance_attr 34 35 36def _swig_setattr_nondynamic_class_variable(set): 37 def set_class_attr(cls, name, value): 38 if hasattr(cls, name) and not isinstance(getattr(cls, name), property): 39 set(cls, name, value) 40 else: 41 raise AttributeError("You cannot add class attributes to %s" % cls) 42 return set_class_attr 43 44 45def _swig_add_metaclass(metaclass): 46 """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass""" 47 def wrapper(cls): 48 return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy()) 49 return wrapper 50 51 52class _SwigNonDynamicMeta(type): 53 """Meta class to enforce nondynamic attributes (no new attributes) for a class""" 54 __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__) 55 56 57IMFS_MEMFILE_DEFAULT_BYTES_PER_BLOCK = _imfs.IMFS_MEMFILE_DEFAULT_BYTES_PER_BLOCK 58r""" 59 IMFS "memfile" information 60 61 The data structure for the in-memory "memfiles" is based on classic UNIX. 62 63 block_ptr is a pointer to a block of IMFS_MEMFILE_BYTES_PER_BLOCK in 64 length which could be data or a table of pointers to blocks. 65 66 Setting IMFS_MEMFILE_BYTES_PER_BLOCK to different values has a significant 67 impact on the maximum file size supported as well as the amount of 68 memory wasted due to internal file fragmentation. The following 69 is a list of maximum file sizes based on various settings 70 71 .. code-block:: c++ 72 73 max_filesize with blocks of 16 is 1,328 74 max_filesize with blocks of 32 is 18,656 75 max_filesize with blocks of 64 is 279,488 76 max_filesize with blocks of 128 is 4,329,344 77 max_filesize with blocks of 256 is 68,173,568 78 max_filesize with blocks of 512 is 1,082,195,456 79 """ 80FIRST_INDIRECT = _imfs.FIRST_INDIRECT 81 82 83def IMFS_node_initialize_default(node, arg): 84 r""" 85 Returns the node and does nothing else. 86 87 :type node: :py:class:`IMFS_jnode_t`, in 88 :param node: The IMFS node. 89 :type arg: void, in 90 :param arg: The user provided argument pointer. It is not used. 91 92 See also: IMFS_node_control. 93 """ 94 return _imfs.IMFS_node_initialize_default(node, arg) 95 96def IMFS_node_initialize_directory(node, arg): 97 r""" 98 IMFS_node_initialize_directory(IMFS_jnode_tt node, void * arg) -> IMFS_jnode_tt 99 100 Parameters 101 ---------- 102 node: IMFS_jnode_t * 103 arg: void * 104 105 """ 106 return _imfs.IMFS_node_initialize_directory(node, arg) 107 108def IMFS_node_initialize_generic(node, arg): 109 r""" 110 Returns the node and sets the generic node context. 111 112 :type node: :py:class:`IMFS_jnode_t`, in 113 :param node: The IMFS node. 114 :type arg: void, in 115 :param arg: The user provided argument pointer. It must contain the 116 generic context. 117 118 See also: IMFS_node_control. 119 """ 120 return _imfs.IMFS_node_initialize_generic(node, arg) 121 122def IMFS_node_remove_default(node): 123 r""" 124 Returns the node and does nothing else. 125 126 :type node: :py:class:`IMFS_jnode_t`, in 127 :param node: The IMFS node. 128 129 See also: IMFS_node_control. 130 """ 131 return _imfs.IMFS_node_remove_default(node) 132 133def IMFS_node_remove_directory(node): 134 r""" 135 IMFS_node_remove_directory(IMFS_jnode_tt node) -> IMFS_jnode_tt 136 137 Parameters 138 ---------- 139 node: IMFS_jnode_t * 140 141 """ 142 return _imfs.IMFS_node_remove_directory(node) 143 144def IMFS_node_destroy_default(node): 145 r""" 146 Frees the node. 147 148 :type node: :py:class:`IMFS_jnode_t`, in 149 :param node: The IMFS node. 150 151 See also: IMFS_node_control. 152 """ 153 return _imfs.IMFS_node_destroy_default(node) 154 155def IMFS_do_nothing_destroy(node): 156 r""" 157 Does nothing. 158 159 :type node: :py:class:`IMFS_jnode_t` 160 :param node: The IMFS node. 161 162 See also: IMFS_node_control. 163 """ 164 return _imfs.IMFS_do_nothing_destroy(node) 165class IMFS_node_control(object): 166 r"""IMFS node control.""" 167 168 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") 169 __repr__ = _swig_repr 170 handlers = property(_imfs.IMFS_node_control_handlers_get, _imfs.IMFS_node_control_handlers_set, doc=r"""handlers : p.q(const).rtems_filesystem_file_handlers_r""") 171 node_initialize = property(_imfs.IMFS_node_control_node_initialize_get, _imfs.IMFS_node_control_node_initialize_set, doc=r"""node_initialize : IMFS_node_control_initialize""") 172 node_remove = property(_imfs.IMFS_node_control_node_remove_get, _imfs.IMFS_node_control_node_remove_set, doc=r"""node_remove : IMFS_node_control_remove""") 173 node_destroy = property(_imfs.IMFS_node_control_node_destroy_get, _imfs.IMFS_node_control_node_destroy_set, doc=r"""node_destroy : IMFS_node_control_destroy""") 174 175 def __init__(self): 176 r"""__init__(IMFS_node_control self) -> IMFS_node_control""" 177 _imfs.IMFS_node_control_swiginit(self, _imfs.new_IMFS_node_control()) 178 __swig_destroy__ = _imfs.delete_IMFS_node_control 179 180# Register IMFS_node_control in _imfs: 181_imfs.IMFS_node_control_swigregister(IMFS_node_control) 182cvar = _imfs.cvar 183imfs_memfile_bytes_per_block = cvar.imfs_memfile_bytes_per_block 184 185class IMFS_mknod_control(object): 186 r"""Proxy of C IMFS_mknod_control struct.""" 187 188 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") 189 __repr__ = _swig_repr 190 node_control = property(_imfs.IMFS_mknod_control_node_control_get, _imfs.IMFS_mknod_control_node_control_set, doc=r"""node_control : IMFS_node_control""") 191 node_size = property(_imfs.IMFS_mknod_control_node_size_get, _imfs.IMFS_mknod_control_node_size_set, doc=r"""node_size : size_t""") 192 193 def __init__(self): 194 r"""__init__(IMFS_mknod_control self) -> IMFS_mknod_control""" 195 _imfs.IMFS_mknod_control_swiginit(self, _imfs.new_IMFS_mknod_control()) 196 __swig_destroy__ = _imfs.delete_IMFS_mknod_control 197 198# Register IMFS_mknod_control in _imfs: 199_imfs.IMFS_mknod_control_swigregister(IMFS_mknod_control) 200class IMFS_jnode_tt(object): 201 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") 202 __repr__ = _swig_repr 203 Node = property(_imfs.IMFS_jnode_tt_Node_get, _imfs.IMFS_jnode_tt_Node_set, doc=r"""Node : rtems_chain_node""") 204 Parent = property(_imfs.IMFS_jnode_tt_Parent_get, _imfs.IMFS_jnode_tt_Parent_set, doc=r"""Parent : p.IMFS_jnode_t""") 205 name = property(_imfs.IMFS_jnode_tt_name_get, _imfs.IMFS_jnode_tt_name_set, doc=r"""name : p.q(const).char""") 206 namelen = property(_imfs.IMFS_jnode_tt_namelen_get, _imfs.IMFS_jnode_tt_namelen_set, doc=r"""namelen : uint16_t""") 207 st_mode = property(_imfs.IMFS_jnode_tt_st_mode_get, _imfs.IMFS_jnode_tt_st_mode_set, doc=r"""st_mode : mode_t""") 208 reference_count = property(_imfs.IMFS_jnode_tt_reference_count_get, _imfs.IMFS_jnode_tt_reference_count_set, doc=r"""reference_count : unsigned short""") 209 st_nlink = property(_imfs.IMFS_jnode_tt_st_nlink_get, _imfs.IMFS_jnode_tt_st_nlink_set, doc=r"""st_nlink : nlink_t""") 210 st_uid = property(_imfs.IMFS_jnode_tt_st_uid_get, _imfs.IMFS_jnode_tt_st_uid_set, doc=r"""st_uid : uid_t""") 211 st_gid = property(_imfs.IMFS_jnode_tt_st_gid_get, _imfs.IMFS_jnode_tt_st_gid_set, doc=r"""st_gid : gid_t""") 212 stat_atime = property(_imfs.IMFS_jnode_tt_stat_atime_get, _imfs.IMFS_jnode_tt_stat_atime_set, doc=r"""stat_atime : time_t""") 213 stat_mtime = property(_imfs.IMFS_jnode_tt_stat_mtime_get, _imfs.IMFS_jnode_tt_stat_mtime_set, doc=r"""stat_mtime : time_t""") 214 stat_ctime = property(_imfs.IMFS_jnode_tt_stat_ctime_get, _imfs.IMFS_jnode_tt_stat_ctime_set, doc=r"""stat_ctime : time_t""") 215 control = property(_imfs.IMFS_jnode_tt_control_get, _imfs.IMFS_jnode_tt_control_set, doc=r"""control : p.q(const).IMFS_node_control""") 216 217 def __init__(self): 218 r"""__init__(IMFS_jnode_tt self) -> IMFS_jnode_tt""" 219 _imfs.IMFS_jnode_tt_swiginit(self, _imfs.new_IMFS_jnode_tt()) 220 __swig_destroy__ = _imfs.delete_IMFS_jnode_tt 221 222# Register IMFS_jnode_tt in _imfs: 223_imfs.IMFS_jnode_tt_swigregister(IMFS_jnode_tt) 224class IMFS_directory_t(object): 225 r"""Proxy of C IMFS_directory_t struct.""" 226 227 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") 228 __repr__ = _swig_repr 229 Node = property(_imfs.IMFS_directory_t_Node_get, _imfs.IMFS_directory_t_Node_set, doc=r"""Node : IMFS_jnode_t""") 230 Entries = property(_imfs.IMFS_directory_t_Entries_get, _imfs.IMFS_directory_t_Entries_set, doc=r"""Entries : rtems_chain_control""") 231 mt_fs = property(_imfs.IMFS_directory_t_mt_fs_get, _imfs.IMFS_directory_t_mt_fs_set, doc=r"""mt_fs : p.rtems_filesystem_mount_table_entry_t""") 232 233 def __init__(self): 234 r"""__init__(IMFS_directory_t self) -> IMFS_directory_t""" 235 _imfs.IMFS_directory_t_swiginit(self, _imfs.new_IMFS_directory_t()) 236 __swig_destroy__ = _imfs.delete_IMFS_directory_t 237 238# Register IMFS_directory_t in _imfs: 239_imfs.IMFS_directory_t_swigregister(IMFS_directory_t) 240class IMFS_device_t(object): 241 r"""Proxy of C IMFS_device_t struct.""" 242 243 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") 244 __repr__ = _swig_repr 245 Node = property(_imfs.IMFS_device_t_Node_get, _imfs.IMFS_device_t_Node_set, doc=r"""Node : IMFS_jnode_t""") 246 major = property(_imfs.IMFS_device_t_major_get, _imfs.IMFS_device_t_major_set, doc=r"""major : rtems_device_major_number""") 247 minor = property(_imfs.IMFS_device_t_minor_get, _imfs.IMFS_device_t_minor_set, doc=r"""minor : rtems_device_minor_number""") 248 249 def __init__(self): 250 r"""__init__(IMFS_device_t self) -> IMFS_device_t""" 251 _imfs.IMFS_device_t_swiginit(self, _imfs.new_IMFS_device_t()) 252 __swig_destroy__ = _imfs.delete_IMFS_device_t 253 254# Register IMFS_device_t in _imfs: 255_imfs.IMFS_device_t_swigregister(IMFS_device_t) 256class IMFS_link_t(object): 257 r"""Proxy of C IMFS_link_t struct.""" 258 259 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") 260 __repr__ = _swig_repr 261 Node = property(_imfs.IMFS_link_t_Node_get, _imfs.IMFS_link_t_Node_set, doc=r"""Node : IMFS_jnode_t""") 262 link_node = property(_imfs.IMFS_link_t_link_node_get, _imfs.IMFS_link_t_link_node_set, doc=r"""link_node : p.IMFS_jnode_t""") 263 264 def __init__(self): 265 r"""__init__(IMFS_link_t self) -> IMFS_link_t""" 266 _imfs.IMFS_link_t_swiginit(self, _imfs.new_IMFS_link_t()) 267 __swig_destroy__ = _imfs.delete_IMFS_link_t 268 269# Register IMFS_link_t in _imfs: 270_imfs.IMFS_link_t_swigregister(IMFS_link_t) 271class IMFS_sym_link_t(object): 272 r"""Proxy of C IMFS_sym_link_t struct.""" 273 274 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") 275 __repr__ = _swig_repr 276 Node = property(_imfs.IMFS_sym_link_t_Node_get, _imfs.IMFS_sym_link_t_Node_set, doc=r"""Node : IMFS_jnode_t""") 277 name = property(_imfs.IMFS_sym_link_t_name_get, _imfs.IMFS_sym_link_t_name_set, doc=r"""name : p.char""") 278 279 def __init__(self): 280 r"""__init__(IMFS_sym_link_t self) -> IMFS_sym_link_t""" 281 _imfs.IMFS_sym_link_t_swiginit(self, _imfs.new_IMFS_sym_link_t()) 282 __swig_destroy__ = _imfs.delete_IMFS_sym_link_t 283 284# Register IMFS_sym_link_t in _imfs: 285_imfs.IMFS_sym_link_t_swigregister(IMFS_sym_link_t) 286class IMFS_filebase_t(object): 287 r"""Proxy of C IMFS_filebase_t struct.""" 288 289 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") 290 __repr__ = _swig_repr 291 Node = property(_imfs.IMFS_filebase_t_Node_get, _imfs.IMFS_filebase_t_Node_set, doc=r"""Node : IMFS_jnode_t""") 292 size = property(_imfs.IMFS_filebase_t_size_get, _imfs.IMFS_filebase_t_size_set, doc=r"""size : size_t""") 293 294 def __init__(self): 295 r"""__init__(IMFS_filebase_t self) -> IMFS_filebase_t""" 296 _imfs.IMFS_filebase_t_swiginit(self, _imfs.new_IMFS_filebase_t()) 297 __swig_destroy__ = _imfs.delete_IMFS_filebase_t 298 299# Register IMFS_filebase_t in _imfs: 300_imfs.IMFS_filebase_t_swigregister(IMFS_filebase_t) 301class IMFS_memfile_t(object): 302 r"""Proxy of C IMFS_memfile_t struct.""" 303 304 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") 305 __repr__ = _swig_repr 306 File = property(_imfs.IMFS_memfile_t_File_get, _imfs.IMFS_memfile_t_File_set, doc=r"""File : IMFS_filebase_t""") 307 indirect = property(_imfs.IMFS_memfile_t_indirect_get, _imfs.IMFS_memfile_t_indirect_set, doc=r"""indirect : block_ptr""") 308 doubly_indirect = property(_imfs.IMFS_memfile_t_doubly_indirect_get, _imfs.IMFS_memfile_t_doubly_indirect_set, doc=r"""doubly_indirect : block_ptr""") 309 triply_indirect = property(_imfs.IMFS_memfile_t_triply_indirect_get, _imfs.IMFS_memfile_t_triply_indirect_set, doc=r"""triply_indirect : block_ptr""") 310 311 def __init__(self): 312 r"""__init__(IMFS_memfile_t self) -> IMFS_memfile_t""" 313 _imfs.IMFS_memfile_t_swiginit(self, _imfs.new_IMFS_memfile_t()) 314 __swig_destroy__ = _imfs.delete_IMFS_memfile_t 315 316# Register IMFS_memfile_t in _imfs: 317_imfs.IMFS_memfile_t_swigregister(IMFS_memfile_t) 318class IMFS_linearfile_t(object): 319 r"""Proxy of C IMFS_linearfile_t struct.""" 320 321 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") 322 __repr__ = _swig_repr 323 File = property(_imfs.IMFS_linearfile_t_File_get, _imfs.IMFS_linearfile_t_File_set, doc=r"""File : IMFS_filebase_t""") 324 direct = property(_imfs.IMFS_linearfile_t_direct_get, _imfs.IMFS_linearfile_t_direct_set, doc=r"""direct : block_p""") 325 326 def __init__(self): 327 r"""__init__(IMFS_linearfile_t self) -> IMFS_linearfile_t""" 328 _imfs.IMFS_linearfile_t_swiginit(self, _imfs.new_IMFS_linearfile_t()) 329 __swig_destroy__ = _imfs.delete_IMFS_linearfile_t 330 331# Register IMFS_linearfile_t in _imfs: 332_imfs.IMFS_linearfile_t_swigregister(IMFS_linearfile_t) 333class IMFS_file_t(object): 334 r"""Proxy of C IMFS_file_t struct.""" 335 336 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") 337 __repr__ = _swig_repr 338 Node = property(_imfs.IMFS_file_t_Node_get, _imfs.IMFS_file_t_Node_set, doc=r"""Node : IMFS_jnode_t""") 339 File = property(_imfs.IMFS_file_t_File_get, _imfs.IMFS_file_t_File_set, doc=r"""File : IMFS_filebase_t""") 340 Memfile = property(_imfs.IMFS_file_t_Memfile_get, _imfs.IMFS_file_t_Memfile_set, doc=r"""Memfile : IMFS_memfile_t""") 341 Linearfile = property(_imfs.IMFS_file_t_Linearfile_get, _imfs.IMFS_file_t_Linearfile_set, doc=r"""Linearfile : IMFS_linearfile_t""") 342 343 def __init__(self): 344 r"""__init__(IMFS_file_t self) -> IMFS_file_t""" 345 _imfs.IMFS_file_t_swiginit(self, _imfs.new_IMFS_file_t()) 346 __swig_destroy__ = _imfs.delete_IMFS_file_t 347 348# Register IMFS_file_t in _imfs: 349_imfs.IMFS_file_t_swigregister(IMFS_file_t) 350class IMFS_fifo_t(object): 351 r"""Proxy of C IMFS_fifo_t struct.""" 352 353 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") 354 __repr__ = _swig_repr 355 Node = property(_imfs.IMFS_fifo_t_Node_get, _imfs.IMFS_fifo_t_Node_set, doc=r"""Node : IMFS_jnode_t""") 356 pipe = property(_imfs.IMFS_fifo_t_pipe_get, _imfs.IMFS_fifo_t_pipe_set, doc=r"""pipe : p.pipe_control_t""") 357 358 def __init__(self): 359 r"""__init__(IMFS_fifo_t self) -> IMFS_fifo_t""" 360 _imfs.IMFS_fifo_t_swiginit(self, _imfs.new_IMFS_fifo_t()) 361 __swig_destroy__ = _imfs.delete_IMFS_fifo_t 362 363# Register IMFS_fifo_t in _imfs: 364_imfs.IMFS_fifo_t_swigregister(IMFS_fifo_t) 365class IMFS_generic_t(object): 366 r"""Proxy of C IMFS_generic_t struct.""" 367 368 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") 369 __repr__ = _swig_repr 370 Node = property(_imfs.IMFS_generic_t_Node_get, _imfs.IMFS_generic_t_Node_set, doc=r"""Node : IMFS_jnode_t""") 371 context = property(_imfs.IMFS_generic_t_context_get, _imfs.IMFS_generic_t_context_set, doc=r"""context : p.void""") 372 373 def __init__(self): 374 r"""__init__(IMFS_generic_t self) -> IMFS_generic_t""" 375 _imfs.IMFS_generic_t_swiginit(self, _imfs.new_IMFS_generic_t()) 376 __swig_destroy__ = _imfs.delete_IMFS_generic_t 377 378# Register IMFS_generic_t in _imfs: 379_imfs.IMFS_generic_t_swigregister(IMFS_generic_t) 380class IMFS_linearfile_context(object): 381 r"""Proxy of C IMFS_linearfile_context struct.""" 382 383 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") 384 __repr__ = _swig_repr 385 data = property(_imfs.IMFS_linearfile_context_data_get, _imfs.IMFS_linearfile_context_data_set, doc=r"""data : p.q(const).void""") 386 size = property(_imfs.IMFS_linearfile_context_size_get, _imfs.IMFS_linearfile_context_size_set, doc=r"""size : size_t""") 387 388 def __init__(self): 389 r"""__init__(IMFS_linearfile_context self) -> IMFS_linearfile_context""" 390 _imfs.IMFS_linearfile_context_swiginit(self, _imfs.new_IMFS_linearfile_context()) 391 __swig_destroy__ = _imfs.delete_IMFS_linearfile_context 392 393# Register IMFS_linearfile_context in _imfs: 394_imfs.IMFS_linearfile_context_swigregister(IMFS_linearfile_context) 395 396def IMFS_iop_to_node(iop): 397 r""" 398 IMFS_iop_to_node(rtems_libio_t const * iop) -> IMFS_jnode_tt 399 400 Parameters 401 ---------- 402 iop: rtems_libio_t const * 403 404 """ 405 return _imfs.IMFS_iop_to_node(iop) 406 407def IMFS_iop_to_directory(iop): 408 r""" 409 IMFS_iop_to_directory(rtems_libio_t const * iop) -> IMFS_directory_t 410 411 Parameters 412 ---------- 413 iop: rtems_libio_t const * 414 415 """ 416 return _imfs.IMFS_iop_to_directory(iop) 417 418def IMFS_iop_to_device(iop): 419 r""" 420 IMFS_iop_to_device(rtems_libio_t const * iop) -> IMFS_device_t 421 422 Parameters 423 ---------- 424 iop: rtems_libio_t const * 425 426 """ 427 return _imfs.IMFS_iop_to_device(iop) 428 429def IMFS_iop_to_file(iop): 430 r""" 431 IMFS_iop_to_file(rtems_libio_t const * iop) -> IMFS_file_t 432 433 Parameters 434 ---------- 435 iop: rtems_libio_t const * 436 437 """ 438 return _imfs.IMFS_iop_to_file(iop) 439 440def IMFS_iop_to_memfile(iop): 441 r""" 442 IMFS_iop_to_memfile(rtems_libio_t const * iop) -> IMFS_memfile_t 443 444 Parameters 445 ---------- 446 iop: rtems_libio_t const * 447 448 """ 449 return _imfs.IMFS_iop_to_memfile(iop) 450class IMFS_mknod_controls(object): 451 r"""Proxy of C IMFS_mknod_controls struct.""" 452 453 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") 454 __repr__ = _swig_repr 455 directory = property(_imfs.IMFS_mknod_controls_directory_get, _imfs.IMFS_mknod_controls_directory_set, doc=r"""directory : p.q(const).IMFS_mknod_control""") 456 device = property(_imfs.IMFS_mknod_controls_device_get, _imfs.IMFS_mknod_controls_device_set, doc=r"""device : p.q(const).IMFS_mknod_control""") 457 file = property(_imfs.IMFS_mknod_controls_file_get, _imfs.IMFS_mknod_controls_file_set, doc=r"""file : p.q(const).IMFS_mknod_control""") 458 fifo = property(_imfs.IMFS_mknod_controls_fifo_get, _imfs.IMFS_mknod_controls_fifo_set, doc=r"""fifo : p.q(const).IMFS_mknod_control""") 459 460 def __init__(self): 461 r"""__init__(IMFS_mknod_controls self) -> IMFS_mknod_controls""" 462 _imfs.IMFS_mknod_controls_swiginit(self, _imfs.new_IMFS_mknod_controls()) 463 __swig_destroy__ = _imfs.delete_IMFS_mknod_controls 464 465# Register IMFS_mknod_controls in _imfs: 466_imfs.IMFS_mknod_controls_swigregister(IMFS_mknod_controls) 467class IMFS_fs_info_t(object): 468 r"""Proxy of C IMFS_fs_info_t struct.""" 469 470 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") 471 __repr__ = _swig_repr 472 Root_directory = property(_imfs.IMFS_fs_info_t_Root_directory_get, _imfs.IMFS_fs_info_t_Root_directory_set, doc=r"""Root_directory : IMFS_directory_t""") 473 mknod_controls = property(_imfs.IMFS_fs_info_t_mknod_controls_get, _imfs.IMFS_fs_info_t_mknod_controls_set, doc=r"""mknod_controls : p.q(const).IMFS_mknod_controls""") 474 475 def __init__(self): 476 r"""__init__(IMFS_fs_info_t self) -> IMFS_fs_info_t""" 477 _imfs.IMFS_fs_info_t_swiginit(self, _imfs.new_IMFS_fs_info_t()) 478 __swig_destroy__ = _imfs.delete_IMFS_fs_info_t 479 480# Register IMFS_fs_info_t in _imfs: 481_imfs.IMFS_fs_info_t_swigregister(IMFS_fs_info_t) 482class IMFS_mount_data(object): 483 r"""Proxy of C IMFS_mount_data struct.""" 484 485 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") 486 __repr__ = _swig_repr 487 fs_info = property(_imfs.IMFS_mount_data_fs_info_get, _imfs.IMFS_mount_data_fs_info_set, doc=r"""fs_info : p.IMFS_fs_info_t""") 488 ops = property(_imfs.IMFS_mount_data_ops_get, _imfs.IMFS_mount_data_ops_set, doc=r"""ops : p.q(const).rtems_filesystem_operations_table""") 489 mknod_controls = property(_imfs.IMFS_mount_data_mknod_controls_get, _imfs.IMFS_mount_data_mknod_controls_set, doc=r"""mknod_controls : p.q(const).IMFS_mknod_controls""") 490 491 def __init__(self): 492 r"""__init__(IMFS_mount_data self) -> IMFS_mount_data""" 493 _imfs.IMFS_mount_data_swiginit(self, _imfs.new_IMFS_mount_data()) 494 __swig_destroy__ = _imfs.delete_IMFS_mount_data 495 496# Register IMFS_mount_data in _imfs: 497_imfs.IMFS_mount_data_swigregister(IMFS_mount_data) 498 499def IMFS_initialize(mt_entry, data): 500 r""" 501 IMFS_initialize(rtems_filesystem_mount_table_entry_t * mt_entry, void const * data) -> int 502 503 Parameters 504 ---------- 505 mt_entry: rtems_filesystem_mount_table_entry_t * 506 data: void const * 507 508 """ 509 return _imfs.IMFS_initialize(mt_entry, data) 510 511def IMFS_initialize_support(mt_entry, data): 512 r""" 513 IMFS_initialize_support(rtems_filesystem_mount_table_entry_t * mt_entry, void const * data) -> int 514 515 Parameters 516 ---------- 517 mt_entry: rtems_filesystem_mount_table_entry_t * 518 data: void const * 519 520 """ 521 return _imfs.IMFS_initialize_support(mt_entry, data) 522 523def IMFS_fsunmount(mt_entry): 524 r"""Unmount this instance of IMFS.""" 525 return _imfs.IMFS_fsunmount(mt_entry) 526 527def rtems_tarfs_load(mountpoint, tar_image, tar_size): 528 r""" 529 RTEMS load tarfs. 530 531 This file implements the "mount" procedure for tar-based IMFS 532 extensions. The TAR is not actually mounted under the IMFS. 533 Directories from the TAR file are created as usual in the IMFS. 534 File entries are created as IMFS_LINEAR_FILE nodes with their nods 535 pointing to addresses in the TAR image. 536 537 Here we create the mountpoint directory and load the tarfs at 538 that node. Once the IMFS has been mounted, we work through the 539 tar image and perform as follows: 540 - For directories, simply call mkdir(). The IMFS creates nodes as 541 needed. 542 - For files, we make our own calls to IMFS eval_for_make and 543 create_node. 544 545 TAR file format: 546 547 .. code-block:: c++ 548 549 Offset Length Contents 550 0 100 bytes File name ('\0' terminated, 99 maxmum length) 551 100 8 bytes File mode (in octal ascii) 552 108 8 bytes User ID (in octal ascii) 553 116 8 bytes Group ID (in octal ascii) 554 124 12 bytes File size (s) (in octal ascii) 555 136 12 bytes Modify time (in octal ascii) 556 148 8 bytes Header checksum (in octal ascii) 557 156 1 bytes Link flag 558 157 100 bytes Linkname ('\0' terminated, 99 maxmum length) 559 257 8 bytes Magic PAX ("ustar\0" + 2 bytes padding) 560 257 8 bytes Magic GNU tar ("ustar \0") 561 265 32 bytes User name ('\0' terminated, 31 maxmum length) 562 297 32 bytes Group name ('\0' terminated, 31 maxmum length) 563 329 8 bytes Major device ID (in octal ascii) 564 337 8 bytes Minor device ID (in octal ascii) 565 345 167 bytes Padding 566 512 (s+p) bytes File contents (s+p) := (((s) + 511) & ~511), 567 round up to 512 bytes 568 569 Checksum: 570 571 .. code-block:: c++ 572 573 int i, sum; 574 char *header = tar_header_pointer; 575 576 sum = 0; 577 for (i = 0; i < 512; i++) 578 sum += 0xFF & header[i]; 579 """ 580 return _imfs.rtems_tarfs_load(mountpoint, tar_image, tar_size) 581 582def IMFS_node_destroy(node): 583 r"""Destroy an IMFS node.""" 584 return _imfs.IMFS_node_destroy(node) 585 586def IMFS_node_clone(loc): 587 r"""Clone an IMFS node.""" 588 return _imfs.IMFS_node_clone(loc) 589 590def IMFS_node_free(loc): 591 r"""Free an IMFS node.""" 592 return _imfs.IMFS_node_free(loc) 593 594def IMFS_stat(loc, buf): 595 r""" 596 Perform a status processing for the IMFS. 597 598 This routine provides a stat for the IMFS file system. 599 """ 600 return _imfs.IMFS_stat(loc, buf) 601 602def IMFS_stat_file(loc, buf): 603 r""" 604 IMFS_stat_file(rtems_filesystem_location_info_t const * loc, struct stat * buf) -> int 605 606 Parameters 607 ---------- 608 loc: rtems_filesystem_location_info_t const * 609 buf: struct stat * 610 611 """ 612 return _imfs.IMFS_stat_file(loc, buf) 613 614def IMFS_eval_path(ctx): 615 r"""IMFS evaluation node support.""" 616 return _imfs.IMFS_eval_path(ctx) 617 618def IMFS_eval_path_devfs(ctx): 619 r"""IMFS device filesystem evaluation node support.""" 620 return _imfs.IMFS_eval_path_devfs(ctx) 621 622def IMFS_link(parentloc, targetloc, name, namelen): 623 r""" 624 Create a new IMFS link node. 625 626 The following rouine creates a new link node under parent with the 627 name given in name. The link node is set to point to the node at 628 to_loc. 629 """ 630 return _imfs.IMFS_link(parentloc, targetloc, name, namelen) 631 632def IMFS_chown(loc, owner, group): 633 r""" 634 Change the owner of IMFS. 635 636 This routine is the implementation of the chown() system 637 call for the IMFS. 638 """ 639 return _imfs.IMFS_chown(loc, owner, group) 640 641def IMFS_mknod(parentloc, name, namelen, mode, dev): 642 r""" 643 Create an IMFS node. 644 645 Routine to create a node in the IMFS file system. 646 """ 647 return _imfs.IMFS_mknod(parentloc, name, namelen, mode, dev) 648 649def IMFS_initialize_node(node, node_control, name, namelen, mode, arg): 650 r""" 651 IMFS_initialize_node(IMFS_jnode_tt node, IMFS_node_control node_control, char const * name, size_t namelen, mode_t mode, void * arg) -> IMFS_jnode_tt 652 653 Parameters 654 ---------- 655 node: IMFS_jnode_t * 656 node_control: IMFS_node_control const * 657 name: char const * 658 namelen: size_t 659 mode: mode_t 660 arg: void * 661 662 """ 663 return _imfs.IMFS_initialize_node(node, node_control, name, namelen, mode, arg) 664 665def IMFS_create_node(parentloc, node_control, node_size, name, namelen, mode, arg): 666 r""" 667 Create an IMFS node. 668 669 Create an IMFS filesystem node of an arbitrary type that is NOT 670 the root directory node. 671 """ 672 return _imfs.IMFS_create_node(parentloc, node_control, node_size, name, namelen, mode, arg) 673 674def IMFS_is_imfs_instance(loc): 675 r""" 676 IMFS_is_imfs_instance(rtems_filesystem_location_info_t const * loc) -> bool 677 678 Parameters 679 ---------- 680 loc: rtems_filesystem_location_info_t const * 681 682 """ 683 return _imfs.IMFS_is_imfs_instance(loc) 684 685def IMFS_node_preinitialize(node, node_control, name, namelen, mode): 686 r""" 687 Initializer for an IMFS node control. 688 689 :param handlers: The file system node handlers. 690 :param init: The node initialization method. 691 :param destroy: The node destruction method. 692 693 Initializer for an IMFS node. 694 695 Initialize the node control with IMFS_NODE_CONTROL_INITIALIZER(). 696 697 :type node_control: :py:class:`IMFS_node_control` 698 :param node_control: The node control of the IMFS node. 699 :type name: string 700 :param name: The name of the IMFS node. 701 :type namelen: int 702 :param namelen: The length of the name of the IMFS node. 703 :type mode: mode_t 704 :param mode: The mode of the IMFS node. 705 706 See also: IMFS_node_preinitialize(). 707 708 Preinitializes an IMFS node. 709 710 Initialize the node control with IMFS_NODE_CONTROL_INITIALIZER(). 711 712 :type node: :py:class:`IMFS_jnode_t` 713 :param node: The IMFS node to preinitialize. 714 :type node_control: :py:class:`IMFS_node_control` 715 :param node_control: The node control of the IMFS node. 716 :type name: string 717 :param name: The name of the IMFS node. 718 :type namelen: int 719 :param namelen: The length of the name of the IMFS node. 720 :type mode: mode_t 721 :param mode: The mode of the IMFS node. 722 723 See also: IMFS_NODE_INITIALIZER(). 724 """ 725 return _imfs.IMFS_node_preinitialize(node, node_control, name, namelen, mode) 726 727def IMFS_add_node(path, node, arg): 728 r""" 729 Adds an IMFS node. 730 731 Initialize the node with IMFS_NODE_INITIALIZER(), IMFS_node_preinitialize(), 732 IMFS_GENERIC_NODE_INITIALIZER(), or IMFS_generic_node_preinitialize(). 733 734 :type path: string 735 :param path: The path of parent directories for the IMFS node to add. 736 :type node: :py:class:`IMFS_jnode_t` 737 :param node: The IMFS node to add. 738 :type arg: void 739 :param arg: The argument passed to the node initialization method. 740 """ 741 return _imfs.IMFS_add_node(path, node, arg) 742 743def IMFS_make_node(path, mode, node_control, node_size, context): 744 r""" 745 IMFS_make_node(char const * path, mode_t mode, IMFS_node_control node_control, size_t node_size, void * context) -> int 746 747 Parameters 748 ---------- 749 path: char const * 750 mode: mode_t 751 node_control: IMFS_node_control const * 752 node_size: size_t 753 context: void * 754 755 """ 756 return _imfs.IMFS_make_node(path, mode, node_control, node_size, context) 757 758def IMFS_make_linearfile(path, mode, data, size): 759 r""" 760 Makes a linear IMFS file. 761 762 :type path: string 763 :param path: The path to the new linear IMFS file. 764 :type mode: mode_t 765 :param mode: The file mode permissions. S_IFREG is set by the function. 766 :type data: void 767 :param data: The begin of linear file data area. 768 :type size: int 769 :param size: The size of the linear file data area in bytes. 770 """ 771 return _imfs.IMFS_make_linearfile(path, mode, data, size) 772 773def IMFS_generic_node_preinitialize(node, node_control, name, namelen, mode): 774 r""" 775 Initializer for a generic node control. 776 777 :param handlers: The file system node handlers. 778 :param init: The node initialization method. 779 :param destroy: The node destruction method. 780 781 Initializer for a generic node. 782 783 Initialize the node control with IMFS_GENERIC_CONTROL_INITIALIZER(). 784 785 :type node_control: :py:class:`IMFS_node_control` 786 :param node_control: The node control of the IMFS generic node. 787 :type name: string 788 :param name: The name of the IMFS generic node. 789 :type namelen: int 790 :param namelen: The length of the name of the IMFS generic node. 791 :type mode: mode_t 792 :param mode: The mode of the IMFS generic node. 793 794 Preinitializes a generic IMFS node. 795 796 Initialize the node control with IMFS_GENERIC_CONTROL_INITIALIZER(). 797 798 :type node: :py:class:`IMFS_generic_t` 799 :param node: The generic IMFS node to preinitialize. 800 :type node_control: :py:class:`IMFS_node_control` 801 :param node_control: The node control of the generic IMFS node. 802 :type name: string 803 :param name: The name of the generic IMFS node. 804 :type namelen: int 805 :param namelen: The length of the name of the generic IMFS node. 806 :type mode: mode_t 807 :param mode: The mode of the generic IMFS node. 808 809 See also: IMFS_GENERIC_NODE_INITIALIZER(). 810 """ 811 return _imfs.IMFS_generic_node_preinitialize(node, node_control, name, namelen, mode) 812 813def IMFS_make_generic_node(path, mode, node_control, context): 814 r""" 815 Makes a generic IMFS node. 816 817 :type path: string, in 818 :param path: The path to the new generic IMFS node. 819 :type mode: mode_t, in 820 :param mode: The node mode. 821 :type node_control: :py:class:`IMFS_node_control`, in 822 :param node_control: The node control. 823 :type context: void, in 824 :param context: The node control handler context. 825 826 .. code-block:: c++ 827 828 #include <sys/stat.h> 829 #include <assert.h> 830 #include <fcntl.h> 831 832 #include <rtems/imfs.h> 833 834 static const rtems_filesystem_file_handlers_r some_node_handlers = { 835 ... 836 }; 837 838 static IMFS_jnode_t *some_node_init(IMFS_jnode_t *node, void *arg) 839 { 840 void *context; 841 842 node = IMFS_node_initialize_generic(node, arg); 843 context = IMFS_generic_get_context_by_node(node); 844 845 return node; 846 } 847 848 static void some_node_destroy(IMFS_jnode_t *node) 849 { 850 void *context = IMFS_generic_get_context_by_node(node); 851 852 IMFS_node_destroy_default(node); 853 } 854 855 static const IMFS_node_control 856 some_node_control = IMFS_GENERIC_CONTROL_INITIALIZER( 857 &some_node_handlers, 858 some_node_init, 859 some_node_destroy 860 ); 861 862 void example(void *some_node_context) 863 { 864 int rv; 865 866 rv = IMFS_make_generic_node( 867 "/path/to/some/generic/node", 868 S_IFCHR | S_IRWXU | S_IRWXG | S_IRWXO, 869 &some_node_control, 870 some_node_context 871 ); 872 assert(rv == 0); 873 } 874 """ 875 return _imfs.IMFS_make_generic_node(path, mode, node_control, context) 876 877def IMFS_mount(mt_entry, data): 878 r"""Mount an IMFS.""" 879 return _imfs.IMFS_mount(mt_entry, data) 880 881def IMFS_unmount(mt_entry): 882 r"""Unmount an IMFS.""" 883 return _imfs.IMFS_unmount(mt_entry) 884 885def IMFS_memfile_write(memfile, start, source, length): 886 887 return _imfs.IMFS_memfile_write(memfile, start, source, length) 888 889def device_open(iop, pathname, oflag, mode): 890 891 return _imfs.device_open(iop, pathname, oflag, mode) 892 893def device_close(iop): 894 r""" 895 device_close(rtems_libio_t * iop) -> int 896 897 Parameters 898 ---------- 899 iop: rtems_libio_t * 900 901 """ 902 return _imfs.device_close(iop) 903 904def device_read(iop, buffer, count): 905 r""" 906 device_read(rtems_libio_t * iop, void * buffer, size_t count) -> ssize_t 907 908 Parameters 909 ---------- 910 iop: rtems_libio_t * 911 buffer: void * 912 count: size_t 913 914 """ 915 return _imfs.device_read(iop, buffer, count) 916 917def device_write(iop, buffer, count): 918 r""" 919 device_write(rtems_libio_t * iop, void const * buffer, size_t count) -> ssize_t 920 921 Parameters 922 ---------- 923 iop: rtems_libio_t * 924 buffer: void const * 925 count: size_t 926 927 """ 928 return _imfs.device_write(iop, buffer, count) 929 930def device_ioctl(iop, command, buffer): 931 r""" 932 device_ioctl(rtems_libio_t * iop, ioctl_command_t command, void * buffer) -> int 933 934 Parameters 935 ---------- 936 iop: rtems_libio_t * 937 command: ioctl_command_t 938 buffer: void * 939 940 """ 941 return _imfs.device_ioctl(iop, command, buffer) 942 943def device_ftruncate(iop, length): 944 r""" 945 device_ftruncate(rtems_libio_t * iop, off_t length) -> int 946 947 Parameters 948 ---------- 949 iop: rtems_libio_t * 950 length: off_t 951 952 """ 953 return _imfs.device_ftruncate(iop, length) 954 955def IMFS_utimens(loc, times): 956 r""" 957 Set IMFS file access and modification times. 958 959 960 This routine is the implementation of the utime() system 961 call for the IMFS. 962 """ 963 return _imfs.IMFS_utimens(loc, times) 964 965def IMFS_fchmod(loc, mode): 966 r"""Change the IMFS file mode.""" 967 return _imfs.IMFS_fchmod(loc, mode) 968 969def IMFS_symlink(parentloc, name, namelen, target): 970 r""" 971 Create a new IMFS symbolic link node. 972 973 The following rouine creates a new symbolic link node under parent 974 with the name given in name. The node is set to point to the node at 975 to_loc. 976 """ 977 return _imfs.IMFS_symlink(parentloc, name, namelen, target) 978 979def IMFS_readlink(loc, buf, bufsize): 980 r""" 981 Put IMFS symbolic link into buffer. 982 983 The following rouine puts the symbolic links destination name into 984 buff. 985 """ 986 return _imfs.IMFS_readlink(loc, buf, bufsize) 987 988def IMFS_rename(oldparentloc, oldloc, newparentloc, name, namelen): 989 r""" 990 Rename the IMFS. 991 992 The following rouine creates a new link node under parent with the 993 name given in name and removes the old. 994 """ 995 return _imfs.IMFS_rename(oldparentloc, oldloc, newparentloc, name, namelen) 996 997def IMFS_rmnod(parentloc, loc): 998 r""" 999 IMFS node removal handler. 1000 1001 This file contains the handler used to remove a node when a file type 1002 does not require special actions. 1003 """ 1004 return _imfs.IMFS_rmnod(parentloc, loc) 1005 1006def IMFS_Set_handlers(loc): 1007 r""" 1008 IMFS_Set_handlers(rtems_filesystem_location_info_t * loc) 1009 1010 Parameters 1011 ---------- 1012 loc: rtems_filesystem_location_info_t * 1013 1014 """ 1015 return _imfs.IMFS_Set_handlers(loc) 1016 1017def IMFS_add_to_directory(dir_node, entry_node): 1018 r""" 1019 IMFS_add_to_directory(IMFS_jnode_tt dir_node, IMFS_jnode_tt entry_node) 1020 1021 Parameters 1022 ---------- 1023 dir_node: IMFS_jnode_t * 1024 entry_node: IMFS_jnode_t * 1025 1026 """ 1027 return _imfs.IMFS_add_to_directory(dir_node, entry_node) 1028 1029def IMFS_remove_from_directory(node): 1030 r""" 1031 IMFS_remove_from_directory(IMFS_jnode_tt node) 1032 1033 Parameters 1034 ---------- 1035 node: IMFS_jnode_t * 1036 1037 """ 1038 return _imfs.IMFS_remove_from_directory(node) 1039 1040def IMFS_is_directory(node): 1041 r""" 1042 IMFS_is_directory(IMFS_jnode_tt node) -> bool 1043 1044 Parameters 1045 ---------- 1046 node: IMFS_jnode_t const * 1047 1048 """ 1049 return _imfs.IMFS_is_directory(node) 1050IMFS_STAT_FMT_HARD_LINK = _imfs.IMFS_STAT_FMT_HARD_LINK 1051 1052 1053def IMFS_is_hard_link(mode): 1054 r""" 1055 IMFS_is_hard_link(mode_t mode) -> bool 1056 1057 Parameters 1058 ---------- 1059 mode: mode_t 1060 1061 """ 1062 return _imfs.IMFS_is_hard_link(mode) 1063 1064def IMFS_node_to_ino(node): 1065 r""" 1066 IMFS_node_to_ino(IMFS_jnode_tt node) -> ino_t 1067 1068 Parameters 1069 ---------- 1070 node: IMFS_jnode_t const * 1071 1072 """ 1073 return _imfs.IMFS_node_to_ino(node) 1074 1075def IMFS_generic_get_context_by_node(node): 1076 1077 return _imfs.IMFS_generic_get_context_by_node(node) 1078 1079def IMFS_generic_get_context_by_location(loc): 1080 r""" 1081 IMFS_generic_get_context_by_location(rtems_filesystem_location_info_t const * loc) -> void * 1082 1083 Parameters 1084 ---------- 1085 loc: rtems_filesystem_location_info_t const * 1086 1087 """ 1088 return _imfs.IMFS_generic_get_context_by_location(loc) 1089 1090def IMFS_generic_get_context_by_iop(iop): 1091 r""" 1092 IMFS_generic_get_context_by_iop(rtems_libio_t const * iop) -> void * 1093 1094 Parameters 1095 ---------- 1096 iop: rtems_libio_t const * 1097 1098 """ 1099 return _imfs.IMFS_generic_get_context_by_iop(iop) 1100 1101def IMFS_generic_get_device_identifier_by_node(node): 1102 r""" 1103 IMFS_generic_get_device_identifier_by_node(IMFS_jnode_tt node) -> dev_t 1104 1105 Parameters 1106 ---------- 1107 node: IMFS_jnode_t const * 1108 1109 """ 1110 return _imfs.IMFS_generic_get_device_identifier_by_node(node) 1111 1112IMFS_mknod_control_dir_default = cvar.IMFS_mknod_control_dir_default 1113IMFS_mknod_control_dir_minimal = cvar.IMFS_mknod_control_dir_minimal 1114IMFS_mknod_control_device = cvar.IMFS_mknod_control_device 1115IMFS_mknod_control_memfile = cvar.IMFS_mknod_control_memfile 1116IMFS_node_control_linfile = cvar.IMFS_node_control_linfile 1117IMFS_mknod_control_fifo = cvar.IMFS_mknod_control_fifo 1118IMFS_mknod_control_enosys = cvar.IMFS_mknod_control_enosys 1119IMFS_LIMITS_AND_OPTIONS = cvar.IMFS_LIMITS_AND_OPTIONS
IMFS "memfile" information
The data structure for the in-memory "memfiles" is based on classic UNIX.
block_ptr is a pointer to a block of IMFS_MEMFILE_BYTES_PER_BLOCK in length which could be data or a table of pointers to blocks.
Setting IMFS_MEMFILE_BYTES_PER_BLOCK to different values has a significant impact on the maximum file size supported as well as the amount of memory wasted due to internal file fragmentation. The following is a list of maximum file sizes based on various settings
max_filesize with blocks of 16 is 1,328
max_filesize with blocks of 32 is 18,656
max_filesize with blocks of 64 is 279,488
max_filesize with blocks of 128 is 4,329,344
max_filesize with blocks of 256 is 68,173,568
max_filesize with blocks of 512 is 1,082,195,456
84def IMFS_node_initialize_default(node, arg): 85 r""" 86 Returns the node and does nothing else. 87 88 :type node: :py:class:`IMFS_jnode_t`, in 89 :param node: The IMFS node. 90 :type arg: void, in 91 :param arg: The user provided argument pointer. It is not used. 92 93 See also: IMFS_node_control. 94 """ 95 return _imfs.IMFS_node_initialize_default(node, arg)
Returns the node and does nothing else.
Parameters
- node: The IMFS node.
- arg: The user provided argument pointer. It is not used.
See also: IMFS_node_control.
97def IMFS_node_initialize_directory(node, arg): 98 r""" 99 IMFS_node_initialize_directory(IMFS_jnode_tt node, void * arg) -> IMFS_jnode_tt 100 101 Parameters 102 ---------- 103 node: IMFS_jnode_t * 104 arg: void * 105 106 """ 107 return _imfs.IMFS_node_initialize_directory(node, arg)
IMFS_node_initialize_directory(IMFS_jnode_tt node, void * arg) -> IMFS_jnode_tt
Parameters
node: IMFS_jnode_t * arg: void *
109def IMFS_node_initialize_generic(node, arg): 110 r""" 111 Returns the node and sets the generic node context. 112 113 :type node: :py:class:`IMFS_jnode_t`, in 114 :param node: The IMFS node. 115 :type arg: void, in 116 :param arg: The user provided argument pointer. It must contain the 117 generic context. 118 119 See also: IMFS_node_control. 120 """ 121 return _imfs.IMFS_node_initialize_generic(node, arg)
Returns the node and sets the generic node context.
Parameters
- node: The IMFS node.
- arg: The user provided argument pointer. It must contain the generic context.
See also: IMFS_node_control.
123def IMFS_node_remove_default(node): 124 r""" 125 Returns the node and does nothing else. 126 127 :type node: :py:class:`IMFS_jnode_t`, in 128 :param node: The IMFS node. 129 130 See also: IMFS_node_control. 131 """ 132 return _imfs.IMFS_node_remove_default(node)
Returns the node and does nothing else.
Parameters
- node: The IMFS node.
See also: IMFS_node_control.
134def IMFS_node_remove_directory(node): 135 r""" 136 IMFS_node_remove_directory(IMFS_jnode_tt node) -> IMFS_jnode_tt 137 138 Parameters 139 ---------- 140 node: IMFS_jnode_t * 141 142 """ 143 return _imfs.IMFS_node_remove_directory(node)
IMFS_node_remove_directory(IMFS_jnode_tt node) -> IMFS_jnode_tt
Parameters
node: IMFS_jnode_t *
145def IMFS_node_destroy_default(node): 146 r""" 147 Frees the node. 148 149 :type node: :py:class:`IMFS_jnode_t`, in 150 :param node: The IMFS node. 151 152 See also: IMFS_node_control. 153 """ 154 return _imfs.IMFS_node_destroy_default(node)
Frees the node.
Parameters
- node: The IMFS node.
See also: IMFS_node_control.
156def IMFS_do_nothing_destroy(node): 157 r""" 158 Does nothing. 159 160 :type node: :py:class:`IMFS_jnode_t` 161 :param node: The IMFS node. 162 163 See also: IMFS_node_control. 164 """ 165 return _imfs.IMFS_do_nothing_destroy(node)
Does nothing.
Parameters
- node: The IMFS node.
See also: IMFS_node_control.
166class IMFS_node_control(object): 167 r"""IMFS node control.""" 168 169 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") 170 __repr__ = _swig_repr 171 handlers = property(_imfs.IMFS_node_control_handlers_get, _imfs.IMFS_node_control_handlers_set, doc=r"""handlers : p.q(const).rtems_filesystem_file_handlers_r""") 172 node_initialize = property(_imfs.IMFS_node_control_node_initialize_get, _imfs.IMFS_node_control_node_initialize_set, doc=r"""node_initialize : IMFS_node_control_initialize""") 173 node_remove = property(_imfs.IMFS_node_control_node_remove_get, _imfs.IMFS_node_control_node_remove_set, doc=r"""node_remove : IMFS_node_control_remove""") 174 node_destroy = property(_imfs.IMFS_node_control_node_destroy_get, _imfs.IMFS_node_control_node_destroy_set, doc=r"""node_destroy : IMFS_node_control_destroy""") 175 176 def __init__(self): 177 r"""__init__(IMFS_node_control self) -> IMFS_node_control""" 178 _imfs.IMFS_node_control_swiginit(self, _imfs.new_IMFS_node_control()) 179 __swig_destroy__ = _imfs.delete_IMFS_node_control
IMFS node control.
176 def __init__(self): 177 r"""__init__(IMFS_node_control self) -> IMFS_node_control""" 178 _imfs.IMFS_node_control_swiginit(self, _imfs.new_IMFS_node_control())
__init__(IMFS_node_control self) -> IMFS_node_control
169 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
The membership flag
186class IMFS_mknod_control(object): 187 r"""Proxy of C IMFS_mknod_control struct.""" 188 189 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") 190 __repr__ = _swig_repr 191 node_control = property(_imfs.IMFS_mknod_control_node_control_get, _imfs.IMFS_mknod_control_node_control_set, doc=r"""node_control : IMFS_node_control""") 192 node_size = property(_imfs.IMFS_mknod_control_node_size_get, _imfs.IMFS_mknod_control_node_size_set, doc=r"""node_size : size_t""") 193 194 def __init__(self): 195 r"""__init__(IMFS_mknod_control self) -> IMFS_mknod_control""" 196 _imfs.IMFS_mknod_control_swiginit(self, _imfs.new_IMFS_mknod_control()) 197 __swig_destroy__ = _imfs.delete_IMFS_mknod_control
Proxy of C IMFS_mknod_control struct.
194 def __init__(self): 195 r"""__init__(IMFS_mknod_control self) -> IMFS_mknod_control""" 196 _imfs.IMFS_mknod_control_swiginit(self, _imfs.new_IMFS_mknod_control())
__init__(IMFS_mknod_control self) -> IMFS_mknod_control
189 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
The membership flag
201class IMFS_jnode_tt(object): 202 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") 203 __repr__ = _swig_repr 204 Node = property(_imfs.IMFS_jnode_tt_Node_get, _imfs.IMFS_jnode_tt_Node_set, doc=r"""Node : rtems_chain_node""") 205 Parent = property(_imfs.IMFS_jnode_tt_Parent_get, _imfs.IMFS_jnode_tt_Parent_set, doc=r"""Parent : p.IMFS_jnode_t""") 206 name = property(_imfs.IMFS_jnode_tt_name_get, _imfs.IMFS_jnode_tt_name_set, doc=r"""name : p.q(const).char""") 207 namelen = property(_imfs.IMFS_jnode_tt_namelen_get, _imfs.IMFS_jnode_tt_namelen_set, doc=r"""namelen : uint16_t""") 208 st_mode = property(_imfs.IMFS_jnode_tt_st_mode_get, _imfs.IMFS_jnode_tt_st_mode_set, doc=r"""st_mode : mode_t""") 209 reference_count = property(_imfs.IMFS_jnode_tt_reference_count_get, _imfs.IMFS_jnode_tt_reference_count_set, doc=r"""reference_count : unsigned short""") 210 st_nlink = property(_imfs.IMFS_jnode_tt_st_nlink_get, _imfs.IMFS_jnode_tt_st_nlink_set, doc=r"""st_nlink : nlink_t""") 211 st_uid = property(_imfs.IMFS_jnode_tt_st_uid_get, _imfs.IMFS_jnode_tt_st_uid_set, doc=r"""st_uid : uid_t""") 212 st_gid = property(_imfs.IMFS_jnode_tt_st_gid_get, _imfs.IMFS_jnode_tt_st_gid_set, doc=r"""st_gid : gid_t""") 213 stat_atime = property(_imfs.IMFS_jnode_tt_stat_atime_get, _imfs.IMFS_jnode_tt_stat_atime_set, doc=r"""stat_atime : time_t""") 214 stat_mtime = property(_imfs.IMFS_jnode_tt_stat_mtime_get, _imfs.IMFS_jnode_tt_stat_mtime_set, doc=r"""stat_mtime : time_t""") 215 stat_ctime = property(_imfs.IMFS_jnode_tt_stat_ctime_get, _imfs.IMFS_jnode_tt_stat_ctime_set, doc=r"""stat_ctime : time_t""") 216 control = property(_imfs.IMFS_jnode_tt_control_get, _imfs.IMFS_jnode_tt_control_set, doc=r"""control : p.q(const).IMFS_node_control""") 217 218 def __init__(self): 219 r"""__init__(IMFS_jnode_tt self) -> IMFS_jnode_tt""" 220 _imfs.IMFS_jnode_tt_swiginit(self, _imfs.new_IMFS_jnode_tt()) 221 __swig_destroy__ = _imfs.delete_IMFS_jnode_tt
218 def __init__(self): 219 r"""__init__(IMFS_jnode_tt self) -> IMFS_jnode_tt""" 220 _imfs.IMFS_jnode_tt_swiginit(self, _imfs.new_IMFS_jnode_tt())
__init__(IMFS_jnode_tt self) -> IMFS_jnode_tt
202 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
The membership flag
225class IMFS_directory_t(object): 226 r"""Proxy of C IMFS_directory_t struct.""" 227 228 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") 229 __repr__ = _swig_repr 230 Node = property(_imfs.IMFS_directory_t_Node_get, _imfs.IMFS_directory_t_Node_set, doc=r"""Node : IMFS_jnode_t""") 231 Entries = property(_imfs.IMFS_directory_t_Entries_get, _imfs.IMFS_directory_t_Entries_set, doc=r"""Entries : rtems_chain_control""") 232 mt_fs = property(_imfs.IMFS_directory_t_mt_fs_get, _imfs.IMFS_directory_t_mt_fs_set, doc=r"""mt_fs : p.rtems_filesystem_mount_table_entry_t""") 233 234 def __init__(self): 235 r"""__init__(IMFS_directory_t self) -> IMFS_directory_t""" 236 _imfs.IMFS_directory_t_swiginit(self, _imfs.new_IMFS_directory_t()) 237 __swig_destroy__ = _imfs.delete_IMFS_directory_t
Proxy of C IMFS_directory_t struct.
234 def __init__(self): 235 r"""__init__(IMFS_directory_t self) -> IMFS_directory_t""" 236 _imfs.IMFS_directory_t_swiginit(self, _imfs.new_IMFS_directory_t())
__init__(IMFS_directory_t self) -> IMFS_directory_t
228 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
The membership flag
241class IMFS_device_t(object): 242 r"""Proxy of C IMFS_device_t struct.""" 243 244 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") 245 __repr__ = _swig_repr 246 Node = property(_imfs.IMFS_device_t_Node_get, _imfs.IMFS_device_t_Node_set, doc=r"""Node : IMFS_jnode_t""") 247 major = property(_imfs.IMFS_device_t_major_get, _imfs.IMFS_device_t_major_set, doc=r"""major : rtems_device_major_number""") 248 minor = property(_imfs.IMFS_device_t_minor_get, _imfs.IMFS_device_t_minor_set, doc=r"""minor : rtems_device_minor_number""") 249 250 def __init__(self): 251 r"""__init__(IMFS_device_t self) -> IMFS_device_t""" 252 _imfs.IMFS_device_t_swiginit(self, _imfs.new_IMFS_device_t()) 253 __swig_destroy__ = _imfs.delete_IMFS_device_t
Proxy of C IMFS_device_t struct.
250 def __init__(self): 251 r"""__init__(IMFS_device_t self) -> IMFS_device_t""" 252 _imfs.IMFS_device_t_swiginit(self, _imfs.new_IMFS_device_t())
__init__(IMFS_device_t self) -> IMFS_device_t
244 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
The membership flag
257class IMFS_link_t(object): 258 r"""Proxy of C IMFS_link_t struct.""" 259 260 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") 261 __repr__ = _swig_repr 262 Node = property(_imfs.IMFS_link_t_Node_get, _imfs.IMFS_link_t_Node_set, doc=r"""Node : IMFS_jnode_t""") 263 link_node = property(_imfs.IMFS_link_t_link_node_get, _imfs.IMFS_link_t_link_node_set, doc=r"""link_node : p.IMFS_jnode_t""") 264 265 def __init__(self): 266 r"""__init__(IMFS_link_t self) -> IMFS_link_t""" 267 _imfs.IMFS_link_t_swiginit(self, _imfs.new_IMFS_link_t()) 268 __swig_destroy__ = _imfs.delete_IMFS_link_t
Proxy of C IMFS_link_t struct.
265 def __init__(self): 266 r"""__init__(IMFS_link_t self) -> IMFS_link_t""" 267 _imfs.IMFS_link_t_swiginit(self, _imfs.new_IMFS_link_t())
__init__(IMFS_link_t self) -> IMFS_link_t
260 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
The membership flag
272class IMFS_sym_link_t(object): 273 r"""Proxy of C IMFS_sym_link_t struct.""" 274 275 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") 276 __repr__ = _swig_repr 277 Node = property(_imfs.IMFS_sym_link_t_Node_get, _imfs.IMFS_sym_link_t_Node_set, doc=r"""Node : IMFS_jnode_t""") 278 name = property(_imfs.IMFS_sym_link_t_name_get, _imfs.IMFS_sym_link_t_name_set, doc=r"""name : p.char""") 279 280 def __init__(self): 281 r"""__init__(IMFS_sym_link_t self) -> IMFS_sym_link_t""" 282 _imfs.IMFS_sym_link_t_swiginit(self, _imfs.new_IMFS_sym_link_t()) 283 __swig_destroy__ = _imfs.delete_IMFS_sym_link_t
Proxy of C IMFS_sym_link_t struct.
280 def __init__(self): 281 r"""__init__(IMFS_sym_link_t self) -> IMFS_sym_link_t""" 282 _imfs.IMFS_sym_link_t_swiginit(self, _imfs.new_IMFS_sym_link_t())
__init__(IMFS_sym_link_t self) -> IMFS_sym_link_t
275 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
The membership flag
287class IMFS_filebase_t(object): 288 r"""Proxy of C IMFS_filebase_t struct.""" 289 290 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") 291 __repr__ = _swig_repr 292 Node = property(_imfs.IMFS_filebase_t_Node_get, _imfs.IMFS_filebase_t_Node_set, doc=r"""Node : IMFS_jnode_t""") 293 size = property(_imfs.IMFS_filebase_t_size_get, _imfs.IMFS_filebase_t_size_set, doc=r"""size : size_t""") 294 295 def __init__(self): 296 r"""__init__(IMFS_filebase_t self) -> IMFS_filebase_t""" 297 _imfs.IMFS_filebase_t_swiginit(self, _imfs.new_IMFS_filebase_t()) 298 __swig_destroy__ = _imfs.delete_IMFS_filebase_t
Proxy of C IMFS_filebase_t struct.
295 def __init__(self): 296 r"""__init__(IMFS_filebase_t self) -> IMFS_filebase_t""" 297 _imfs.IMFS_filebase_t_swiginit(self, _imfs.new_IMFS_filebase_t())
__init__(IMFS_filebase_t self) -> IMFS_filebase_t
290 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
The membership flag
302class IMFS_memfile_t(object): 303 r"""Proxy of C IMFS_memfile_t struct.""" 304 305 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") 306 __repr__ = _swig_repr 307 File = property(_imfs.IMFS_memfile_t_File_get, _imfs.IMFS_memfile_t_File_set, doc=r"""File : IMFS_filebase_t""") 308 indirect = property(_imfs.IMFS_memfile_t_indirect_get, _imfs.IMFS_memfile_t_indirect_set, doc=r"""indirect : block_ptr""") 309 doubly_indirect = property(_imfs.IMFS_memfile_t_doubly_indirect_get, _imfs.IMFS_memfile_t_doubly_indirect_set, doc=r"""doubly_indirect : block_ptr""") 310 triply_indirect = property(_imfs.IMFS_memfile_t_triply_indirect_get, _imfs.IMFS_memfile_t_triply_indirect_set, doc=r"""triply_indirect : block_ptr""") 311 312 def __init__(self): 313 r"""__init__(IMFS_memfile_t self) -> IMFS_memfile_t""" 314 _imfs.IMFS_memfile_t_swiginit(self, _imfs.new_IMFS_memfile_t()) 315 __swig_destroy__ = _imfs.delete_IMFS_memfile_t
Proxy of C IMFS_memfile_t struct.
312 def __init__(self): 313 r"""__init__(IMFS_memfile_t self) -> IMFS_memfile_t""" 314 _imfs.IMFS_memfile_t_swiginit(self, _imfs.new_IMFS_memfile_t())
__init__(IMFS_memfile_t self) -> IMFS_memfile_t
305 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
The membership flag
319class IMFS_linearfile_t(object): 320 r"""Proxy of C IMFS_linearfile_t struct.""" 321 322 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") 323 __repr__ = _swig_repr 324 File = property(_imfs.IMFS_linearfile_t_File_get, _imfs.IMFS_linearfile_t_File_set, doc=r"""File : IMFS_filebase_t""") 325 direct = property(_imfs.IMFS_linearfile_t_direct_get, _imfs.IMFS_linearfile_t_direct_set, doc=r"""direct : block_p""") 326 327 def __init__(self): 328 r"""__init__(IMFS_linearfile_t self) -> IMFS_linearfile_t""" 329 _imfs.IMFS_linearfile_t_swiginit(self, _imfs.new_IMFS_linearfile_t()) 330 __swig_destroy__ = _imfs.delete_IMFS_linearfile_t
Proxy of C IMFS_linearfile_t struct.
327 def __init__(self): 328 r"""__init__(IMFS_linearfile_t self) -> IMFS_linearfile_t""" 329 _imfs.IMFS_linearfile_t_swiginit(self, _imfs.new_IMFS_linearfile_t())
__init__(IMFS_linearfile_t self) -> IMFS_linearfile_t
322 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
The membership flag
334class IMFS_file_t(object): 335 r"""Proxy of C IMFS_file_t struct.""" 336 337 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") 338 __repr__ = _swig_repr 339 Node = property(_imfs.IMFS_file_t_Node_get, _imfs.IMFS_file_t_Node_set, doc=r"""Node : IMFS_jnode_t""") 340 File = property(_imfs.IMFS_file_t_File_get, _imfs.IMFS_file_t_File_set, doc=r"""File : IMFS_filebase_t""") 341 Memfile = property(_imfs.IMFS_file_t_Memfile_get, _imfs.IMFS_file_t_Memfile_set, doc=r"""Memfile : IMFS_memfile_t""") 342 Linearfile = property(_imfs.IMFS_file_t_Linearfile_get, _imfs.IMFS_file_t_Linearfile_set, doc=r"""Linearfile : IMFS_linearfile_t""") 343 344 def __init__(self): 345 r"""__init__(IMFS_file_t self) -> IMFS_file_t""" 346 _imfs.IMFS_file_t_swiginit(self, _imfs.new_IMFS_file_t()) 347 __swig_destroy__ = _imfs.delete_IMFS_file_t
Proxy of C IMFS_file_t struct.
344 def __init__(self): 345 r"""__init__(IMFS_file_t self) -> IMFS_file_t""" 346 _imfs.IMFS_file_t_swiginit(self, _imfs.new_IMFS_file_t())
__init__(IMFS_file_t self) -> IMFS_file_t
337 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
The membership flag
351class IMFS_fifo_t(object): 352 r"""Proxy of C IMFS_fifo_t struct.""" 353 354 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") 355 __repr__ = _swig_repr 356 Node = property(_imfs.IMFS_fifo_t_Node_get, _imfs.IMFS_fifo_t_Node_set, doc=r"""Node : IMFS_jnode_t""") 357 pipe = property(_imfs.IMFS_fifo_t_pipe_get, _imfs.IMFS_fifo_t_pipe_set, doc=r"""pipe : p.pipe_control_t""") 358 359 def __init__(self): 360 r"""__init__(IMFS_fifo_t self) -> IMFS_fifo_t""" 361 _imfs.IMFS_fifo_t_swiginit(self, _imfs.new_IMFS_fifo_t()) 362 __swig_destroy__ = _imfs.delete_IMFS_fifo_t
Proxy of C IMFS_fifo_t struct.
359 def __init__(self): 360 r"""__init__(IMFS_fifo_t self) -> IMFS_fifo_t""" 361 _imfs.IMFS_fifo_t_swiginit(self, _imfs.new_IMFS_fifo_t())
__init__(IMFS_fifo_t self) -> IMFS_fifo_t
354 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
The membership flag
366class IMFS_generic_t(object): 367 r"""Proxy of C IMFS_generic_t struct.""" 368 369 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") 370 __repr__ = _swig_repr 371 Node = property(_imfs.IMFS_generic_t_Node_get, _imfs.IMFS_generic_t_Node_set, doc=r"""Node : IMFS_jnode_t""") 372 context = property(_imfs.IMFS_generic_t_context_get, _imfs.IMFS_generic_t_context_set, doc=r"""context : p.void""") 373 374 def __init__(self): 375 r"""__init__(IMFS_generic_t self) -> IMFS_generic_t""" 376 _imfs.IMFS_generic_t_swiginit(self, _imfs.new_IMFS_generic_t()) 377 __swig_destroy__ = _imfs.delete_IMFS_generic_t
Proxy of C IMFS_generic_t struct.
374 def __init__(self): 375 r"""__init__(IMFS_generic_t self) -> IMFS_generic_t""" 376 _imfs.IMFS_generic_t_swiginit(self, _imfs.new_IMFS_generic_t())
__init__(IMFS_generic_t self) -> IMFS_generic_t
369 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
The membership flag
381class IMFS_linearfile_context(object): 382 r"""Proxy of C IMFS_linearfile_context struct.""" 383 384 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") 385 __repr__ = _swig_repr 386 data = property(_imfs.IMFS_linearfile_context_data_get, _imfs.IMFS_linearfile_context_data_set, doc=r"""data : p.q(const).void""") 387 size = property(_imfs.IMFS_linearfile_context_size_get, _imfs.IMFS_linearfile_context_size_set, doc=r"""size : size_t""") 388 389 def __init__(self): 390 r"""__init__(IMFS_linearfile_context self) -> IMFS_linearfile_context""" 391 _imfs.IMFS_linearfile_context_swiginit(self, _imfs.new_IMFS_linearfile_context()) 392 __swig_destroy__ = _imfs.delete_IMFS_linearfile_context
Proxy of C IMFS_linearfile_context struct.
389 def __init__(self): 390 r"""__init__(IMFS_linearfile_context self) -> IMFS_linearfile_context""" 391 _imfs.IMFS_linearfile_context_swiginit(self, _imfs.new_IMFS_linearfile_context())
__init__(IMFS_linearfile_context self) -> IMFS_linearfile_context
384 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
The membership flag
397def IMFS_iop_to_node(iop): 398 r""" 399 IMFS_iop_to_node(rtems_libio_t const * iop) -> IMFS_jnode_tt 400 401 Parameters 402 ---------- 403 iop: rtems_libio_t const * 404 405 """ 406 return _imfs.IMFS_iop_to_node(iop)
IMFS_iop_to_node(rtems_libio_t const * iop) -> IMFS_jnode_tt
Parameters
iop: rtems_libio_t const *
408def IMFS_iop_to_directory(iop): 409 r""" 410 IMFS_iop_to_directory(rtems_libio_t const * iop) -> IMFS_directory_t 411 412 Parameters 413 ---------- 414 iop: rtems_libio_t const * 415 416 """ 417 return _imfs.IMFS_iop_to_directory(iop)
IMFS_iop_to_directory(rtems_libio_t const * iop) -> IMFS_directory_t
Parameters
iop: rtems_libio_t const *
419def IMFS_iop_to_device(iop): 420 r""" 421 IMFS_iop_to_device(rtems_libio_t const * iop) -> IMFS_device_t 422 423 Parameters 424 ---------- 425 iop: rtems_libio_t const * 426 427 """ 428 return _imfs.IMFS_iop_to_device(iop)
IMFS_iop_to_device(rtems_libio_t const * iop) -> IMFS_device_t
Parameters
iop: rtems_libio_t const *
430def IMFS_iop_to_file(iop): 431 r""" 432 IMFS_iop_to_file(rtems_libio_t const * iop) -> IMFS_file_t 433 434 Parameters 435 ---------- 436 iop: rtems_libio_t const * 437 438 """ 439 return _imfs.IMFS_iop_to_file(iop)
IMFS_iop_to_file(rtems_libio_t const * iop) -> IMFS_file_t
Parameters
iop: rtems_libio_t const *
441def IMFS_iop_to_memfile(iop): 442 r""" 443 IMFS_iop_to_memfile(rtems_libio_t const * iop) -> IMFS_memfile_t 444 445 Parameters 446 ---------- 447 iop: rtems_libio_t const * 448 449 """ 450 return _imfs.IMFS_iop_to_memfile(iop)
IMFS_iop_to_memfile(rtems_libio_t const * iop) -> IMFS_memfile_t
Parameters
iop: rtems_libio_t const *
451class IMFS_mknod_controls(object): 452 r"""Proxy of C IMFS_mknod_controls struct.""" 453 454 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") 455 __repr__ = _swig_repr 456 directory = property(_imfs.IMFS_mknod_controls_directory_get, _imfs.IMFS_mknod_controls_directory_set, doc=r"""directory : p.q(const).IMFS_mknod_control""") 457 device = property(_imfs.IMFS_mknod_controls_device_get, _imfs.IMFS_mknod_controls_device_set, doc=r"""device : p.q(const).IMFS_mknod_control""") 458 file = property(_imfs.IMFS_mknod_controls_file_get, _imfs.IMFS_mknod_controls_file_set, doc=r"""file : p.q(const).IMFS_mknod_control""") 459 fifo = property(_imfs.IMFS_mknod_controls_fifo_get, _imfs.IMFS_mknod_controls_fifo_set, doc=r"""fifo : p.q(const).IMFS_mknod_control""") 460 461 def __init__(self): 462 r"""__init__(IMFS_mknod_controls self) -> IMFS_mknod_controls""" 463 _imfs.IMFS_mknod_controls_swiginit(self, _imfs.new_IMFS_mknod_controls()) 464 __swig_destroy__ = _imfs.delete_IMFS_mknod_controls
Proxy of C IMFS_mknod_controls struct.
461 def __init__(self): 462 r"""__init__(IMFS_mknod_controls self) -> IMFS_mknod_controls""" 463 _imfs.IMFS_mknod_controls_swiginit(self, _imfs.new_IMFS_mknod_controls())
__init__(IMFS_mknod_controls self) -> IMFS_mknod_controls
454 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
The membership flag
468class IMFS_fs_info_t(object): 469 r"""Proxy of C IMFS_fs_info_t struct.""" 470 471 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") 472 __repr__ = _swig_repr 473 Root_directory = property(_imfs.IMFS_fs_info_t_Root_directory_get, _imfs.IMFS_fs_info_t_Root_directory_set, doc=r"""Root_directory : IMFS_directory_t""") 474 mknod_controls = property(_imfs.IMFS_fs_info_t_mknod_controls_get, _imfs.IMFS_fs_info_t_mknod_controls_set, doc=r"""mknod_controls : p.q(const).IMFS_mknod_controls""") 475 476 def __init__(self): 477 r"""__init__(IMFS_fs_info_t self) -> IMFS_fs_info_t""" 478 _imfs.IMFS_fs_info_t_swiginit(self, _imfs.new_IMFS_fs_info_t()) 479 __swig_destroy__ = _imfs.delete_IMFS_fs_info_t
Proxy of C IMFS_fs_info_t struct.
476 def __init__(self): 477 r"""__init__(IMFS_fs_info_t self) -> IMFS_fs_info_t""" 478 _imfs.IMFS_fs_info_t_swiginit(self, _imfs.new_IMFS_fs_info_t())
__init__(IMFS_fs_info_t self) -> IMFS_fs_info_t
471 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
The membership flag
483class IMFS_mount_data(object): 484 r"""Proxy of C IMFS_mount_data struct.""" 485 486 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") 487 __repr__ = _swig_repr 488 fs_info = property(_imfs.IMFS_mount_data_fs_info_get, _imfs.IMFS_mount_data_fs_info_set, doc=r"""fs_info : p.IMFS_fs_info_t""") 489 ops = property(_imfs.IMFS_mount_data_ops_get, _imfs.IMFS_mount_data_ops_set, doc=r"""ops : p.q(const).rtems_filesystem_operations_table""") 490 mknod_controls = property(_imfs.IMFS_mount_data_mknod_controls_get, _imfs.IMFS_mount_data_mknod_controls_set, doc=r"""mknod_controls : p.q(const).IMFS_mknod_controls""") 491 492 def __init__(self): 493 r"""__init__(IMFS_mount_data self) -> IMFS_mount_data""" 494 _imfs.IMFS_mount_data_swiginit(self, _imfs.new_IMFS_mount_data()) 495 __swig_destroy__ = _imfs.delete_IMFS_mount_data
Proxy of C IMFS_mount_data struct.
492 def __init__(self): 493 r"""__init__(IMFS_mount_data self) -> IMFS_mount_data""" 494 _imfs.IMFS_mount_data_swiginit(self, _imfs.new_IMFS_mount_data())
__init__(IMFS_mount_data self) -> IMFS_mount_data
486 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
The membership flag
500def IMFS_initialize(mt_entry, data): 501 r""" 502 IMFS_initialize(rtems_filesystem_mount_table_entry_t * mt_entry, void const * data) -> int 503 504 Parameters 505 ---------- 506 mt_entry: rtems_filesystem_mount_table_entry_t * 507 data: void const * 508 509 """ 510 return _imfs.IMFS_initialize(mt_entry, data)
IMFS_initialize(rtems_filesystem_mount_table_entry_t * mt_entry, void const * data) -> int
Parameters
mt_entry: rtems_filesystem_mount_table_entry_t * data: void const *
512def IMFS_initialize_support(mt_entry, data): 513 r""" 514 IMFS_initialize_support(rtems_filesystem_mount_table_entry_t * mt_entry, void const * data) -> int 515 516 Parameters 517 ---------- 518 mt_entry: rtems_filesystem_mount_table_entry_t * 519 data: void const * 520 521 """ 522 return _imfs.IMFS_initialize_support(mt_entry, data)
IMFS_initialize_support(rtems_filesystem_mount_table_entry_t * mt_entry, void const * data) -> int
Parameters
mt_entry: rtems_filesystem_mount_table_entry_t * data: void const *
524def IMFS_fsunmount(mt_entry): 525 r"""Unmount this instance of IMFS.""" 526 return _imfs.IMFS_fsunmount(mt_entry)
Unmount this instance of IMFS.
528def rtems_tarfs_load(mountpoint, tar_image, tar_size): 529 r""" 530 RTEMS load tarfs. 531 532 This file implements the "mount" procedure for tar-based IMFS 533 extensions. The TAR is not actually mounted under the IMFS. 534 Directories from the TAR file are created as usual in the IMFS. 535 File entries are created as IMFS_LINEAR_FILE nodes with their nods 536 pointing to addresses in the TAR image. 537 538 Here we create the mountpoint directory and load the tarfs at 539 that node. Once the IMFS has been mounted, we work through the 540 tar image and perform as follows: 541 - For directories, simply call mkdir(). The IMFS creates nodes as 542 needed. 543 - For files, we make our own calls to IMFS eval_for_make and 544 create_node. 545 546 TAR file format: 547 548 .. code-block:: c++ 549 550 Offset Length Contents 551 0 100 bytes File name ('\0' terminated, 99 maxmum length) 552 100 8 bytes File mode (in octal ascii) 553 108 8 bytes User ID (in octal ascii) 554 116 8 bytes Group ID (in octal ascii) 555 124 12 bytes File size (s) (in octal ascii) 556 136 12 bytes Modify time (in octal ascii) 557 148 8 bytes Header checksum (in octal ascii) 558 156 1 bytes Link flag 559 157 100 bytes Linkname ('\0' terminated, 99 maxmum length) 560 257 8 bytes Magic PAX ("ustar\0" + 2 bytes padding) 561 257 8 bytes Magic GNU tar ("ustar \0") 562 265 32 bytes User name ('\0' terminated, 31 maxmum length) 563 297 32 bytes Group name ('\0' terminated, 31 maxmum length) 564 329 8 bytes Major device ID (in octal ascii) 565 337 8 bytes Minor device ID (in octal ascii) 566 345 167 bytes Padding 567 512 (s+p) bytes File contents (s+p) := (((s) + 511) & ~511), 568 round up to 512 bytes 569 570 Checksum: 571 572 .. code-block:: c++ 573 574 int i, sum; 575 char *header = tar_header_pointer; 576 577 sum = 0; 578 for (i = 0; i < 512; i++) 579 sum += 0xFF & header[i]; 580 """ 581 return _imfs.rtems_tarfs_load(mountpoint, tar_image, tar_size)
RTEMS load tarfs.
This file implements the "mount" procedure for tar-based IMFS extensions. The TAR is not actually mounted under the IMFS. Directories from the TAR file are created as usual in the IMFS. File entries are created as IMFS_LINEAR_FILE nodes with their nods pointing to addresses in the TAR image.
Here we create the mountpoint directory and load the tarfs at that node. Once the IMFS has been mounted, we work through the tar image and perform as follows:
- For directories, simply call mkdir(). The IMFS creates nodes as needed.
- For files, we make our own calls to IMFS eval_for_make and create_node.
TAR file format:
Offset Length Contents
0 100 bytes File name ('\0' terminated, 99 maxmum length)
100 8 bytes File mode (in octal ascii)
108 8 bytes User ID (in octal ascii)
116 8 bytes Group ID (in octal ascii)
124 12 bytes File size (s) (in octal ascii)
136 12 bytes Modify time (in octal ascii)
148 8 bytes Header checksum (in octal ascii)
156 1 bytes Link flag
157 100 bytes Linkname ('\0' terminated, 99 maxmum length)
257 8 bytes Magic PAX ("ustar\0" + 2 bytes padding)
257 8 bytes Magic GNU tar ("ustar \0")
265 32 bytes User name ('\0' terminated, 31 maxmum length)
297 32 bytes Group name ('\0' terminated, 31 maxmum length)
329 8 bytes Major device ID (in octal ascii)
337 8 bytes Minor device ID (in octal ascii)
345 167 bytes Padding
512 (s+p) bytes File contents (s+p) := (((s) + 511) & ~511),
round up to 512 bytes
Checksum:
.. code-block:: c++
int i, sum;
char *header = tar_header_pointer;
sum = 0;
for (i = 0; i < 512; i++)
sum += 0xFF & header[i];
583def IMFS_node_destroy(node): 584 r"""Destroy an IMFS node.""" 585 return _imfs.IMFS_node_destroy(node)
Destroy an IMFS node.
Clone an IMFS node.
Free an IMFS node.
595def IMFS_stat(loc, buf): 596 r""" 597 Perform a status processing for the IMFS. 598 599 This routine provides a stat for the IMFS file system. 600 """ 601 return _imfs.IMFS_stat(loc, buf)
Perform a status processing for the IMFS.
This routine provides a stat for the IMFS file system.
603def IMFS_stat_file(loc, buf): 604 r""" 605 IMFS_stat_file(rtems_filesystem_location_info_t const * loc, struct stat * buf) -> int 606 607 Parameters 608 ---------- 609 loc: rtems_filesystem_location_info_t const * 610 buf: struct stat * 611 612 """ 613 return _imfs.IMFS_stat_file(loc, buf)
IMFS_stat_file(rtems_filesystem_location_info_t const * loc, struct stat * buf) -> int
Parameters
loc: rtems_filesystem_location_info_t const * buf: struct stat *
615def IMFS_eval_path(ctx): 616 r"""IMFS evaluation node support.""" 617 return _imfs.IMFS_eval_path(ctx)
IMFS evaluation node support.
619def IMFS_eval_path_devfs(ctx): 620 r"""IMFS device filesystem evaluation node support.""" 621 return _imfs.IMFS_eval_path_devfs(ctx)
IMFS device filesystem evaluation node support.
623def IMFS_link(parentloc, targetloc, name, namelen): 624 r""" 625 Create a new IMFS link node. 626 627 The following rouine creates a new link node under parent with the 628 name given in name. The link node is set to point to the node at 629 to_loc. 630 """ 631 return _imfs.IMFS_link(parentloc, targetloc, name, namelen)
Create a new IMFS link node.
The following rouine creates a new link node under parent with the name given in name. The link node is set to point to the node at to_loc.
633def IMFS_chown(loc, owner, group): 634 r""" 635 Change the owner of IMFS. 636 637 This routine is the implementation of the chown() system 638 call for the IMFS. 639 """ 640 return _imfs.IMFS_chown(loc, owner, group)
Change the owner of IMFS.
This routine is the implementation of the chown() system call for the IMFS.
642def IMFS_mknod(parentloc, name, namelen, mode, dev): 643 r""" 644 Create an IMFS node. 645 646 Routine to create a node in the IMFS file system. 647 """ 648 return _imfs.IMFS_mknod(parentloc, name, namelen, mode, dev)
Create an IMFS node.
Routine to create a node in the IMFS file system.
650def IMFS_initialize_node(node, node_control, name, namelen, mode, arg): 651 r""" 652 IMFS_initialize_node(IMFS_jnode_tt node, IMFS_node_control node_control, char const * name, size_t namelen, mode_t mode, void * arg) -> IMFS_jnode_tt 653 654 Parameters 655 ---------- 656 node: IMFS_jnode_t * 657 node_control: IMFS_node_control const * 658 name: char const * 659 namelen: size_t 660 mode: mode_t 661 arg: void * 662 663 """ 664 return _imfs.IMFS_initialize_node(node, node_control, name, namelen, mode, arg)
IMFS_initialize_node(IMFS_jnode_tt node, IMFS_node_control node_control, char const * name, size_t namelen, mode_t mode, void * arg) -> IMFS_jnode_tt
Parameters
node: IMFS_jnode_t * node_control: IMFS_node_control const * name: char const * namelen: size_t mode: mode_t arg: void *
666def IMFS_create_node(parentloc, node_control, node_size, name, namelen, mode, arg): 667 r""" 668 Create an IMFS node. 669 670 Create an IMFS filesystem node of an arbitrary type that is NOT 671 the root directory node. 672 """ 673 return _imfs.IMFS_create_node(parentloc, node_control, node_size, name, namelen, mode, arg)
Create an IMFS node.
Create an IMFS filesystem node of an arbitrary type that is NOT the root directory node.
675def IMFS_is_imfs_instance(loc): 676 r""" 677 IMFS_is_imfs_instance(rtems_filesystem_location_info_t const * loc) -> bool 678 679 Parameters 680 ---------- 681 loc: rtems_filesystem_location_info_t const * 682 683 """ 684 return _imfs.IMFS_is_imfs_instance(loc)
IMFS_is_imfs_instance(rtems_filesystem_location_info_t const * loc) -> bool
Parameters
loc: rtems_filesystem_location_info_t const *
686def IMFS_node_preinitialize(node, node_control, name, namelen, mode): 687 r""" 688 Initializer for an IMFS node control. 689 690 :param handlers: The file system node handlers. 691 :param init: The node initialization method. 692 :param destroy: The node destruction method. 693 694 Initializer for an IMFS node. 695 696 Initialize the node control with IMFS_NODE_CONTROL_INITIALIZER(). 697 698 :type node_control: :py:class:`IMFS_node_control` 699 :param node_control: The node control of the IMFS node. 700 :type name: string 701 :param name: The name of the IMFS node. 702 :type namelen: int 703 :param namelen: The length of the name of the IMFS node. 704 :type mode: mode_t 705 :param mode: The mode of the IMFS node. 706 707 See also: IMFS_node_preinitialize(). 708 709 Preinitializes an IMFS node. 710 711 Initialize the node control with IMFS_NODE_CONTROL_INITIALIZER(). 712 713 :type node: :py:class:`IMFS_jnode_t` 714 :param node: The IMFS node to preinitialize. 715 :type node_control: :py:class:`IMFS_node_control` 716 :param node_control: The node control of the IMFS node. 717 :type name: string 718 :param name: The name of the IMFS node. 719 :type namelen: int 720 :param namelen: The length of the name of the IMFS node. 721 :type mode: mode_t 722 :param mode: The mode of the IMFS node. 723 724 See also: IMFS_NODE_INITIALIZER(). 725 """ 726 return _imfs.IMFS_node_preinitialize(node, node_control, name, namelen, mode)
Initializer for an IMFS node control.
Parameters
- handlers: The file system node handlers.
- init: The node initialization method.
- destroy: The node destruction method.
Initializer for an IMFS node.
Initialize the node control with IMFS_NODE_CONTROL_INITIALIZER().
- node_control: The node control of the IMFS node.
- name: The name of the IMFS node.
- namelen: The length of the name of the IMFS node.
- mode: The mode of the IMFS node.
See also: IMFS_node_preinitialize().
Preinitializes an IMFS node.
Initialize the node control with IMFS_NODE_CONTROL_INITIALIZER().
- node: The IMFS node to preinitialize.
- node_control: The node control of the IMFS node.
- name: The name of the IMFS node.
- namelen: The length of the name of the IMFS node.
- mode: The mode of the IMFS node.
See also: IMFS_NODE_INITIALIZER().
728def IMFS_add_node(path, node, arg): 729 r""" 730 Adds an IMFS node. 731 732 Initialize the node with IMFS_NODE_INITIALIZER(), IMFS_node_preinitialize(), 733 IMFS_GENERIC_NODE_INITIALIZER(), or IMFS_generic_node_preinitialize(). 734 735 :type path: string 736 :param path: The path of parent directories for the IMFS node to add. 737 :type node: :py:class:`IMFS_jnode_t` 738 :param node: The IMFS node to add. 739 :type arg: void 740 :param arg: The argument passed to the node initialization method. 741 """ 742 return _imfs.IMFS_add_node(path, node, arg)
Adds an IMFS node.
Initialize the node with IMFS_NODE_INITIALIZER(), IMFS_node_preinitialize(), IMFS_GENERIC_NODE_INITIALIZER(), or IMFS_generic_node_preinitialize().
Parameters
- path: The path of parent directories for the IMFS node to add.
- node: The IMFS node to add.
- arg: The argument passed to the node initialization method.
744def IMFS_make_node(path, mode, node_control, node_size, context): 745 r""" 746 IMFS_make_node(char const * path, mode_t mode, IMFS_node_control node_control, size_t node_size, void * context) -> int 747 748 Parameters 749 ---------- 750 path: char const * 751 mode: mode_t 752 node_control: IMFS_node_control const * 753 node_size: size_t 754 context: void * 755 756 """ 757 return _imfs.IMFS_make_node(path, mode, node_control, node_size, context)
IMFS_make_node(char const * path, mode_t mode, IMFS_node_control node_control, size_t node_size, void * context) -> int
Parameters
path: char const * mode: mode_t node_control: IMFS_node_control const * node_size: size_t context: void *
759def IMFS_make_linearfile(path, mode, data, size): 760 r""" 761 Makes a linear IMFS file. 762 763 :type path: string 764 :param path: The path to the new linear IMFS file. 765 :type mode: mode_t 766 :param mode: The file mode permissions. S_IFREG is set by the function. 767 :type data: void 768 :param data: The begin of linear file data area. 769 :type size: int 770 :param size: The size of the linear file data area in bytes. 771 """ 772 return _imfs.IMFS_make_linearfile(path, mode, data, size)
Makes a linear IMFS file.
Parameters
- path: The path to the new linear IMFS file.
- mode: The file mode permissions. S_IFREG is set by the function.
- data: The begin of linear file data area.
- size: The size of the linear file data area in bytes.
774def IMFS_generic_node_preinitialize(node, node_control, name, namelen, mode): 775 r""" 776 Initializer for a generic node control. 777 778 :param handlers: The file system node handlers. 779 :param init: The node initialization method. 780 :param destroy: The node destruction method. 781 782 Initializer for a generic node. 783 784 Initialize the node control with IMFS_GENERIC_CONTROL_INITIALIZER(). 785 786 :type node_control: :py:class:`IMFS_node_control` 787 :param node_control: The node control of the IMFS generic node. 788 :type name: string 789 :param name: The name of the IMFS generic node. 790 :type namelen: int 791 :param namelen: The length of the name of the IMFS generic node. 792 :type mode: mode_t 793 :param mode: The mode of the IMFS generic node. 794 795 Preinitializes a generic IMFS node. 796 797 Initialize the node control with IMFS_GENERIC_CONTROL_INITIALIZER(). 798 799 :type node: :py:class:`IMFS_generic_t` 800 :param node: The generic IMFS node to preinitialize. 801 :type node_control: :py:class:`IMFS_node_control` 802 :param node_control: The node control of the generic IMFS node. 803 :type name: string 804 :param name: The name of the generic IMFS node. 805 :type namelen: int 806 :param namelen: The length of the name of the generic IMFS node. 807 :type mode: mode_t 808 :param mode: The mode of the generic IMFS node. 809 810 See also: IMFS_GENERIC_NODE_INITIALIZER(). 811 """ 812 return _imfs.IMFS_generic_node_preinitialize(node, node_control, name, namelen, mode)
Initializer for a generic node control.
Parameters
- handlers: The file system node handlers.
- init: The node initialization method.
- destroy: The node destruction method.
Initializer for a generic node.
Initialize the node control with IMFS_GENERIC_CONTROL_INITIALIZER().
- node_control: The node control of the IMFS generic node.
- name: The name of the IMFS generic node.
- namelen: The length of the name of the IMFS generic node.
- mode: The mode of the IMFS generic node.
Preinitializes a generic IMFS node.
Initialize the node control with IMFS_GENERIC_CONTROL_INITIALIZER().
- node: The generic IMFS node to preinitialize.
- node_control: The node control of the generic IMFS node.
- name: The name of the generic IMFS node.
- namelen: The length of the name of the generic IMFS node.
- mode: The mode of the generic IMFS node.
See also: IMFS_GENERIC_NODE_INITIALIZER().
814def IMFS_make_generic_node(path, mode, node_control, context): 815 r""" 816 Makes a generic IMFS node. 817 818 :type path: string, in 819 :param path: The path to the new generic IMFS node. 820 :type mode: mode_t, in 821 :param mode: The node mode. 822 :type node_control: :py:class:`IMFS_node_control`, in 823 :param node_control: The node control. 824 :type context: void, in 825 :param context: The node control handler context. 826 827 .. code-block:: c++ 828 829 #include <sys/stat.h> 830 #include <assert.h> 831 #include <fcntl.h> 832 833 #include <rtems/imfs.h> 834 835 static const rtems_filesystem_file_handlers_r some_node_handlers = { 836 ... 837 }; 838 839 static IMFS_jnode_t *some_node_init(IMFS_jnode_t *node, void *arg) 840 { 841 void *context; 842 843 node = IMFS_node_initialize_generic(node, arg); 844 context = IMFS_generic_get_context_by_node(node); 845 846 return node; 847 } 848 849 static void some_node_destroy(IMFS_jnode_t *node) 850 { 851 void *context = IMFS_generic_get_context_by_node(node); 852 853 IMFS_node_destroy_default(node); 854 } 855 856 static const IMFS_node_control 857 some_node_control = IMFS_GENERIC_CONTROL_INITIALIZER( 858 &some_node_handlers, 859 some_node_init, 860 some_node_destroy 861 ); 862 863 void example(void *some_node_context) 864 { 865 int rv; 866 867 rv = IMFS_make_generic_node( 868 "/path/to/some/generic/node", 869 S_IFCHR | S_IRWXU | S_IRWXG | S_IRWXO, 870 &some_node_control, 871 some_node_context 872 ); 873 assert(rv == 0); 874 } 875 """ 876 return _imfs.IMFS_make_generic_node(path, mode, node_control, context)
Makes a generic IMFS node.
Parameters
- path: The path to the new generic IMFS node.
- mode: The node mode.
- node_control: The node control.
- context: The node control handler context.
#include <sys/stat.h>
#include <assert.h>
#include <fcntl.h>
#include <rtems/imfs.h>
static const rtems_filesystem_file_handlers_r some_node_handlers = {
...
};
static IMFS_jnode_t *some_node_init(IMFS_jnode_t *node, void *arg)
{
void *context;
node = IMFS_node_initialize_generic(node, arg);
context = IMFS_generic_get_context_by_node(node);
return node;
}
static void some_node_destroy(IMFS_jnode_t *node)
{
void *context = IMFS_generic_get_context_by_node(node);
IMFS_node_destroy_default(node);
}
static const IMFS_node_control
some_node_control = IMFS_GENERIC_CONTROL_INITIALIZER(
&some_node_handlers,
some_node_init,
some_node_destroy
);
void example(void *some_node_context)
{
int rv;
rv = IMFS_make_generic_node(
"/path/to/some/generic/node",
S_IFCHR | S_IRWXU | S_IRWXG | S_IRWXO,
&some_node_control,
some_node_context
);
assert(rv == 0);
}
878def IMFS_mount(mt_entry, data): 879 r"""Mount an IMFS.""" 880 return _imfs.IMFS_mount(mt_entry, data)
Mount an IMFS.
Unmount an IMFS.
894def device_close(iop): 895 r""" 896 device_close(rtems_libio_t * iop) -> int 897 898 Parameters 899 ---------- 900 iop: rtems_libio_t * 901 902 """ 903 return _imfs.device_close(iop)
device_close(rtems_libio_t * iop) -> int
Parameters
iop: rtems_libio_t *
905def device_read(iop, buffer, count): 906 r""" 907 device_read(rtems_libio_t * iop, void * buffer, size_t count) -> ssize_t 908 909 Parameters 910 ---------- 911 iop: rtems_libio_t * 912 buffer: void * 913 count: size_t 914 915 """ 916 return _imfs.device_read(iop, buffer, count)
device_read(rtems_libio_t * iop, void * buffer, size_t count) -> ssize_t
Parameters
iop: rtems_libio_t * buffer: void * count: size_t
918def device_write(iop, buffer, count): 919 r""" 920 device_write(rtems_libio_t * iop, void const * buffer, size_t count) -> ssize_t 921 922 Parameters 923 ---------- 924 iop: rtems_libio_t * 925 buffer: void const * 926 count: size_t 927 928 """ 929 return _imfs.device_write(iop, buffer, count)
device_write(rtems_libio_t * iop, void const * buffer, size_t count) -> ssize_t
Parameters
iop: rtems_libio_t * buffer: void const * count: size_t
931def device_ioctl(iop, command, buffer): 932 r""" 933 device_ioctl(rtems_libio_t * iop, ioctl_command_t command, void * buffer) -> int 934 935 Parameters 936 ---------- 937 iop: rtems_libio_t * 938 command: ioctl_command_t 939 buffer: void * 940 941 """ 942 return _imfs.device_ioctl(iop, command, buffer)
device_ioctl(rtems_libio_t * iop, ioctl_command_t command, void * buffer) -> int
Parameters
iop: rtems_libio_t * command: ioctl_command_t buffer: void *
944def device_ftruncate(iop, length): 945 r""" 946 device_ftruncate(rtems_libio_t * iop, off_t length) -> int 947 948 Parameters 949 ---------- 950 iop: rtems_libio_t * 951 length: off_t 952 953 """ 954 return _imfs.device_ftruncate(iop, length)
device_ftruncate(rtems_libio_t * iop, off_t length) -> int
Parameters
iop: rtems_libio_t * length: off_t
956def IMFS_utimens(loc, times): 957 r""" 958 Set IMFS file access and modification times. 959 960 961 This routine is the implementation of the utime() system 962 call for the IMFS. 963 """ 964 return _imfs.IMFS_utimens(loc, times)
Set IMFS file access and modification times.
This routine is the implementation of the utime() system call for the IMFS.
966def IMFS_fchmod(loc, mode): 967 r"""Change the IMFS file mode.""" 968 return _imfs.IMFS_fchmod(loc, mode)
Change the IMFS file mode.
970def IMFS_symlink(parentloc, name, namelen, target): 971 r""" 972 Create a new IMFS symbolic link node. 973 974 The following rouine creates a new symbolic link node under parent 975 with the name given in name. The node is set to point to the node at 976 to_loc. 977 """ 978 return _imfs.IMFS_symlink(parentloc, name, namelen, target)
Create a new IMFS symbolic link node.
The following rouine creates a new symbolic link node under parent with the name given in name. The node is set to point to the node at to_loc.
980def IMFS_readlink(loc, buf, bufsize): 981 r""" 982 Put IMFS symbolic link into buffer. 983 984 The following rouine puts the symbolic links destination name into 985 buff. 986 """ 987 return _imfs.IMFS_readlink(loc, buf, bufsize)
Put IMFS symbolic link into buffer.
The following rouine puts the symbolic links destination name into buff.
989def IMFS_rename(oldparentloc, oldloc, newparentloc, name, namelen): 990 r""" 991 Rename the IMFS. 992 993 The following rouine creates a new link node under parent with the 994 name given in name and removes the old. 995 """ 996 return _imfs.IMFS_rename(oldparentloc, oldloc, newparentloc, name, namelen)
Rename the IMFS.
The following rouine creates a new link node under parent with the name given in name and removes the old.
998def IMFS_rmnod(parentloc, loc): 999 r""" 1000 IMFS node removal handler. 1001 1002 This file contains the handler used to remove a node when a file type 1003 does not require special actions. 1004 """ 1005 return _imfs.IMFS_rmnod(parentloc, loc)
IMFS node removal handler.
This file contains the handler used to remove a node when a file type does not require special actions.
1007def IMFS_Set_handlers(loc): 1008 r""" 1009 IMFS_Set_handlers(rtems_filesystem_location_info_t * loc) 1010 1011 Parameters 1012 ---------- 1013 loc: rtems_filesystem_location_info_t * 1014 1015 """ 1016 return _imfs.IMFS_Set_handlers(loc)
IMFS_Set_handlers(rtems_filesystem_location_info_t * loc)
Parameters
loc: rtems_filesystem_location_info_t *
1018def IMFS_add_to_directory(dir_node, entry_node): 1019 r""" 1020 IMFS_add_to_directory(IMFS_jnode_tt dir_node, IMFS_jnode_tt entry_node) 1021 1022 Parameters 1023 ---------- 1024 dir_node: IMFS_jnode_t * 1025 entry_node: IMFS_jnode_t * 1026 1027 """ 1028 return _imfs.IMFS_add_to_directory(dir_node, entry_node)
IMFS_add_to_directory(IMFS_jnode_tt dir_node, IMFS_jnode_tt entry_node)
Parameters
dir_node: IMFS_jnode_t * entry_node: IMFS_jnode_t *
1030def IMFS_remove_from_directory(node): 1031 r""" 1032 IMFS_remove_from_directory(IMFS_jnode_tt node) 1033 1034 Parameters 1035 ---------- 1036 node: IMFS_jnode_t * 1037 1038 """ 1039 return _imfs.IMFS_remove_from_directory(node)
IMFS_remove_from_directory(IMFS_jnode_tt node)
Parameters
node: IMFS_jnode_t *
1041def IMFS_is_directory(node): 1042 r""" 1043 IMFS_is_directory(IMFS_jnode_tt node) -> bool 1044 1045 Parameters 1046 ---------- 1047 node: IMFS_jnode_t const * 1048 1049 """ 1050 return _imfs.IMFS_is_directory(node)
IMFS_is_directory(IMFS_jnode_tt node) -> bool
Parameters
node: IMFS_jnode_t const *
1054def IMFS_is_hard_link(mode): 1055 r""" 1056 IMFS_is_hard_link(mode_t mode) -> bool 1057 1058 Parameters 1059 ---------- 1060 mode: mode_t 1061 1062 """ 1063 return _imfs.IMFS_is_hard_link(mode)
IMFS_is_hard_link(mode_t mode) -> bool
Parameters
mode: mode_t
1065def IMFS_node_to_ino(node): 1066 r""" 1067 IMFS_node_to_ino(IMFS_jnode_tt node) -> ino_t 1068 1069 Parameters 1070 ---------- 1071 node: IMFS_jnode_t const * 1072 1073 """ 1074 return _imfs.IMFS_node_to_ino(node)
IMFS_node_to_ino(IMFS_jnode_tt node) -> ino_t
Parameters
node: IMFS_jnode_t const *
1080def IMFS_generic_get_context_by_location(loc): 1081 r""" 1082 IMFS_generic_get_context_by_location(rtems_filesystem_location_info_t const * loc) -> void * 1083 1084 Parameters 1085 ---------- 1086 loc: rtems_filesystem_location_info_t const * 1087 1088 """ 1089 return _imfs.IMFS_generic_get_context_by_location(loc)
IMFS_generic_get_context_by_location(rtems_filesystem_location_info_t const * loc) -> void *
Parameters
loc: rtems_filesystem_location_info_t const *
1091def IMFS_generic_get_context_by_iop(iop): 1092 r""" 1093 IMFS_generic_get_context_by_iop(rtems_libio_t const * iop) -> void * 1094 1095 Parameters 1096 ---------- 1097 iop: rtems_libio_t const * 1098 1099 """ 1100 return _imfs.IMFS_generic_get_context_by_iop(iop)
IMFS_generic_get_context_by_iop(rtems_libio_t const * iop) -> void *
Parameters
iop: rtems_libio_t const *
1102def IMFS_generic_get_device_identifier_by_node(node): 1103 r""" 1104 IMFS_generic_get_device_identifier_by_node(IMFS_jnode_tt node) -> dev_t 1105 1106 Parameters 1107 ---------- 1108 node: IMFS_jnode_t const * 1109 1110 """ 1111 return _imfs.IMFS_generic_get_device_identifier_by_node(node)
IMFS_generic_get_device_identifier_by_node(IMFS_jnode_tt node) -> dev_t
Parameters
node: IMFS_jnode_t const *