Skip to content

Commit

Permalink
steaming mode example
Browse files Browse the repository at this point in the history
  • Loading branch information
usr3-1415 committed Mar 8, 2020
1 parent 236eba4 commit 277b430
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Docs/examples/streaming_mode/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ export PATH:=$(realpath ../../../Asn1f4/bin/Debug/):$(PATH)

$(info ${PATH})

all:
all: cTest adaTest

cTest:
Asn1f4.exe -c -uPER -sm -equal -o c_out/ a.asn && (cd c_out; make coverage; cd ..)

adaTest:
Asn1f4.exe -Ada -uPER -sm -equal -o ada_out/ a.asn && (cd ada_out; make coverage; cd ..)
1 change: 1 addition & 0 deletions Docs/examples/streaming_mode/ada_out/user_code.adb
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ procedure decode_with_streaming_mode(decodedPDU : out A1; Filename : in String;
stream : adaasn1rtl.encoding.Bitstream := adaasn1rtl.encoding.BitStream_init(1024);

begin
stream.fetchDataPrm := 1;
Seq_IO.Open(ft,Seq_IO.In_File,Filename);
read_from_file(stream,ft);
-- TASTE_Dataview.A1_Decode(decodedPDU, stream, result);
Expand Down
45 changes: 45 additions & 0 deletions Docs/examples/streaming_mode/c_out/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# The directories containing the source files, separated by ':'
VPATH=.

CC=gcc

# To make "debug" the default configuration if invoked with just "make":
#
# The source files: regardless of where they reside in the source tree,
# VPATH will locate them...
Group0_SRC = $(shell echo *.c)

# Build a Dependency list and an Object list, by replacing the .c
# extension to .d for dependency files, and .o for object files.
Group0_OBJ = $(patsubst %.c, %.o, ${Group0_SRC})

# Your final binary
TARGET=mainprogram

# What include flags to pass to the compiler
INCLUDEFLAGS= -I .

# -Wall -Wextra -pedantic -Wcast-qual -Wformat=2 -Wshadow -Wundef -Wno-unused -Wuninitialized -Wno-unused-parameter -fdiagnostics-show-option
# Separate compile options per configuration
CFLAGS += -g -Wall -Werror -Wextra -Wuninitialized -Wcast-qual -Wshadow -Wundef -fdiagnostics-show-option -D_DEBUG ${INCLUDEFLAGS} -O0 -fprofile-arcs -ftest-coverage
LDFLAGS += -g -ftest-coverage -fprofile-arcs

# A common link flag for all configurations
LDFLAGS +=

all: ${TARGET}

${TARGET}: ${Group0_OBJ}
@mkdir -p $(dir $@)
$(CC) -g -o $@ $^ ${LDFLAGS}

%.o: %.c
@mkdir -p $(dir $@)
$(CC) -c $(CFLAGS) -o $@ $<

coverage:
$(MAKE) && ./$(TARGET) && \
gcov sample1.c

clean:
@rm -rf *.o $(TARGET) *.gcda *.gcno *.gcov

0 comments on commit 277b430

Please sign in to comment.