chain
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 _chain as _chain 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 57 58def rtems_chain_append_with_notification(chain, node, task, events): 59 r""" 60 Chain initializer for an empty chain with designator *name*. 61 62 Chain initializer for a chain with one *node*. 63 64 See also: RTEMS_CHAIN_NODE_INITIALIZER_ONE_NODE_CHAIN(). 65 66 Chain node initializer for a *chain* containing exactly this node. 67 68 See also: RTEMS_CHAIN_INITIALIZER_ONE_NODE(). 69 70 Chain definition for an empty chain with designator *name*. 71 72 Appends the *node* to the *chain* and sends the *events* to the 73 *task* if the *chain* was empty before the append. 74 75 See also: rtems_chain_append_with_empty_check() and rtems_event_send(). 76 """ 77 return _chain.rtems_chain_append_with_notification(chain, node, task, events) 78 79def rtems_chain_prepend_with_notification(chain, node, task, events): 80 r""" 81 Prepends the *node* to the *chain* and sends the *events* to the 82 *task* if the *chain* was empty before the prepend. 83 84 See also: rtems_chain_prepend_with_empty_check() and rtems_event_send(). 85 """ 86 return _chain.rtems_chain_prepend_with_notification(chain, node, task, events) 87 88def rtems_chain_get_with_notification(chain, task, events, node): 89 r""" 90 Gets the first *node* of the *chain* and sends the *events* to the 91 *task* if the *chain* is empty after the get. 92 93 See also: rtems_chain_get_with_empty_check() and rtems_event_send(). 94 """ 95 return _chain.rtems_chain_get_with_notification(chain, task, events, node) 96 97def rtems_chain_get_with_wait(chain, events, timeout, node): 98 r""" 99 Gets the first *node* of the *chain* and sends the *events* to the 100 *task* if the *chain* is empty afterwards. 101 102 See also: rtems_chain_get() and rtems_event_receive(). 103 """ 104 return _chain.rtems_chain_get_with_wait(chain, events, timeout, node) 105 106def rtems_chain_initialize(the_chain, starting_address, number_nodes, node_size): 107 r""" 108 Initialize a chain Header. 109 110 This routine initializes *the_chain* structure to manage the 111 contiguous array of *number_nodes* nodes which starts at 112 *starting_address*. Each node is of *node_size* bytes. 113 114 :type the_chain: rtems_chain_control, in 115 :param the_chain: specifies the chain to initialize 116 :type starting_address: void, in 117 :param starting_address: is the starting address of the array 118 of elements 119 :type number_nodes: int, in 120 :param number_nodes: is the number of nodes that will be in the chain 121 :type node_size: int, in 122 :param node_size: is the size of each node 123 """ 124 return _chain.rtems_chain_initialize(the_chain, starting_address, number_nodes, node_size) 125 126def rtems_chain_initialize_empty(the_chain): 127 r""" 128 Initialize this chain as empty. 129 130 This routine initializes the specified chain to contain zero nodes. 131 132 :type the_chain: rtems_chain_control, in 133 :param the_chain: is the chain to be initialized. 134 """ 135 return _chain.rtems_chain_initialize_empty(the_chain) 136 137def rtems_chain_set_off_chain(node): 138 r""" 139 Set off chain. 140 141 This function sets the next and previous fields of the *node* to NULL 142 indicating the *node* is not part of a chain. 143 144 :type node: rtems_chain_node, in 145 :param node: the node set to off chain. 146 """ 147 return _chain.rtems_chain_set_off_chain(node) 148 149def rtems_chain_initialize_node(node): 150 r""" 151 Initializes a chain node. 152 153 In debug configurations, the node is set off chain. In all other 154 configurations, this function does nothing. 155 156 :param the_node: The chain node to initialize. 157 """ 158 return _chain.rtems_chain_initialize_node(node) 159 160def rtems_chain_is_node_off_chain(node): 161 r""" 162 Is the node off chain. 163 164 This function returns true if the *node* is not on a chain. A *node* is 165 off chain if the next and previous fields are set to NULL. 166 167 :type node: rtems_chain_node, in 168 :param node: is the node off chain. 169 """ 170 return _chain.rtems_chain_is_node_off_chain(node) 171 172def rtems_chain_is_null_node(the_node): 173 r""" 174 Is the chain node pointer NULL. 175 176 This function returns true if the_node is NULL and false otherwise. 177 178 :type the_node: rtems_chain_node, in 179 :param the_node: is the node pointer to check. 180 """ 181 return _chain.rtems_chain_is_null_node(the_node) 182 183def rtems_chain_head(the_chain): 184 r""" 185 Return pointer to Chain Head 186 187 This function returns a pointer to the first node on the chain. 188 189 :type the_chain: rtems_chain_control, in 190 :param the_chain: is the chain to be operated upon. 191 192 :rtype: rtems_chain_node 193 :return: This method returns the permanent node of the chain. 194 """ 195 return _chain.rtems_chain_head(the_chain) 196 197def rtems_chain_immutable_head(the_chain): 198 r""" 199 Return pointer to immutable Chain Head 200 201 This function returns a pointer to the head node on the chain. 202 203 :type the_chain: rtems_chain_control, in 204 :param the_chain: is the chain to be operated upon. 205 206 :rtype: rtems_chain_node 207 :return: This method returns the permanent head node of the chain. 208 """ 209 return _chain.rtems_chain_immutable_head(the_chain) 210 211def rtems_chain_tail(the_chain): 212 r""" 213 Return pointer to Chain Tail 214 215 This function returns a pointer to the tail node on the chain. 216 217 :type the_chain: rtems_chain_control, in 218 :param the_chain: is the chain to be operated upon. 219 220 :rtype: rtems_chain_node 221 :return: This method returns the permanent tail node of the chain. 222 """ 223 return _chain.rtems_chain_tail(the_chain) 224 225def rtems_chain_immutable_tail(the_chain): 226 r""" 227 Return pointer to immutable Chain Tail 228 229 This function returns a pointer to the tail node on the chain. 230 231 :type the_chain: rtems_chain_control, in 232 :param the_chain: is the chain to be operated upon. 233 234 :rtype: rtems_chain_node 235 :return: This method returns the permanent tail node of the chain. 236 """ 237 return _chain.rtems_chain_immutable_tail(the_chain) 238 239def rtems_chain_first(the_chain): 240 r""" 241 Return pointer to Chain's First node after the permanent head. 242 243 This function returns a pointer to the first node on the chain after the 244 head. 245 246 :type the_chain: rtems_chain_control, in 247 :param the_chain: is the chain to be operated upon. 248 249 :rtype: rtems_chain_node 250 :return: This method returns the first node of the chain. 251 """ 252 return _chain.rtems_chain_first(the_chain) 253 254def rtems_chain_immutable_first(the_chain): 255 r""" 256 Return pointer to immutable Chain's First node 257 258 This function returns a pointer to the first node on the chain after the 259 head. 260 261 :type the_chain: rtems_chain_control, in 262 :param the_chain: is the chain to be operated upon. 263 264 :rtype: rtems_chain_node 265 :return: This method returns the first node of the chain. 266 """ 267 return _chain.rtems_chain_immutable_first(the_chain) 268 269def rtems_chain_last(the_chain): 270 r""" 271 Return pointer to Chain's Last node before the permanent tail. 272 273 This function returns a pointer to the last node on the chain just before 274 the tail. 275 276 :type the_chain: rtems_chain_control, in 277 :param the_chain: is the chain to be operated upon. 278 279 :rtype: rtems_chain_node 280 :return: This method returns the last node of the chain. 281 """ 282 return _chain.rtems_chain_last(the_chain) 283 284def rtems_chain_immutable_last(the_chain): 285 r""" 286 Return pointer to immutable Chain's Last node 287 288 This function returns a pointer to the last node on the chain just before 289 the tail. 290 291 :type the_chain: rtems_chain_control, in 292 :param the_chain: is the chain to be operated upon. 293 294 :rtype: rtems_chain_node 295 :return: This method returns the last node of the chain. 296 """ 297 return _chain.rtems_chain_immutable_last(the_chain) 298 299def rtems_chain_next(the_node): 300 r""" 301 Return pointer the next node from this node 302 303 This function returns a pointer to the next node after this node. 304 305 :type the_node: rtems_chain_node, in 306 :param the_node: is the node to be operated upon. 307 308 :rtype: rtems_chain_node 309 :return: This method returns the next node on the chain. 310 """ 311 return _chain.rtems_chain_next(the_node) 312 313def rtems_chain_immutable_next(the_node): 314 r""" 315 Return pointer the immutable next node from this node 316 317 This function returns a pointer to the next node after this node. 318 319 :type the_node: rtems_chain_node, in 320 :param the_node: is the node to be operated upon. 321 322 :rtype: rtems_chain_node 323 :return: This method returns the next node on the chain. 324 """ 325 return _chain.rtems_chain_immutable_next(the_node) 326 327def rtems_chain_previous(the_node): 328 r""" 329 Return pointer the previous node from this node 330 331 This function returns a pointer to the previous node on this chain. 332 333 :type the_node: rtems_chain_node, in 334 :param the_node: is the node to be operated upon. 335 336 :rtype: rtems_chain_node 337 :return: This method returns the previous node on the chain. 338 """ 339 return _chain.rtems_chain_previous(the_node) 340 341def rtems_chain_immutable_previous(the_node): 342 r""" 343 Return pointer the immutable previous node from this node. 344 345 This function returns a pointer to the previous node on this chain. 346 347 :type the_node: rtems_chain_node, in 348 :param the_node: is the node to be operated upon. 349 350 :rtype: rtems_chain_node 351 :return: This method returns the previous node on the chain. 352 """ 353 return _chain.rtems_chain_immutable_previous(the_node) 354 355def rtems_chain_are_nodes_equal(left, right): 356 r""" 357 Are Two nodes equal. 358 359 This function returns true if *left* and *right* are equal, 360 and false otherwise. 361 362 :type left: rtems_chain_node, in 363 :param left: is the node on the left hand side of the comparison. 364 :type right: rtems_chain_node, in 365 :param right: is the node on the left hand side of the comparison. 366 """ 367 return _chain.rtems_chain_are_nodes_equal(left, right) 368 369def rtems_chain_is_empty(the_chain): 370 r""" 371 Is the chain empty 372 373 This function returns true if there a no nodes on *the_chain* and 374 false otherwise. 375 376 :type the_chain: rtems_chain_control, in 377 :param the_chain: is the chain to be operated upon. 378 """ 379 return _chain.rtems_chain_is_empty(the_chain) 380 381def rtems_chain_is_first(the_node): 382 r""" 383 Is this the first node on the chain. 384 385 This function returns true if the_node is the first node on a chain and 386 false otherwise. 387 388 :type the_node: rtems_chain_node, in 389 :param the_node: is the node the caller wants to know if it is 390 the first node on a chain. 391 """ 392 return _chain.rtems_chain_is_first(the_node) 393 394def rtems_chain_is_last(the_node): 395 r""" 396 Is this the last node on the chain. 397 398 This function returns true if *the_node* is the last node on a chain and 399 false otherwise. 400 401 :type the_node: rtems_chain_node, in 402 :param the_node: is the node to check as the last node. 403 """ 404 return _chain.rtems_chain_is_last(the_node) 405 406def rtems_chain_has_only_one_node(the_chain): 407 r""" 408 Does this chain have only one node. 409 410 This function returns true if there is only one node on *the_chain* and 411 false otherwise. 412 413 :type the_chain: rtems_chain_control, in 414 :param the_chain: is the chain to be operated upon. 415 """ 416 return _chain.rtems_chain_has_only_one_node(the_chain) 417 418def rtems_chain_is_head(the_chain, the_node): 419 r""" 420 Is this node the chain head. 421 422 This function returns true if *the_node* is the head of the_chain and 423 false otherwise. 424 425 :type the_chain: rtems_chain_control, in 426 :param the_chain: is the chain to be operated upon. 427 :type the_node: rtems_chain_node, in 428 :param the_node: is the node to check for being the Chain Head. 429 """ 430 return _chain.rtems_chain_is_head(the_chain, the_node) 431 432def rtems_chain_is_tail(the_chain, the_node): 433 r""" 434 Is this node the chain tail. 435 436 This function returns true if the_node is the tail of the_chain and 437 false otherwise. 438 439 :type the_chain: rtems_chain_control, in 440 :param the_chain: is the chain to be operated upon. 441 :type the_node: rtems_chain_node, in 442 :param the_node: is the node to check for being the Chain Tail. 443 """ 444 return _chain.rtems_chain_is_tail(the_chain, the_node) 445 446def rtems_chain_extract(the_node): 447 r""" 448 Extract the specified node from a chain. 449 450 This routine extracts *the_node* from the chain on which it resides. 451 It disables interrupts to ensure the atomicity of the 452 extract operation. 453 454 * the_node specifies the node to extract 455 """ 456 return _chain.rtems_chain_extract(the_node) 457 458def rtems_chain_extract_unprotected(the_node): 459 r""" 460 Extract the specified node from a chain (unprotected). 461 462 This routine extracts *the_node* from the chain on which it resides. 463 464 NOTE: It does NOT disable interrupts to ensure the atomicity of the 465 append operation. 466 """ 467 return _chain.rtems_chain_extract_unprotected(the_node) 468 469def rtems_chain_get(the_chain): 470 r""" 471 Obtain the first node on a chain. 472 473 This function removes the first node from *the_chain* and returns 474 a pointer to that node. If *the_chain* is empty, then NULL is returned. 475 476 :rtype: rtems_chain_node 477 :return: This method returns a pointer a node. If a node was removed, 478 then a pointer to that node is returned. If *the_chain* was 479 empty, then NULL is returned. 480 481 NOTE: It disables interrupts to ensure the atomicity of the get operation. 482 """ 483 return _chain.rtems_chain_get(the_chain) 484 485def rtems_chain_get_unprotected(the_chain): 486 r"""See _Chain_Get_unprotected().""" 487 return _chain.rtems_chain_get_unprotected(the_chain) 488 489def rtems_chain_get_first_unprotected(the_chain): 490 r"""See _Chain_Get_first_unprotected().""" 491 return _chain.rtems_chain_get_first_unprotected(the_chain) 492 493def rtems_chain_insert(after_node, the_node): 494 r""" 495 Insert a node on a chain 496 497 This routine inserts *the_node* on a chain immediately following 498 *after_node*. 499 500 NOTE: It disables interrupts to ensure the atomicity 501 of the extract operation. 502 """ 503 return _chain.rtems_chain_insert(after_node, the_node) 504 505def rtems_chain_insert_unprotected(after_node, the_node): 506 r"""See _Chain_Insert_unprotected().""" 507 return _chain.rtems_chain_insert_unprotected(after_node, the_node) 508 509def rtems_chain_append(the_chain, the_node): 510 r""" 511 Append a node on the end of a chain. 512 513 This routine appends *the_node* onto the end of *the_chain*. 514 515 NOTE: It disables interrupts to ensure the atomicity of the 516 append operation. 517 """ 518 return _chain.rtems_chain_append(the_chain, the_node) 519 520def rtems_chain_append_unprotected(the_chain, the_node): 521 r""" 522 Append a node on the end of a chain (unprotected). 523 524 This routine appends *the_node* onto the end of *the_chain*. 525 526 NOTE: It does NOT disable interrupts to ensure the atomicity of the 527 append operation. 528 """ 529 return _chain.rtems_chain_append_unprotected(the_chain, the_node) 530 531def rtems_chain_prepend(the_chain, the_node): 532 r""" 533 Prepend a node. 534 535 This routine prepends the_node onto the front of the_chain. 536 537 :type the_chain: rtems_chain_control, in 538 :param the_chain: is the chain to be operated upon. 539 :type the_node: rtems_chain_node, in 540 :param the_node: is the node to be prepended. 541 542 NOTE: It disables interrupts to ensure the atomicity of the 543 prepend operation. 544 """ 545 return _chain.rtems_chain_prepend(the_chain, the_node) 546 547def rtems_chain_prepend_unprotected(the_chain, the_node): 548 r""" 549 Prepend a node (unprotected). 550 551 This routine prepends the_node onto the front of the_chain. 552 553 :type the_chain: rtems_chain_control, in 554 :param the_chain: is the chain to be operated upon. 555 :type the_node: rtems_chain_node, in 556 :param the_node: is the node to be prepended. 557 558 NOTE: It does NOT disable interrupts to ensure the atomicity of the 559 prepend operation. 560 """ 561 return _chain.rtems_chain_prepend_unprotected(the_chain, the_node) 562 563def rtems_chain_append_with_empty_check(chain, node): 564 r""" 565 Checks if the *chain* is empty and appends the *node*. 566 567 Interrupts are disabled to ensure the atomicity of the operation. 568 """ 569 return _chain.rtems_chain_append_with_empty_check(chain, node) 570 571def rtems_chain_prepend_with_empty_check(chain, node): 572 r""" 573 Checks if the *chain* is empty and prepends the *node*. 574 575 Interrupts are disabled to ensure the atomicity of the operation. 576 """ 577 return _chain.rtems_chain_prepend_with_empty_check(chain, node) 578 579def rtems_chain_get_with_empty_check(chain, node): 580 r""" 581 Tries to get the first *node* and check if the *chain* is empty 582 afterwards. 583 584 This function removes the first node from the *chain* and returns a pointer 585 to that node in *node*. If the *chain* is empty, then ``NULL`` is returned. 586 587 Interrupts are disabled to ensure the atomicity of the operation. 588 """ 589 return _chain.rtems_chain_get_with_empty_check(chain, node) 590 591def rtems_chain_node_count_unprotected(chain): 592 r""" 593 Returns the node count of the chain. 594 595 :type chain: rtems_chain_control, in 596 :param chain: The chain. 597 598 Notes: It does NOT disable interrupts to ensure the atomicity of the 599 operation. 600 601 :rtype: int 602 :return: The node count of the chain. 603 """ 604 return _chain.rtems_chain_node_count_unprotected(chain)
59def rtems_chain_append_with_notification(chain, node, task, events): 60 r""" 61 Chain initializer for an empty chain with designator *name*. 62 63 Chain initializer for a chain with one *node*. 64 65 See also: RTEMS_CHAIN_NODE_INITIALIZER_ONE_NODE_CHAIN(). 66 67 Chain node initializer for a *chain* containing exactly this node. 68 69 See also: RTEMS_CHAIN_INITIALIZER_ONE_NODE(). 70 71 Chain definition for an empty chain with designator *name*. 72 73 Appends the *node* to the *chain* and sends the *events* to the 74 *task* if the *chain* was empty before the append. 75 76 See also: rtems_chain_append_with_empty_check() and rtems_event_send(). 77 """ 78 return _chain.rtems_chain_append_with_notification(chain, node, task, events)
Chain initializer for an empty chain with designator name.
Chain initializer for a chain with one node.
See also: RTEMS_CHAIN_NODE_INITIALIZER_ONE_NODE_CHAIN().
Chain node initializer for a chain containing exactly this node.
See also: RTEMS_CHAIN_INITIALIZER_ONE_NODE().
Chain definition for an empty chain with designator name.
Appends the node to the chain and sends the events to the task if the chain was empty before the append.
See also: rtems_chain_append_with_empty_check() and rtems_event_send().
80def rtems_chain_prepend_with_notification(chain, node, task, events): 81 r""" 82 Prepends the *node* to the *chain* and sends the *events* to the 83 *task* if the *chain* was empty before the prepend. 84 85 See also: rtems_chain_prepend_with_empty_check() and rtems_event_send(). 86 """ 87 return _chain.rtems_chain_prepend_with_notification(chain, node, task, events)
Prepends the node to the chain and sends the events to the task if the chain was empty before the prepend.
See also: rtems_chain_prepend_with_empty_check() and rtems_event_send().
89def rtems_chain_get_with_notification(chain, task, events, node): 90 r""" 91 Gets the first *node* of the *chain* and sends the *events* to the 92 *task* if the *chain* is empty after the get. 93 94 See also: rtems_chain_get_with_empty_check() and rtems_event_send(). 95 """ 96 return _chain.rtems_chain_get_with_notification(chain, task, events, node)
Gets the first node of the chain and sends the events to the task if the chain is empty after the get.
See also: rtems_chain_get_with_empty_check() and rtems_event_send().
98def rtems_chain_get_with_wait(chain, events, timeout, node): 99 r""" 100 Gets the first *node* of the *chain* and sends the *events* to the 101 *task* if the *chain* is empty afterwards. 102 103 See also: rtems_chain_get() and rtems_event_receive(). 104 """ 105 return _chain.rtems_chain_get_with_wait(chain, events, timeout, node)
Gets the first node of the chain and sends the events to the task if the chain is empty afterwards.
See also: rtems_chain_get() and rtems_event_receive().
107def rtems_chain_initialize(the_chain, starting_address, number_nodes, node_size): 108 r""" 109 Initialize a chain Header. 110 111 This routine initializes *the_chain* structure to manage the 112 contiguous array of *number_nodes* nodes which starts at 113 *starting_address*. Each node is of *node_size* bytes. 114 115 :type the_chain: rtems_chain_control, in 116 :param the_chain: specifies the chain to initialize 117 :type starting_address: void, in 118 :param starting_address: is the starting address of the array 119 of elements 120 :type number_nodes: int, in 121 :param number_nodes: is the number of nodes that will be in the chain 122 :type node_size: int, in 123 :param node_size: is the size of each node 124 """ 125 return _chain.rtems_chain_initialize(the_chain, starting_address, number_nodes, node_size)
Initialize a chain Header.
This routine initializes the_chain structure to manage the contiguous array of number_nodes nodes which starts at starting_address. Each node is of node_size bytes.
Parameters
- the_chain: specifies the chain to initialize
- starting_address: is the starting address of the array of elements
- number_nodes: is the number of nodes that will be in the chain
- node_size: is the size of each node
127def rtems_chain_initialize_empty(the_chain): 128 r""" 129 Initialize this chain as empty. 130 131 This routine initializes the specified chain to contain zero nodes. 132 133 :type the_chain: rtems_chain_control, in 134 :param the_chain: is the chain to be initialized. 135 """ 136 return _chain.rtems_chain_initialize_empty(the_chain)
Initialize this chain as empty.
This routine initializes the specified chain to contain zero nodes.
Parameters
- the_chain: is the chain to be initialized.
138def rtems_chain_set_off_chain(node): 139 r""" 140 Set off chain. 141 142 This function sets the next and previous fields of the *node* to NULL 143 indicating the *node* is not part of a chain. 144 145 :type node: rtems_chain_node, in 146 :param node: the node set to off chain. 147 """ 148 return _chain.rtems_chain_set_off_chain(node)
Set off chain.
This function sets the next and previous fields of the node to NULL indicating the node is not part of a chain.
Parameters
- node: the node set to off chain.
150def rtems_chain_initialize_node(node): 151 r""" 152 Initializes a chain node. 153 154 In debug configurations, the node is set off chain. In all other 155 configurations, this function does nothing. 156 157 :param the_node: The chain node to initialize. 158 """ 159 return _chain.rtems_chain_initialize_node(node)
Initializes a chain node.
In debug configurations, the node is set off chain. In all other configurations, this function does nothing.
Parameters
- the_node: The chain node to initialize.
161def rtems_chain_is_node_off_chain(node): 162 r""" 163 Is the node off chain. 164 165 This function returns true if the *node* is not on a chain. A *node* is 166 off chain if the next and previous fields are set to NULL. 167 168 :type node: rtems_chain_node, in 169 :param node: is the node off chain. 170 """ 171 return _chain.rtems_chain_is_node_off_chain(node)
Is the node off chain.
This function returns true if the node is not on a chain. A node is off chain if the next and previous fields are set to NULL.
Parameters
- node: is the node off chain.
173def rtems_chain_is_null_node(the_node): 174 r""" 175 Is the chain node pointer NULL. 176 177 This function returns true if the_node is NULL and false otherwise. 178 179 :type the_node: rtems_chain_node, in 180 :param the_node: is the node pointer to check. 181 """ 182 return _chain.rtems_chain_is_null_node(the_node)
Is the chain node pointer NULL.
This function returns true if the_node is NULL and false otherwise.
Parameters
- the_node: is the node pointer to check.
184def rtems_chain_head(the_chain): 185 r""" 186 Return pointer to Chain Head 187 188 This function returns a pointer to the first node on the chain. 189 190 :type the_chain: rtems_chain_control, in 191 :param the_chain: is the chain to be operated upon. 192 193 :rtype: rtems_chain_node 194 :return: This method returns the permanent node of the chain. 195 """ 196 return _chain.rtems_chain_head(the_chain)
Return pointer to Chain Head
This function returns a pointer to the first node on the chain.
Parameters
- the_chain: is the chain to be operated upon.
Returns
This method returns the permanent node of the chain.
198def rtems_chain_immutable_head(the_chain): 199 r""" 200 Return pointer to immutable Chain Head 201 202 This function returns a pointer to the head node on the chain. 203 204 :type the_chain: rtems_chain_control, in 205 :param the_chain: is the chain to be operated upon. 206 207 :rtype: rtems_chain_node 208 :return: This method returns the permanent head node of the chain. 209 """ 210 return _chain.rtems_chain_immutable_head(the_chain)
Return pointer to immutable Chain Head
This function returns a pointer to the head node on the chain.
Parameters
- the_chain: is the chain to be operated upon.
Returns
This method returns the permanent head node of the chain.
212def rtems_chain_tail(the_chain): 213 r""" 214 Return pointer to Chain Tail 215 216 This function returns a pointer to the tail node on the chain. 217 218 :type the_chain: rtems_chain_control, in 219 :param the_chain: is the chain to be operated upon. 220 221 :rtype: rtems_chain_node 222 :return: This method returns the permanent tail node of the chain. 223 """ 224 return _chain.rtems_chain_tail(the_chain)
Return pointer to Chain Tail
This function returns a pointer to the tail node on the chain.
Parameters
- the_chain: is the chain to be operated upon.
Returns
This method returns the permanent tail node of the chain.
226def rtems_chain_immutable_tail(the_chain): 227 r""" 228 Return pointer to immutable Chain Tail 229 230 This function returns a pointer to the tail node on the chain. 231 232 :type the_chain: rtems_chain_control, in 233 :param the_chain: is the chain to be operated upon. 234 235 :rtype: rtems_chain_node 236 :return: This method returns the permanent tail node of the chain. 237 """ 238 return _chain.rtems_chain_immutable_tail(the_chain)
Return pointer to immutable Chain Tail
This function returns a pointer to the tail node on the chain.
Parameters
- the_chain: is the chain to be operated upon.
Returns
This method returns the permanent tail node of the chain.
240def rtems_chain_first(the_chain): 241 r""" 242 Return pointer to Chain's First node after the permanent head. 243 244 This function returns a pointer to the first node on the chain after the 245 head. 246 247 :type the_chain: rtems_chain_control, in 248 :param the_chain: is the chain to be operated upon. 249 250 :rtype: rtems_chain_node 251 :return: This method returns the first node of the chain. 252 """ 253 return _chain.rtems_chain_first(the_chain)
Return pointer to Chain's First node after the permanent head.
This function returns a pointer to the first node on the chain after the head.
Parameters
- the_chain: is the chain to be operated upon.
Returns
This method returns the first node of the chain.
255def rtems_chain_immutable_first(the_chain): 256 r""" 257 Return pointer to immutable Chain's First node 258 259 This function returns a pointer to the first node on the chain after the 260 head. 261 262 :type the_chain: rtems_chain_control, in 263 :param the_chain: is the chain to be operated upon. 264 265 :rtype: rtems_chain_node 266 :return: This method returns the first node of the chain. 267 """ 268 return _chain.rtems_chain_immutable_first(the_chain)
Return pointer to immutable Chain's First node
This function returns a pointer to the first node on the chain after the head.
Parameters
- the_chain: is the chain to be operated upon.
Returns
This method returns the first node of the chain.
270def rtems_chain_last(the_chain): 271 r""" 272 Return pointer to Chain's Last node before the permanent tail. 273 274 This function returns a pointer to the last node on the chain just before 275 the tail. 276 277 :type the_chain: rtems_chain_control, in 278 :param the_chain: is the chain to be operated upon. 279 280 :rtype: rtems_chain_node 281 :return: This method returns the last node of the chain. 282 """ 283 return _chain.rtems_chain_last(the_chain)
Return pointer to Chain's Last node before the permanent tail.
This function returns a pointer to the last node on the chain just before the tail.
Parameters
- the_chain: is the chain to be operated upon.
Returns
This method returns the last node of the chain.
285def rtems_chain_immutable_last(the_chain): 286 r""" 287 Return pointer to immutable Chain's Last node 288 289 This function returns a pointer to the last node on the chain just before 290 the tail. 291 292 :type the_chain: rtems_chain_control, in 293 :param the_chain: is the chain to be operated upon. 294 295 :rtype: rtems_chain_node 296 :return: This method returns the last node of the chain. 297 """ 298 return _chain.rtems_chain_immutable_last(the_chain)
Return pointer to immutable Chain's Last node
This function returns a pointer to the last node on the chain just before the tail.
Parameters
- the_chain: is the chain to be operated upon.
Returns
This method returns the last node of the chain.
300def rtems_chain_next(the_node): 301 r""" 302 Return pointer the next node from this node 303 304 This function returns a pointer to the next node after this node. 305 306 :type the_node: rtems_chain_node, in 307 :param the_node: is the node to be operated upon. 308 309 :rtype: rtems_chain_node 310 :return: This method returns the next node on the chain. 311 """ 312 return _chain.rtems_chain_next(the_node)
Return pointer the next node from this node
This function returns a pointer to the next node after this node.
Parameters
- the_node: is the node to be operated upon.
Returns
This method returns the next node on the chain.
314def rtems_chain_immutable_next(the_node): 315 r""" 316 Return pointer the immutable next node from this node 317 318 This function returns a pointer to the next node after this node. 319 320 :type the_node: rtems_chain_node, in 321 :param the_node: is the node to be operated upon. 322 323 :rtype: rtems_chain_node 324 :return: This method returns the next node on the chain. 325 """ 326 return _chain.rtems_chain_immutable_next(the_node)
Return pointer the immutable next node from this node
This function returns a pointer to the next node after this node.
Parameters
- the_node: is the node to be operated upon.
Returns
This method returns the next node on the chain.
328def rtems_chain_previous(the_node): 329 r""" 330 Return pointer the previous node from this node 331 332 This function returns a pointer to the previous node on this chain. 333 334 :type the_node: rtems_chain_node, in 335 :param the_node: is the node to be operated upon. 336 337 :rtype: rtems_chain_node 338 :return: This method returns the previous node on the chain. 339 """ 340 return _chain.rtems_chain_previous(the_node)
Return pointer the previous node from this node
This function returns a pointer to the previous node on this chain.
Parameters
- the_node: is the node to be operated upon.
Returns
This method returns the previous node on the chain.
342def rtems_chain_immutable_previous(the_node): 343 r""" 344 Return pointer the immutable previous node from this node. 345 346 This function returns a pointer to the previous node on this chain. 347 348 :type the_node: rtems_chain_node, in 349 :param the_node: is the node to be operated upon. 350 351 :rtype: rtems_chain_node 352 :return: This method returns the previous node on the chain. 353 """ 354 return _chain.rtems_chain_immutable_previous(the_node)
Return pointer the immutable previous node from this node.
This function returns a pointer to the previous node on this chain.
Parameters
- the_node: is the node to be operated upon.
Returns
This method returns the previous node on the chain.
356def rtems_chain_are_nodes_equal(left, right): 357 r""" 358 Are Two nodes equal. 359 360 This function returns true if *left* and *right* are equal, 361 and false otherwise. 362 363 :type left: rtems_chain_node, in 364 :param left: is the node on the left hand side of the comparison. 365 :type right: rtems_chain_node, in 366 :param right: is the node on the left hand side of the comparison. 367 """ 368 return _chain.rtems_chain_are_nodes_equal(left, right)
Are Two nodes equal.
This function returns true if left and right are equal, and false otherwise.
Parameters
- left: is the node on the left hand side of the comparison.
- right: is the node on the left hand side of the comparison.
370def rtems_chain_is_empty(the_chain): 371 r""" 372 Is the chain empty 373 374 This function returns true if there a no nodes on *the_chain* and 375 false otherwise. 376 377 :type the_chain: rtems_chain_control, in 378 :param the_chain: is the chain to be operated upon. 379 """ 380 return _chain.rtems_chain_is_empty(the_chain)
Is the chain empty
This function returns true if there a no nodes on the_chain and false otherwise.
Parameters
- the_chain: is the chain to be operated upon.
382def rtems_chain_is_first(the_node): 383 r""" 384 Is this the first node on the chain. 385 386 This function returns true if the_node is the first node on a chain and 387 false otherwise. 388 389 :type the_node: rtems_chain_node, in 390 :param the_node: is the node the caller wants to know if it is 391 the first node on a chain. 392 """ 393 return _chain.rtems_chain_is_first(the_node)
Is this the first node on the chain.
This function returns true if the_node is the first node on a chain and false otherwise.
Parameters
- the_node: is the node the caller wants to know if it is the first node on a chain.
395def rtems_chain_is_last(the_node): 396 r""" 397 Is this the last node on the chain. 398 399 This function returns true if *the_node* is the last node on a chain and 400 false otherwise. 401 402 :type the_node: rtems_chain_node, in 403 :param the_node: is the node to check as the last node. 404 """ 405 return _chain.rtems_chain_is_last(the_node)
Is this the last node on the chain.
This function returns true if the_node is the last node on a chain and false otherwise.
Parameters
- the_node: is the node to check as the last node.
407def rtems_chain_has_only_one_node(the_chain): 408 r""" 409 Does this chain have only one node. 410 411 This function returns true if there is only one node on *the_chain* and 412 false otherwise. 413 414 :type the_chain: rtems_chain_control, in 415 :param the_chain: is the chain to be operated upon. 416 """ 417 return _chain.rtems_chain_has_only_one_node(the_chain)
Does this chain have only one node.
This function returns true if there is only one node on the_chain and false otherwise.
Parameters
- the_chain: is the chain to be operated upon.
419def rtems_chain_is_head(the_chain, the_node): 420 r""" 421 Is this node the chain head. 422 423 This function returns true if *the_node* is the head of the_chain and 424 false otherwise. 425 426 :type the_chain: rtems_chain_control, in 427 :param the_chain: is the chain to be operated upon. 428 :type the_node: rtems_chain_node, in 429 :param the_node: is the node to check for being the Chain Head. 430 """ 431 return _chain.rtems_chain_is_head(the_chain, the_node)
Is this node the chain head.
This function returns true if the_node is the head of the_chain and false otherwise.
Parameters
- the_chain: is the chain to be operated upon.
- the_node: is the node to check for being the Chain Head.
433def rtems_chain_is_tail(the_chain, the_node): 434 r""" 435 Is this node the chain tail. 436 437 This function returns true if the_node is the tail of the_chain and 438 false otherwise. 439 440 :type the_chain: rtems_chain_control, in 441 :param the_chain: is the chain to be operated upon. 442 :type the_node: rtems_chain_node, in 443 :param the_node: is the node to check for being the Chain Tail. 444 """ 445 return _chain.rtems_chain_is_tail(the_chain, the_node)
Is this node the chain tail.
This function returns true if the_node is the tail of the_chain and false otherwise.
Parameters
- the_chain: is the chain to be operated upon.
- the_node: is the node to check for being the Chain Tail.
447def rtems_chain_extract(the_node): 448 r""" 449 Extract the specified node from a chain. 450 451 This routine extracts *the_node* from the chain on which it resides. 452 It disables interrupts to ensure the atomicity of the 453 extract operation. 454 455 * the_node specifies the node to extract 456 """ 457 return _chain.rtems_chain_extract(the_node)
Extract the specified node from a chain.
This routine extracts the_node from the chain on which it resides. It disables interrupts to ensure the atomicity of the extract operation.
- the_node specifies the node to extract
459def rtems_chain_extract_unprotected(the_node): 460 r""" 461 Extract the specified node from a chain (unprotected). 462 463 This routine extracts *the_node* from the chain on which it resides. 464 465 NOTE: It does NOT disable interrupts to ensure the atomicity of the 466 append operation. 467 """ 468 return _chain.rtems_chain_extract_unprotected(the_node)
Extract the specified node from a chain (unprotected).
This routine extracts the_node from the chain on which it resides.
NOTE: It does NOT disable interrupts to ensure the atomicity of the append operation.
470def rtems_chain_get(the_chain): 471 r""" 472 Obtain the first node on a chain. 473 474 This function removes the first node from *the_chain* and returns 475 a pointer to that node. If *the_chain* is empty, then NULL is returned. 476 477 :rtype: rtems_chain_node 478 :return: This method returns a pointer a node. If a node was removed, 479 then a pointer to that node is returned. If *the_chain* was 480 empty, then NULL is returned. 481 482 NOTE: It disables interrupts to ensure the atomicity of the get operation. 483 """ 484 return _chain.rtems_chain_get(the_chain)
Obtain the first node on a chain.
This function removes the first node from the_chain and returns a pointer to that node. If the_chain is empty, then NULL is returned.
Returns
This method returns a pointer a node. If a node was removed, then a pointer to that node is returned. If the_chain was empty, then NULL is returned.
NOTE: It disables interrupts to ensure the atomicity of the get operation.
486def rtems_chain_get_unprotected(the_chain): 487 r"""See _Chain_Get_unprotected().""" 488 return _chain.rtems_chain_get_unprotected(the_chain)
See _Chain_Get_unprotected().
490def rtems_chain_get_first_unprotected(the_chain): 491 r"""See _Chain_Get_first_unprotected().""" 492 return _chain.rtems_chain_get_first_unprotected(the_chain)
See _Chain_Get_first_unprotected().
494def rtems_chain_insert(after_node, the_node): 495 r""" 496 Insert a node on a chain 497 498 This routine inserts *the_node* on a chain immediately following 499 *after_node*. 500 501 NOTE: It disables interrupts to ensure the atomicity 502 of the extract operation. 503 """ 504 return _chain.rtems_chain_insert(after_node, the_node)
Insert a node on a chain
This routine inserts the_node on a chain immediately following after_node.
NOTE: It disables interrupts to ensure the atomicity of the extract operation.
506def rtems_chain_insert_unprotected(after_node, the_node): 507 r"""See _Chain_Insert_unprotected().""" 508 return _chain.rtems_chain_insert_unprotected(after_node, the_node)
See _Chain_Insert_unprotected().
510def rtems_chain_append(the_chain, the_node): 511 r""" 512 Append a node on the end of a chain. 513 514 This routine appends *the_node* onto the end of *the_chain*. 515 516 NOTE: It disables interrupts to ensure the atomicity of the 517 append operation. 518 """ 519 return _chain.rtems_chain_append(the_chain, the_node)
Append a node on the end of a chain.
This routine appends the_node onto the end of the_chain.
NOTE: It disables interrupts to ensure the atomicity of the append operation.
521def rtems_chain_append_unprotected(the_chain, the_node): 522 r""" 523 Append a node on the end of a chain (unprotected). 524 525 This routine appends *the_node* onto the end of *the_chain*. 526 527 NOTE: It does NOT disable interrupts to ensure the atomicity of the 528 append operation. 529 """ 530 return _chain.rtems_chain_append_unprotected(the_chain, the_node)
Append a node on the end of a chain (unprotected).
This routine appends the_node onto the end of the_chain.
NOTE: It does NOT disable interrupts to ensure the atomicity of the append operation.
532def rtems_chain_prepend(the_chain, the_node): 533 r""" 534 Prepend a node. 535 536 This routine prepends the_node onto the front of the_chain. 537 538 :type the_chain: rtems_chain_control, in 539 :param the_chain: is the chain to be operated upon. 540 :type the_node: rtems_chain_node, in 541 :param the_node: is the node to be prepended. 542 543 NOTE: It disables interrupts to ensure the atomicity of the 544 prepend operation. 545 """ 546 return _chain.rtems_chain_prepend(the_chain, the_node)
Prepend a node.
This routine prepends the_node onto the front of the_chain.
Parameters
- the_chain: is the chain to be operated upon.
- the_node: is the node to be prepended.
NOTE: It disables interrupts to ensure the atomicity of the prepend operation.
548def rtems_chain_prepend_unprotected(the_chain, the_node): 549 r""" 550 Prepend a node (unprotected). 551 552 This routine prepends the_node onto the front of the_chain. 553 554 :type the_chain: rtems_chain_control, in 555 :param the_chain: is the chain to be operated upon. 556 :type the_node: rtems_chain_node, in 557 :param the_node: is the node to be prepended. 558 559 NOTE: It does NOT disable interrupts to ensure the atomicity of the 560 prepend operation. 561 """ 562 return _chain.rtems_chain_prepend_unprotected(the_chain, the_node)
Prepend a node (unprotected).
This routine prepends the_node onto the front of the_chain.
Parameters
- the_chain: is the chain to be operated upon.
- the_node: is the node to be prepended.
NOTE: It does NOT disable interrupts to ensure the atomicity of the prepend operation.
564def rtems_chain_append_with_empty_check(chain, node): 565 r""" 566 Checks if the *chain* is empty and appends the *node*. 567 568 Interrupts are disabled to ensure the atomicity of the operation. 569 """ 570 return _chain.rtems_chain_append_with_empty_check(chain, node)
Checks if the chain is empty and appends the node.
Interrupts are disabled to ensure the atomicity of the operation.
572def rtems_chain_prepend_with_empty_check(chain, node): 573 r""" 574 Checks if the *chain* is empty and prepends the *node*. 575 576 Interrupts are disabled to ensure the atomicity of the operation. 577 """ 578 return _chain.rtems_chain_prepend_with_empty_check(chain, node)
Checks if the chain is empty and prepends the node.
Interrupts are disabled to ensure the atomicity of the operation.
580def rtems_chain_get_with_empty_check(chain, node): 581 r""" 582 Tries to get the first *node* and check if the *chain* is empty 583 afterwards. 584 585 This function removes the first node from the *chain* and returns a pointer 586 to that node in *node*. If the *chain* is empty, then ``NULL`` is returned. 587 588 Interrupts are disabled to ensure the atomicity of the operation. 589 """ 590 return _chain.rtems_chain_get_with_empty_check(chain, node)
Tries to get the first node and check if the chain is empty afterwards.
This function removes the first node from the chain and returns a pointer
to that node in node. If the chain is empty, then NULL is returned.
Interrupts are disabled to ensure the atomicity of the operation.
592def rtems_chain_node_count_unprotected(chain): 593 r""" 594 Returns the node count of the chain. 595 596 :type chain: rtems_chain_control, in 597 :param chain: The chain. 598 599 Notes: It does NOT disable interrupts to ensure the atomicity of the 600 operation. 601 602 :rtype: int 603 :return: The node count of the chain. 604 """ 605 return _chain.rtems_chain_node_count_unprotected(chain)
Returns the node count of the chain.
Parameters
- chain: The chain.
Notes: It does NOT disable interrupts to ensure the atomicity of the operation.
Returns
The node count of the chain.