Skip to content

Commit

Permalink
Add stdio.h back into the user-visible namespace.
Browse files Browse the repository at this point in the history
I think that in the long run this might not be what we want, but it
reduces the impact of this and the accompanying reactor-c PR on
existing LF programs.
  • Loading branch information
petervdonovan committed Mar 31, 2023
1 parent da9c9ea commit dc4177c
Show file tree
Hide file tree
Showing 188 changed files with 2 additions and 664 deletions.
2 changes: 1 addition & 1 deletion org.lflang/src/lib/c/reactor-c
Submodule reactor-c updated 1 files
+1 −0 include/api/api.h
4 changes: 0 additions & 4 deletions test/C/src/ActionDelay.lf
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
// Test logical action with delay.
target C

preamble {=
#include <stdio.h>
=}

reactor GeneratedDelay {
input y_in: int
output y_out: int
Expand Down
4 changes: 0 additions & 4 deletions test/C/src/ActionIsPresent.lf
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
// Tests the is_present variable for actions.
target C

preamble {=
#include <stdio.h>
=}

main reactor ActionIsPresent(offset: time = 1 nsec, period: time = 500 msec) {
logical action a
state success: bool = false
Expand Down
4 changes: 0 additions & 4 deletions test/C/src/ActionWithNoReaction.lf
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ target C {
timeout: 3 sec
}

preamble {=
#include <stdio.h>
=}

reactor foo {
input x: int
output y: int
Expand Down
4 changes: 0 additions & 4 deletions test/C/src/After.lf
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ target C {
timeout: 3 sec
}

preamble {=
#include <stdio.h>
=}

reactor foo {
input x: int
output y: int
Expand Down
4 changes: 0 additions & 4 deletions test/C/src/AfterCycles.lf
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
// running without detected a cycle.
target C

preamble {=
#include <stdio.h>
=}

reactor Source {
output out: unsigned

Expand Down
4 changes: 0 additions & 4 deletions test/C/src/AfterOverlapped.lf
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ target C {

import Count from "lib/Count.lf"

preamble {=
#include <stdio.h>
=}

reactor Test {
input c: int
state i: int = 0
Expand Down
4 changes: 0 additions & 4 deletions test/C/src/AfterZero.lf
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ target C {
timeout: 3 sec
}

preamble {=
#include <stdio.h>
=}

reactor foo {
input x: int
output y: int
Expand Down
4 changes: 0 additions & 4 deletions test/C/src/ArrayAsParameter.lf
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
// encode their own length.
target C

preamble {=
#include <stdio.h>
=}

reactor Source(sequence: int[] = {0, 1, 2}, n_sequence: int = 3) {
output out: int
state count: int = 0
Expand Down
4 changes: 0 additions & 4 deletions test/C/src/ArrayAsType.lf
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
// destination references the array directly.
target C

preamble {=
#include <stdio.h>
=}

reactor Source {
output out: int[3]

Expand Down
4 changes: 0 additions & 4 deletions test/C/src/ArrayPrint.lf
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ target C {
fast: true
}

preamble {=
#include <stdio.h>
=}

reactor Source(size: int = 3) {
output out: int[]
state count: int = 0
Expand Down
4 changes: 0 additions & 4 deletions test/C/src/CharLiteralInitializer.lf
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
// Check that a state variable can have a char literal initializer
target C

preamble {=
#include <stdio.h>
=}

main reactor CharLiteralInitializer {
state c: char = 'x'

Expand Down
4 changes: 0 additions & 4 deletions test/C/src/Composition.lf
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ target C {
timeout: 10 sec
}

preamble {=
#include <stdio.h>
=}

reactor Source(period: time = 2 sec) {
output y: int
timer t(1 sec, period)
Expand Down
4 changes: 0 additions & 4 deletions test/C/src/CompositionAfter.lf
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ target C {
timeout: 10 sec
}

preamble {=
#include <stdio.h>
=}

reactor Source(period: time = 2 sec) {
output y: int
timer t(1 sec, period)
Expand Down
4 changes: 0 additions & 4 deletions test/C/src/CompositionGain.lf
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
// This tests send data through a contained reactor.
target C

preamble {=
#include <stdio.h>
=}

reactor Gain {
input gainin: int
output y: int
Expand Down
4 changes: 0 additions & 4 deletions test/C/src/CompositionInheritance.lf
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ target C {
timeout: 10 sec
}

preamble {=
#include <stdio.h>
=}

reactor Source(period: time = 2 sec) {
input foo: int
output y: int
Expand Down
4 changes: 0 additions & 4 deletions test/C/src/DanglingOutput.lf
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
// in a compilation error. Passing the test is just compiling and running.
target C

preamble {=
#include <stdio.h>
=}

reactor Source {
output out: int
timer t
Expand Down
1 change: 0 additions & 1 deletion test/C/src/Deadline.lf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ preamble {=
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
#include "platform.h"
#ifdef __cplusplus
}
Expand Down
4 changes: 0 additions & 4 deletions test/C/src/DeadlineAnytime.lf
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
// Test whether the lf_check_deadline function works.
target C

preamble {=
#include <stdio.h>
=}

reactor A {
state i: int
logical action a
Expand Down
1 change: 0 additions & 1 deletion test/C/src/DeadlineHandledAbove.lf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ preamble {=
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
#include "platform.h"
#ifdef __cplusplus
}
Expand Down
4 changes: 0 additions & 4 deletions test/C/src/DeadlineZero.lf
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ target C {
timeout: 1 sec
}

preamble {=
#include <stdio.h>
=}

reactor Detector {
input trigger: int
state cnt: int = 0
Expand Down
4 changes: 0 additions & 4 deletions test/C/src/DelayArray.lf
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ target C {
build-type: RelWithDebInfo
}

preamble {=
#include <stdio.h>
=}

reactor DelayPointer(delay: time = 100 msec) {
input in: int[]
output out: int[]
Expand Down
4 changes: 0 additions & 4 deletions test/C/src/DelayArrayWithAfter.lf
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ target C {
fast: true
}

preamble {=
#include <stdio.h>
=}

reactor Source {
output out: int[]
state iteration: int = 1
Expand Down
4 changes: 0 additions & 4 deletions test/C/src/DelayInt.lf
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
// This tests actions with payloads by delaying an input by a fixed amount.
target C

preamble {=
#include <stdio.h>
=}

reactor Delay(delay: time = 100 msec) {
input in: int
output out: int
Expand Down
4 changes: 0 additions & 4 deletions test/C/src/DelayPointer.lf
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
// Test delaying a pointer type.
target C

preamble {=
#include <stdio.h>
=}

reactor DelayPointer2(delay: time = 100 msec) {
input in: int*
output out: int*
Expand Down
1 change: 0 additions & 1 deletion test/C/src/DelayString.lf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ preamble {=
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
#include <string.h>
#ifdef __cplusplus
}
Expand Down
1 change: 0 additions & 1 deletion test/C/src/DelayStructWithAfter.lf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ target C {

preamble {=
#include "hello.h"
#include <stdio.h>
=}

reactor Source {
Expand Down
1 change: 0 additions & 1 deletion test/C/src/DelayStructWithAfterOverlapped.lf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ target C {

preamble {=
#include "hello.h"
#include <stdio.h>
=}

reactor Source {
Expand Down
4 changes: 0 additions & 4 deletions test/C/src/DelayedAction.lf
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ target C {
timeout: 5 sec
}

preamble {=
#include <stdio.h>
=}

main reactor DelayedAction {
timer t(0, 1 sec)
logical action a
Expand Down
4 changes: 0 additions & 4 deletions test/C/src/DelayedReaction.lf
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
// Test delay made on a connection.
target C

preamble {=
#include <stdio.h>
=}

reactor Source {
output out: int
timer t
Expand Down
4 changes: 0 additions & 4 deletions test/C/src/Determinism.lf
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
target C

preamble {=
#include <stdio.h>
=}

reactor Source {
output y: int
timer t
Expand Down
4 changes: 0 additions & 4 deletions test/C/src/DoubleInvocation.lf
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ target C {
fast: true
}

preamble {=
#include <stdio.h>
=}

reactor Ball {
output position: int
output velocity: int
Expand Down
4 changes: 0 additions & 4 deletions test/C/src/DoublePort.lf
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ target C {

import Count from "lib/Count.lf"

preamble {=
#include <stdio.h>
=}

reactor CountMicrostep {
state count: int = 1
output out: int
Expand Down
4 changes: 0 additions & 4 deletions test/C/src/DoubleReaction.lf
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ target C {
fast: true
}

preamble {=
#include <stdio.h>
=}

reactor Clock(offset: time = 0, period: time = 1 sec) {
output y: int
timer t(offset, period)
Expand Down
4 changes: 0 additions & 4 deletions test/C/src/DoubleTrigger.lf
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ target C {
fast: true
}

preamble {=
#include <stdio.h>
=}

main reactor DoubleTrigger {
timer t1
timer t2
Expand Down
4 changes: 0 additions & 4 deletions test/C/src/Gain.lf
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
// Example in the Wiki.
target C

preamble {=
#include <stdio.h>
=}

reactor Scale(scale: int = 2) {
input x: int
output y: int
Expand Down
4 changes: 0 additions & 4 deletions test/C/src/GetTime.lf
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ target C {
fast: false
}

preamble {=
#include <stdio.h>
=}

main reactor GetTime {
timer t(0, 1 sec)

Expand Down
1 change: 0 additions & 1 deletion test/C/src/Hello.lf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ target C {
}

preamble {=
#include <stdio.h>
#include <time.h>
=}

Expand Down
Loading

0 comments on commit dc4177c

Please sign in to comment.