reactor-c 1.0
C Runtime for Lingua Franca
Loading...
Searching...
No Matches
util.h File Reference

Core utility functions for Lingua Franca. More...

#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include "logging_macros.h"

Go to the source code of this file.

Macros

#define CONCATENATE_THREE_STRINGS(__string1, __string2, __string3)
 A handy macro that can concatenate three strings.
#define LF_COND_BROADCAST(cond)
 Broadcast a condition variable with error checking.
#define LF_COND_INIT(cond, mutex)
 Initialize condition variable with error checking.
#define LF_COND_SIGNAL(cond)
 Signal a condition variable with error checking.
#define LF_COND_WAIT(cond)
 Wait on a condition variable with error checking.
#define LF_CRITICAL_SECTION_ENTER(env)
 Enter critical section with error checking.
#define LF_CRITICAL_SECTION_EXIT(env)
 Exit critical section with error checking.
#define LF_LEVEL(index)
 Macro for extracting the level from the index of a reaction.
#define LF_MAX(X, Y)
 Utility for finding the maximum of two values.
#define LF_MIN(X, Y)
 Utility for finding the minimum of two values.
#define LF_MUTEX_INIT(mutex)
 Initialize mutex with error checking.
#define LF_MUTEX_LOCK(mutex)
 Lock mutex with error checking.
#define LF_MUTEX_UNLOCK(mutex)
 Unlock mutex with error checking.

Functions

void void void void error (const char *msg)
 Print the error defined by the errno variable with the specified message as a prefix, then exit with error code 1.
uint16_t lf_fed_id (void)
 Return the federate ID or -1 if this program is not part of a federation.
void lf_vprint (const char *format, va_list args) ATTRIBUTE_FORMAT_PRINTF(1
 varargs alternative of "lf_print"
void void void lf_vprint_debug (const char *format, va_list args) ATTRIBUTE_FORMAT_PRINTF(1
 varargs alternative of "lf_print_debug"
void lf_vprint_error (const char *format, va_list args) ATTRIBUTE_FORMAT_PRINTF(1
 varargs alternative of "lf_print_error"
void void void lf_vprint_error_and_exit (const char *format, va_list args) ATTRIBUTE_FORMAT_PRINTF(1
 varargs alternative of "lf_print_error_and_exit"
void void lf_vprint_log (const char *format, va_list args) ATTRIBUTE_FORMAT_PRINTF(1
 varargs alternative of "lf_print_log"
void void lf_vprint_warning (const char *format, va_list args) ATTRIBUTE_FORMAT_PRINTF(1
 varargs alternative of "lf_print_warning"

Variables

uint16_t _lf_my_fed_id
 The ID of this federate.

Detailed Description

Core utility functions for Lingua Franca.

Author
Edward A. Lee
Soroush Bateni