reactor-c
C Runtime for Lingua Franca
|
Go to the source code of this file.
Macros | |
#define | LF_TRACE |
#define | _LF_TRACE_FAILURE(trace_file) |
#define | BUFFER_SIZE 1024 |
Functions | |
void | usage () |
char * | root_name (const char *path) |
Return the root file name from the given path. Given a path to a file, this function returns a dynamically allocated string (which you must free) that points to the root filename without the preceding path and without the file extension. | |
FILE * | open_file (const char *path, const char *mode) |
Open the specified file for reading or writing. This function records the file for closing at termination. | |
char * | get_object_description (void *reactor, int *index) |
char * | get_trigger_name (void *trigger, int *index) |
void | print_table () |
size_t | read_header () |
int | read_trace () |
Variables | |
const char * | trace_event_names [] |
trace_record_t | trace [] |
FILE * | trace_file |
FILE * | output_file |
FILE * | summary_file |
instant_t | start_time |
object_description_t * | object_table |
int | object_table_size |
char * | top_level |
Copyright (c) 2020, 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:
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.
Header file for common utilities used in converting Lingua Franca trace files into other formats.
#define _LF_TRACE_FAILURE | ( | trace_file | ) |
Macro to use when access to trace file fails.
#define BUFFER_SIZE 1024 |
Buffer for reading object descriptions. Size limit is BUFFER_SIZE bytes.
#define LF_TRACE |
char * get_object_description | ( | void * | pointer, |
int * | index ) |
Get the description of the object pointed to by the specified pointer. For example, this can be the name of a reactor (pointer points to the self struct) or a user-defined string. If there is no such pointer in the symbol table, return NULL. If the index argument is non-null, then put the index of the entry in the table into the int pointed to or -1 if none was found.
pointer | The pointer to to an object, e.g. a self struct. |
index | An optional pointer into which to write the index. |
Get the description of the object pointed to by the specified pointer. For example, this can be the name of a reactor (pointer points to the self struct) or a user-define string. If there is no such pointer in the symbol table, return NULL. If the index argument is non-null, then put the index of the entry in the table into the int pointed to or -1 if none was found.
pointer | The pointer to to an object, e.g. a self struct. |
index | An optional pointer into which to write the index. |
char * get_trigger_name | ( | void * | trigger, |
int * | index ) |
Get the trigger name for the specified pointer. If there is no such trigger, return NULL. If the index argument is non-null, then put the index of the trigger in the table into the int pointed to or -1 if none was found.
reactor | The pointer to a self struct. |
index | An optional pointer into which to write the index. |
FILE * open_file | ( | const char * | path, |
const char * | mode ) |
Open the specified file for reading or writing. This function records the file for closing at termination.
path | The path to the file. |
mode | "r" for reading and "w" for writing. |
void print_table | ( | ) |
Print the object to description table.
size_t read_header | ( | ) |
Read header information.
int read_trace | ( | ) |
Read the trace from the trace_file and put it in the trace global variable. Return the length of the trace.
char * root_name | ( | const char * | path | ) |
Return the root file name from the given path. Given a path to a file, this function returns a dynamically allocated string (which you must free) that points to the root filename without the preceding path and without the file extension.
path | The path including the full filename. |
void usage | ( | ) |
Print a usage message.
|
extern |
Table of pointers to a description of the object.
Table of pointers to the self struct of a reactor.
|
extern |
|
extern |
File for writing the output data.
|
extern |
The start time read from the trace file.
|
extern |
File for writing summary statistics.
|
extern |
Name of the top-level reactor (first entry in symbol table).
|
extern |
Buffer for reading trace records.
|
extern |
String description of event types.
|
extern |
File containing the trace binary data.