Commit ee986f09 authored by Anders Blomdell's avatar Anders Blomdell
Browse files

Merge branch 'anders.blomdell'

parents 37eaf0b7 b63cf3bb
...@@ -10,14 +10,16 @@ lib/c/liblabcomm2006.a ...@@ -10,14 +10,16 @@ lib/c/liblabcomm2006.a
lib/c/liblabcomm2014.so.1 lib/c/liblabcomm2014.so.1
lib/c/liblabcomm2014.so lib/c/liblabcomm2014.so
lib/c/liblabcomm2014.a lib/c/liblabcomm2014.a
lib/c/test/test_labcomm lib/c/20*/test/test_labcomm
lib/c/test/test_labcomm_basic_type_encoding lib/c/20*/test/test_labcomm_basic_type_encoding
lib/c/test/test_labcomm_copy lib/c/20*/test/test_labcomm_copy
lib/c/test/test_labcomm_generated_encoding lib/c/20*/test/test_labcomm_generated_encoding
lib/c/test/test_labcomm_pthread_scheduler lib/c/20*/test/test_labcomm_pthread_scheduler
lib/c/test/test_signature_numbers lib/c/20*/test/test_signature_numbers
compiler/AST/ compiler/AST/
compiler/labcomm_compiler.jar compiler/labcomm_compiler.jar
compiler/labcomm2006_compiler.jar
compiler/labcomm2014_compiler.jar
encoded_data encoded_data
encoded_data06 encoded_data06
gen gen
......
...@@ -339,11 +339,6 @@ aspect Java_Class { ...@@ -339,11 +339,6 @@ aspect Java_Class {
env.println("e.register(dispatcher);"); env.println("e.register(dispatcher);");
env.unindent(); env.unindent();
env.println("}"); env.println("}");
env.println("public static void registerSampleRef(Encoder e) throws IOException{");
env.indent();
env.println("e.registerSampleRef(dispatcher);");
env.unindent();
env.println("}");
env.println(); env.println();
} }
...@@ -435,11 +430,6 @@ aspect Java_Class { ...@@ -435,11 +430,6 @@ aspect Java_Class {
env.println("d.register(dispatcher, h);"); env.println("d.register(dispatcher, h);");
env.unindent(); env.unindent();
env.println("}"); env.println("}");
env.println("public static void registerSampleRef(Decoder d) throws IOException {");
env.indent();
env.println("d.registerSampleRef(dispatcher);");
env.unindent();
env.println("}");
env.println(); env.println();
...@@ -652,7 +642,6 @@ aspect Java_Class { ...@@ -652,7 +642,6 @@ aspect Java_Class {
case LABCOMM_FLOAT: { env.print("e.encodeFloat"); } break; case LABCOMM_FLOAT: { env.print("e.encodeFloat"); } break;
case LABCOMM_DOUBLE: { env.print("e.encodeDouble"); } break; case LABCOMM_DOUBLE: { env.print("e.encodeDouble"); } break;
case LABCOMM_STRING: { env.print("e.encodeString"); } break; case LABCOMM_STRING: { env.print("e.encodeString"); } break;
case LABCOMM_SAMPLE: { env.print("e.encodeSampleRef"); } break;
} }
env.println("(" + name + ");"); env.println("(" + name + ");");
} }
...@@ -743,7 +732,6 @@ aspect Java_Class { ...@@ -743,7 +732,6 @@ aspect Java_Class {
case LABCOMM_FLOAT: { env.println("d.decodeFloat();"); } break; case LABCOMM_FLOAT: { env.println("d.decodeFloat();"); } break;
case LABCOMM_DOUBLE: { env.println("d.decodeDouble();"); } break; case LABCOMM_DOUBLE: { env.println("d.decodeDouble();"); } break;
case LABCOMM_STRING: { env.println("d.decodeString();"); } break; case LABCOMM_STRING: { env.println("d.decodeString();"); } break;
case LABCOMM_SAMPLE: { env.println("d.decodeSampleRef();"); } break;
} }
} }
......
...@@ -127,7 +127,7 @@ public class LabComm { ...@@ -127,7 +127,7 @@ public class LabComm {
String coreName = null; String coreName = null;
String prefix = null; String prefix = null;
boolean verbose = false; boolean verbose = false;
int ver = 2013; //Version 2013 as default int ver = 2006; // Version 2006 fixed
String cFile = null; String cFile = null;
String hFile = null; String hFile = null;
Vector cIncludes = new Vector(); Vector cIncludes = new Vector();
...@@ -192,8 +192,8 @@ public class LabComm { ...@@ -192,8 +192,8 @@ public class LabComm {
} else if (args[i].equals("-v")) { } else if (args[i].equals("-v")) {
verbose=true; verbose=true;
} else if (args[i].startsWith("--ver=")) { } else if (args[i].startsWith("--ver=")) {
ver = Integer.parseInt(args[i].substring(6)); /* ver = Integer.parseInt(args[i].substring(6));
checkVersion(ver); checkVersion(ver); */
} else if (args[i].equals("-C")) { } else if (args[i].equals("-C")) {
cFile = coreName + ".c"; cFile = coreName + ".c";
hFile = coreName + ".h"; hFile = coreName + ".h";
......
...@@ -53,8 +53,25 @@ ...@@ -53,8 +53,25 @@
<delete dir="${package}"/> <delete dir="${package}"/>
</target> </target>
<target name="jar_version" depends="build">
<jar destfile="labcomm${version}_compiler.jar">
<fileset dir="gen"
includes="se/lth/control/labcomm${version}/compiler/*.class"/>
<zipfileset src="tools/beaver-rt.jar" includes="beaver/*.class"/>
<manifest>
<attribute name="Main-Class"
value="se.lth.control.labcomm${version}.compiler.LabComm"/>
</manifest>
</jar>
</target>
<target name="jar" depends="build"> <target name="jar" depends="build">
<antcall target="jar_version">
<param name="version" value="2006"/>
</antcall>
<antcall target="jar_version">
<param name="version" value="2014"/>
</antcall>
<jar destfile="labcomm_compiler.jar"> <jar destfile="labcomm_compiler.jar">
<fileset dir="gen" includes="**/*.class"/> <fileset dir="gen" includes="**/*.class"/>
<zipfileset src="tools/beaver-rt.jar" includes="beaver/*.class"/> <zipfileset src="tools/beaver-rt.jar" includes="beaver/*.class"/>
......
#!/bin/sh
set -x
set -e
### Example compile script, showing the steps required to build a labcomm application ### Example compile script, showing the steps required to build a labcomm application
### (including compiler and libs). Also illustrates how versions 2013 and 2006 coexist ### (including compiler and libs). Also illustrates how versions 2013 and 2006 coexist
...@@ -10,12 +13,12 @@ java -jar ../../compiler/labcomm_compiler.jar --java=gen --c=gen/simple.c --h=ge ...@@ -10,12 +13,12 @@ java -jar ../../compiler/labcomm_compiler.jar --java=gen --c=gen/simple.c --h=ge
javac -cp ../../lib/java/labcomm2014.jar:. gen/*.java Encoder.java Decoder.java javac -cp ../../lib/java/labcomm2014.jar:. gen/*.java Encoder.java Decoder.java
gcc -Wall -Werror -Wno-unused-function \ gcc -Wall -Werror -Wno-unused-function \
-I. -I../../lib/c -L../../lib/c \ -I. -I../../lib/c/2014 -L../../lib/c \
-o example_encoder example_encoder.c gen/simple.c \ -o example_encoder example_encoder.c gen/simple.c \
-llabcomm2014 -Tlabcomm.linkscript -llabcomm2014
gcc -Wall -Werror -I . -I ../../lib/c -L../../lib/c \ gcc -Wall -Werror -I . -I ../../lib/c/2014 -L../../lib/c \
-o example_decoder example_decoder.c gen/simple.c \ -o example_decoder example_decoder.c gen/simple.c \
-llabcomm2014 -Tlabcomm.linkscript -llabcomm2014
# For version 2006 # For version 2006
...@@ -26,10 +29,10 @@ javac -cp ../../lib/java/labcomm2006.jar:. gen06/*.java Encoder06.java Decoder06 ...@@ -26,10 +29,10 @@ javac -cp ../../lib/java/labcomm2006.jar:. gen06/*.java Encoder06.java Decoder06
gcc -Wall -Werror -I. -I../../lib/c/2006 -L../../lib/c \ gcc -Wall -Werror -I. -I../../lib/c/2006 -L../../lib/c \
-o example_encoder06 example_encoder06.c gen06/simple.c \ -o example_encoder06 example_encoder06.c gen06/simple.c \
-llabcomm -Tlabcomm.linkscript -llabcomm2006
gcc -Wall -Werror -I . -I ../../lib/c/2006 -L../../lib/c \ gcc -Wall -Werror -I . -I ../../lib/c/2006 -L../../lib/c \
-o example_decoder06 example_decoder06.c gen06/simple.c \ -o example_decoder06 example_decoder06.c gen06/simple.c \
-llabcomm -Tlabcomm.linkscript -llabcomm2006
#gcc -o example_encoder -I . -I ../../lib/c example_encoder.c gen/simple.c ../../lib/c/labcomm.c ../../lib/c/labcomm_fd_reader_writer.c #gcc -o example_encoder -I . -I ../../lib/c example_encoder.c gen/simple.c ../../lib/c/labcomm.c ../../lib/c/labcomm_fd_reader_writer.c
......
...@@ -2,7 +2,7 @@ TARGETS=client server ...@@ -2,7 +2,7 @@ TARGETS=client server
LABCOMM_JAR=../../compiler/labcomm_compiler.jar LABCOMM_JAR=../../compiler/labcomm_compiler.jar
LABCOMM=java -jar $(LABCOMM_JAR) LABCOMM=java -jar $(LABCOMM_JAR)
CFLAGS=-O3 -g -Wall -Werror -I../../lib/c -I. -Wno-unused-function CFLAGS=-O3 -g -Wall -Werror -I../../lib/c/2014 -I. -Wno-unused-function
all: $(TARGETS:%=gen/%) all: $(TARGETS:%=gen/%)
...@@ -26,11 +26,11 @@ gen/%.c gen/%.h: %.lc | gen/.dir ...@@ -26,11 +26,11 @@ gen/%.c gen/%.h: %.lc | gen/.dir
gen/client: client.c gen/client: client.c
$(CC) -o $@ $(CFLAGS) $^ -lpthread \ $(CC) -o $@ $(CFLAGS) $^ -lpthread \
-L../../lib/c -llabcomm -L../../lib/c -llabcomm2014
gen/server: server.c gen/server: server.c
$(CC) -o $@ $(CFLAGS) $^ -lpthread \ $(CC) -o $@ $(CFLAGS) $^ -lpthread \
-L../../lib/c -llabcomm -L../../lib/c -llabcomm2014
.PHONY: clean distclean .PHONY: clean distclean
clean distclean: clean distclean:
......
...@@ -4,7 +4,7 @@ all: ...@@ -4,7 +4,7 @@ all:
cd java ; make cd java ; make
test: test:
$(MAKE) -C c -e run-test $(MAKE) -C c test
clean: clean:
cd c ; make clean cd c ; make clean
......
## Macros
VERSION=2006
LIBVERSION=2006
include ../os_compat.mk
ALL_DEPS=../liblabcomm$(LIBVERSION).a ../liblabcomm$(LIBVERSION).so.1
# TODO: Support for Codesourcery ARM toolchain.
OBJS=labcomm$(VERSION).o \
labcomm$(VERSION)_memory.o \
labcomm$(VERSION)_error.o \
labcomm$(VERSION)_default_error_handler.o \
labcomm$(VERSION)_default_memory.o \
labcomm$(VERSION)_default_scheduler.o \
labcomm$(VERSION)_time.o \
labcomm$(VERSION)_scheduler.o \
labcomm$(VERSION)_encoder.o \
labcomm$(VERSION)_decoder.o \
labcomm$(VERSION)_dynamic_buffer_writer.o \
labcomm$(VERSION)_fd_reader.o \
labcomm$(VERSION)_fd_writer.o \
labcomm$(VERSION)_pthread_scheduler.o
LABCOMM_JAR=../../../compiler/labcomm$(VERSION)_compiler.jar
LABCOMM=java -jar $(LABCOMM_JAR)
TESTS=test_labcomm_basic_type_encoding \
test_labcomm_generated_encoding \
test_signature_numbers \
test_labcomm \
test_labcomm_pthread_scheduler \
test_labcomm_copy
#FIXME: test_labcomm_errors
TEST_DIR=test
#VPATH=$(TEST_DIR)
## Targets
.PHONY: all
all: $(ALL_DEPS)
.PHONY: test
test: all $(TESTS:%=run-test-%)
.PHONY: clean
clean:
$(RM) *.o
$(RM) experimental/*.o
$(RM) experimental/ThrottleDrv/*.o
$(RM) test/*.o
$(RM) test/*.gch
$(RM) test/test_labcomm_errors
$(RM) test/testdata/gen/*.[cho]
$(RM) test/gen/*.[cho]
$(RM) -rf test/gen
for x in $(TESTS); do \
$(RM) $(TEST_DIR)/$$x ; \
done
.PHONY: distclean
distclean: clean
$(RM) ../liblabcomm$(LIBVERSION).so.1
$(RM) ../liblabcomm$(LIBVERSION).a
# rules invoked by 'all'
../liblabcomm$(LIBVERSION).so.1: $(OBJS:%.o=%.pic.o)
$(call MAKESHARED,$@,$@,$^)
../liblabcomm$(LIBVERSION).a: $(OBJS)
ar -r $@ $^
# compilation rules
%.pic.o: %.c
$(CC) -fPIC $(CFLAGS) -c -o $@ $<
%.o: %.c %.h
$(CC) $(CFLAGS) -c -o $@ $<
# rules invoked by 'test'
.PHONY: run-test-%
run-test-%: $(TEST_DIR)/gen/% | $(TEST_DIR)/gen
$<
$(TEST_DIR)/gen/%: $(TEST_DIR)/gen/%.o | $(TEST_DIR)/gen
$(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS)
$(TEST_DIR)/gen/%.o: $(TEST_DIR)/%.c | $(TEST_DIR)/gen
$(CC) $(CFLAGS_TEST) -o $@ -c $<
# Extra compilation dependencies
labcomm_fd_reader.o: \
labcomm_private.h
labcomm_fd_writer.o: \
labcomm_private.h
labcomm_dynamic_buffer_writer.o: \
labcomm_private.h
labcomm$(VERSION).o: \
labcomm$(VERSION).c \
labcomm$(VERSION).h \
labcomm$(VERSION)_private.h
labcomm$(VERSION)_fd_reader_writer.o: \
labcomm$(VERSION)_fd_reader_writer.c \
labcomm$(VERSION)_fd_reader_writer.h \
labcomm$(VERSION).h \
labcomm$(VERSION)_private.h
$(TEST_DIR)/gen/test_labcomm_basic_type_encoding.o: \
labcomm$(VERSION)_private.h
$(TEST_DIR)/gen/test_labcomm_generated_encoding.o: \
labcomm$(VERSION)_private.h \
$(TEST_DIR)/gen/generated_encoding.h
$(TEST_DIR)/gen/test_labcomm_generated_encoding: \
$(TEST_DIR)/gen/generated_encoding.o
$(TEST_DIR)/gen/test_signature_numbers.c: \
$(TEST_DIR)/gen/another_encoding.h \
$(TEST_DIR)/gen/generated_encoding.h
$(TEST_DIR)/gen/test_signature_numbers: \
$(TEST_DIR)/gen/another_encoding.o \
$(TEST_DIR)/gen/generated_encoding.o
$(TEST_DIR)/gen/test_labcomm: \
$(TEST_DIR)/gen/test_sample.o
$(TEST_DIR)/gen/test_labcomm_copy: \
$(TEST_DIR)/gen/generated_encoding.o \
$(TEST_DIR)/gen/test_sample.o \
$(TEST_DIR)/gen/more_types.o
#$(TEST_DIR)/labcomm_mem_reader.o: labcomm_fd_reader_writer.c labcomm_fd_reader_writer.h
#$(TEST_DIR)/labcomm_mem_writer.o: labcomm_mem_writer.c labcomm_mem_writer.h cppmacros.h
ethaddr.o: ethaddr.c
.PRECIOUS: $(TEST_DIR)/%
$(TEST_DIR)/gen:
mkdir -p $@
.PRECIOUS: $(TEST_DIR)/gen/%.c
.PRECIOUS: $(TEST_DIR)/gen/%.h
$(TEST_DIR)/gen/%.c $(TEST_DIR)/gen/%.h: $(TEST_DIR)/%.lc | $(TEST_DIR)/gen
$(LABCOMM) \
--c=$(TEST_DIR)/gen/$*.c \
--h=$(TEST_DIR)/gen/$*.h \
$<
$(TEST_GEN_DIR)/%.c $(TEST_GEN_DIR)/%.h: $(TESTDATA_DIR)/%.lc \
$(LABCOMM_JAR) | $(TEST_GEN_DIR)
$(LABCOMM) \
--c=$(patsubst %.h,%.c,$@) --h=$(patsubst %.c,%.h,$@) $<
$(LABCOMM_JAR):
@echo "======Building LabComm compiler======"
cd $(shell dirname $(LABCOMM_JAR)); ant jar
@echo "======End building LabComm compiler======"
...@@ -62,7 +62,7 @@ int labcomm2006_reader_free(struct labcomm2006_reader *r, ...@@ -62,7 +62,7 @@ int labcomm2006_reader_free(struct labcomm2006_reader *r,
int labcomm2006_reader_start(struct labcomm2006_reader *r, int labcomm2006_reader_start(struct labcomm2006_reader *r,
struct labcomm2006_reader_action_context *action_context, struct labcomm2006_reader_action_context *action_context,
int local_index, int remote_index, int local_index, int remote_index,
struct labcomm2006_signature *signature, const struct labcomm2006_signature *signature,
void *value) void *value)
{ {
UNWRAP(start, r, action_context, local_index, remote_index, signature, value); UNWRAP(start, r, action_context, local_index, remote_index, signature, value);
...@@ -83,7 +83,7 @@ int labcomm2006_reader_fill(struct labcomm2006_reader *r, ...@@ -83,7 +83,7 @@ int labcomm2006_reader_fill(struct labcomm2006_reader *r,
int labcomm2006_reader_ioctl(struct labcomm2006_reader *r, int labcomm2006_reader_ioctl(struct labcomm2006_reader *r,
struct labcomm2006_reader_action_context *action_context, struct labcomm2006_reader_action_context *action_context,
int local_index, int remote_index, int local_index, int remote_index,
struct labcomm2006_signature *signature, const struct labcomm2006_signature *signature,
uint32_t ioctl_action, va_list args) uint32_t ioctl_action, va_list args)
{ {
UNWRAP(ioctl, r, action_context, UNWRAP(ioctl, r, action_context,
...@@ -104,7 +104,7 @@ int labcomm2006_writer_free(struct labcomm2006_writer *w, ...@@ -104,7 +104,7 @@ int labcomm2006_writer_free(struct labcomm2006_writer *w,
int labcomm2006_writer_start(struct labcomm2006_writer *w, int labcomm2006_writer_start(struct labcomm2006_writer *w,
struct labcomm2006_writer_action_context *action_context, struct labcomm2006_writer_action_context *action_context,
int index, struct labcomm2006_signature *signature, int index, const struct labcomm2006_signature *signature,
void *value) void *value)
{ {
UNWRAP(start, w, action_context, index, signature, value); UNWRAP(start, w, action_context, index, signature, value);
...@@ -125,7 +125,7 @@ int labcomm2006_writer_flush(struct labcomm2006_writer *w, ...@@ -125,7 +125,7 @@ int labcomm2006_writer_flush(struct labcomm2006_writer *w,
int labcomm2006_writer_ioctl(struct labcomm2006_writer *w, int labcomm2006_writer_ioctl(struct labcomm2006_writer *w,
struct labcomm2006_writer_action_context *action_context, struct labcomm2006_writer_action_context *action_context,
int index, int index,
struct labcomm2006_signature *signature, const struct labcomm2006_signature *signature,
uint32_t ioctl_action, va_list args) uint32_t ioctl_action, va_list args)
{ {
UNWRAP(ioctl, w, action_context, index, signature, ioctl_action, args); UNWRAP(ioctl, w, action_context, index, signature, ioctl_action, args);
...@@ -156,10 +156,9 @@ const char *labcomm2006_error_get_str(enum labcomm2006_error error_id) ...@@ -156,10 +156,9 @@ const char *labcomm2006_error_get_str(enum labcomm2006_error error_id)
return error_str; return error_str;
} }
#if 0 //XXX hack to avoid name clash. is this really the same as in 2013?
void on_error_fprintf(enum labcomm2006_error error_id, size_t nbr_va_args, ...)
{
#ifndef LABCOMM_NO_STDIO #ifndef LABCOMM_NO_STDIO
void labcomm2006_on_error_fprintf(enum labcomm2006_error error_id, size_t nbr_va_args, ...)
{
const char *err_msg = labcomm2006_error_get_str(error_id); // The final string to print. const char *err_msg = labcomm2006_error_get_str(error_id); // The final string to print.
if (err_msg == NULL) { if (err_msg == NULL) {
err_msg = "Error with an unknown error ID occured."; err_msg = "Error with an unknown error ID occured.";
...@@ -177,10 +176,10 @@ void on_error_fprintf(enum labcomm2006_error error_id, size_t nbr_va_args, ...) ...@@ -177,10 +176,10 @@ void on_error_fprintf(enum labcomm2006_error error_id, size_t nbr_va_args, ...)
va_end(arg_pointer); va_end(arg_pointer);
} }
}
#else #else
; // If labcomm can't be compiled with stdio the user will have to make an own error callback functionif he/she needs error reporting. ; // If labcomm can't be compiled with stdio the user will have to make an own error callback functionif he/she needs error reporting.
#endif #error Define LABCOMM2006_ON_ERROR_FPRINTF
}
#endif #endif
...@@ -244,22 +243,22 @@ void labcomm2006_set_local_index(struct labcomm2006_signature *signature) ...@@ -244,22 +243,22 @@ void labcomm2006_set_local_index(struct labcomm2006_signature *signature)
{ {
if (signature->index != 0) { if (signature->index != 0) {
labcomm2006_error_fatal_global(LABCOMM_ERROR_SIGNATURE_ALREADY_SET, labcomm2006_error_fatal_global(LABCOMM_ERROR_SIGNATURE_ALREADY_SET,
"%s", signature->name); "Signature already set: %s", signature->name);
} }
signature->index = local_index; signature->index = local_index;
local_index++; local_index++;
} }
int labcomm2006_get_local_index(struct labcomm2006_signature *signature) int labcomm2006_get_local_index(const struct labcomm2006_signature *signature)
{ {
if (signature->index == 0) { if (signature->index == 0) {
labcomm2006_error_fatal_global(LABCOMM_ERROR_SIGNATURE_NOT_SET, labcomm2006_error_fatal_global(LABCOMM_ERROR_SIGNATURE_NOT_SET,
"%s", signature->name); "Signature not set: %s", signature->name);
} }
return signature->index; return signature->index;
} }
int labcomm2006_internal_sizeof(struct labcomm2006_signature *signature, int labcomm2006_internal_sizeof(const struct labcomm2006_signature *signature,
void *v) void *v)
{ {
int length = signature->encoded_size(v); int length = signature->encoded_size(v);
......
...@@ -23,8 +23,6 @@ ...@@ -23,8 +23,6 @@
#ifndef _LABCOMM_H_ #ifndef _LABCOMM_H_
#define _LABCOMM_H_ #define _LABCOMM_H_
#define LABCOMM_VERSION "LabComm2006"
#include <stdarg.h> #include <stdarg.h>
#ifdef LABCOMM_COMPAT #ifdef LABCOMM_COMPAT
...@@ -33,6 +31,7 @@ ...@@ -33,6 +31,7 @@
#include <stdint.h> #include <stdint.h>
#include <unistd.h> #include <unistd.h>
#endif #endif
#include "labcomm2006_error.h" #include "labcomm2006_error.h"
#include "labcomm2006_scheduler.h" #include "labcomm2006_scheduler.h"
...@@ -71,7 +70,7 @@ typedef void (*labcomm2006_error_handler_callback)(enum labcomm2006_error error_ ...@@ -71,7 +70,7 @@ typedef void (*labcomm2006_error_handler_callback)(enum labcomm2006_error error_
/* Default error handler, prints message to stderr. /* Default error handler, prints message to stderr.
* Extra info about the error can be supplied as char* as VA-args. Especially user defined errors should supply a describing string. if nbr_va_args > 1 the first variable argument must be a printf format string and the possibly following arguments are passed as va_args to vprintf. * Extra info about the error can be supplied as char* as VA-args. Especially user defined errors should supply a describing string. if nbr_va_args > 1 the first variable argument must be a printf format string and the possibly following arguments are passed as va_args to vprintf.
*/ */
void on_error_fprintf(enum labcomm2006_error error_id, size_t nbr_va_args, ...); void labcomm2006_on_error_fprintf(enum labcomm2006_error error_id, size_t nbr_va_args, ...);
/* Register a callback for the error handler for this encoder. */ /* Register a callback for the error handler for this encoder. */
void labcomm2006_register_error_handler_encoder(struct labcomm2006_encoder *encoder, labcomm2006_error_handler_callback callback); void labcomm2006_register_error_handler_encoder(struct labcomm2006_encoder *encoder, labcomm2006_error_handler_callback callback);
......
#ifndef _LABCOMM2006_COMPAT_VXWORKS_H_
#define _LABCOMM2006_COMPAT_VXWORKS_H_
#ifndef __VXWORKS__ #ifndef __VXWORKS__
#error "__VXWORKS__" not defined #error "__VXWORKS__" not defined
#endif #endif
#include <types/vxTypes.h>
#include <selectLib.h>
#include <types.h>
#include <timers.h>
#include <stdio.h>
#include <private/stdioP.h>
#ifdef __INT64_MAX__
#undef INT64_MAX
#define INT64_MAX __INT64_MAX__
#if (CPU == PPC603) #if (CPU == PPC603)
#undef _LITTLE_ENDIAN #undef _LITTLE_ENDIAN
#endif #endif
...@@ -10,3 +24,6 @@ ...@@ -10,3 +24,6 @@
#undef _BIG_ENDIAN #undef _BIG_ENDIAN
#endif #endif
extern unsigned int cpuFrequency;
#endif
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
struct sample_entry { struct sample_entry {
int remote_index; int remote_index;
struct labcomm2006_signature *signature; const struct labcomm2006_signature *signature;