reactor-c
C Runtime for Lingua Franca
Loading...
Searching...
No Matches
port.c File Reference
#include <stdio.h>
#include "port.h"
#include "vector.h"

Functions

int compare_sizes (const void *a, const void *b)
 
lf_multiport_iterator_t _lf_multiport_iterator_impl (lf_port_base_t **port, int width)
 
int lf_multiport_next (lf_multiport_iterator_t *iterator)
 

Detailed Description

Author
Edward A. Lee (eal@b.nosp@m.erke.nosp@m.ley.e.nosp@m.du)

LICENSE

Copyright (c) 2022, The University of California at Berkeley.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

DESCRIPTION

Header file for macros, functions, and structs for optimized sparse I/O through multiports.

Function Documentation

◆ _lf_multiport_iterator_impl()

lf_multiport_iterator_t _lf_multiport_iterator_impl ( lf_port_base_t ** port,
int width )

Given an array of pointers to port structs, return an iterator that can be used to iterate over the present channels.

Parameters
portAn array of pointers to port structs.
widthThe width of the multiport (or a negative number if not a multiport).

◆ compare_sizes()

int compare_sizes ( const void * a,
const void * b )

Compare two non-negative integers pointed to. Return -1 if a < b, 0 if a == b, and 1 if a > b.

Parameters
aPointer to the first integer.
bPointer to the second integer.

◆ lf_multiport_next()

int lf_multiport_next ( lf_multiport_iterator_t * iterator)

Return the channel number of the next present input on the multiport or -1 if there are no more present channels.

Parameters
iteratorThe iterator.