Next: 4.10.38 qs Up: 4.10 Classes Previous: 4.10.36 ql Contents Index
Subsections

- 4.10.37.1 API

##
4.10.37 qr

The qr macros implement operations on a ring. The type of the ring elements and which field of the elements to use are determined by arguments that are passed into the macros. The macros are optimized for speed and code size, which means that there is minimal error checking built in. As a result, care must be taken to assure that these are used as intended, or strange things can happen.

### 4.10.37.1 API

qr(<qr_type> a_type):

  Input(s):
    a_type:
      Data type for the qr.
  Output(s):
    A data structure that can be used for a qr.
  Exception(s):
    None.
  Description:
    Generate code for a qr data structure.

void qr_new(<qr_type> *a_qr, <field_name> a_field):

  Input(s):
    a_qr:
      Pointer to a qr.
    a_field:
      Field within the qr elements to use.
  Output(s):
    None.
  Exception(s):
    None.
  Description:
    Constructor.

<qr_type> * qr_next(<qr_type> *a_qr, <field_name> a_field):

  Input(s):
    a_qr:
      Pointer to a qr.
    a_field:
      Field within the qr elements to use.
  Output(s):
    retval:
      Pointer to the next element in the qr.
  Exception(s):
    None.
  Description:
    Return a pointer to the next element in the qr.

<qr_type> * qr_prev(<qr_type> *a_qr, <field_name> a_field):

  Input(s):
    a_qr:
      Pointer to a qr.
    a_field:
      Field within the qr elements to use.
  Output(s):
    retval:
      Pointer to the previous element in the qr.
  Exception(s):
    None.
  Description:
    Return a pointer to the previous element in the qr.

void qr_before_insert(<qr_type> *a_qrelm, <qr_type> *a_qr, <field_name> a_field):

  Input(s):
    a_qrelm:
      Pointer to an element in a qr.
    a_qr:
      Pointer to an element that is the only element in its ring.
    a_field:
      Field within the qr elements to use.
  Output(s):
    None.
  Exception(s):
    None.
  Description:
    Insert a_qr before a_qrelm.

void qr_after_insert(<qr_type> *a_qrelm, <qr_type> *a_qr, <field_name> a_field):

  Input(s):
    a_qrelm:
      Pointer to an element in a qr.
    a_qr:
      Pointer to an element that is the only element in its ring.
    a_field:
      Field within the qr elements to use.
  Output(s):
    None.
  Exception(s):
    None.
  Description:
    Insert a_qr after a_qrelm.

void qr_meld(<qr_type> *a_qr_a, <qr_type> *a_qr_b, <qr_type> a_type, <field_name> a_field):

  Input(s):
    a_qr_a:
      Pointer to a qr.
    a_qr_b:
      Pointer to a qr.
    a_type:
      Data type for the qr elements.
    a_field:
      Field within the qr elements to use.
  Output(s):
    None.
  Exception(s):
    None.
  Description:
    Meld a_qr_a and a_qr_b into one ring.

void qr_split(<qr_type> *a_qr_a, <qr_type> *a_qr_b, <qr_type> a_type, <field_name> a_field):

  Input(s):
    a_qr_a:
      Pointer to a qr.
    a_qr_b:
      Pointer to a qr.
    a_type:
      Data type for the qr elements.
    a_field:
      Field within the qr elements to use.
  Output(s):
    None.
  Exception(s):
    None.
  Description:
    Split a ring at a_qr_a and a_qr_b.

void qr_remove(<qr_type> *a_qr, <field_name> a_field):

  Input(s):
    a_qr:
      Pointer to a qr.
    a_field:
      Field within the qr elements to use.
  Output(s):
    None.
  Exception(s):
    None.
  Description:
    Remove a_qr from the ring.

qr_foreach(<qr_type> *a_var, <qr_type> *a_qr, <field_name> a_field):

  Input(s):
    a_var:
      The name of a temporary variable to use for iteration.
    a_qr:
      Pointer to a qr.
    a_field:
      Field within the qr elements to use.
  Output(s):
    None.
  Exception(s):
    None.
  Description:
    Iterate through the qr, storing a pointer to each element in a_var along the way.

qr_reverse_foreach(<qr_type> *a_var, <qr_type> *a_qr, <field_name> a_field):

  Input(s):
    a_var:
      The name of a temporary variable to use for iteration.
    a_qr:
      Pointer to a qr.
    a_field:
      Field within the qr elements to use.
  Output(s):
    None.
  Exception(s):
    None.
  Description:
    Iterate through the qr in the reverse direction, storing a pointer to each element in a_var along the way.

Next: 4.10.38 qs Up: 4.10 Classes Previous: 4.10.36 ql Contents Index