Skip to content
Snippets Groups Projects
Commit 9bfa7c14 authored by Sven Gestegård Robertz's avatar Sven Gestegård Robertz
Browse files

c encoding, java skipping pragma

parent 86728095
No related branches found
No related tags found
No related merge requests found
......@@ -23,15 +23,15 @@ int main(int argc, char *argv[]) {
labcomm_default_scheduler);
labcomm_encoder_register_test_twoLines(encoder);
#ifdef OLD_METADATA
struct labcomm_encoder *mdt = labcomm_metadata_begin(encoder,
&labcomm_signature_test_twoLines);
labcomm_encoder_register_test_Comment(mdt);
#ifndef WITHOUT_PRAGMA
struct labcomm_encoder *pb = labcomm_pragma_builder_new(encoder,
"se.lth.cs.sven.pragma");
labcomm_encoder_register_test_Comment(pb);
test_Comment comment;
comment.id = 17;
comment.comment = "This is a metadata comment...";
labcomm_encode_test_Comment(mdt, &comment);
labcomm_metadata_end(mdt);
labcomm_encode_test_Comment(pb, &comment);
labcomm_pragma_send(pb);
#endif
test_twoLines tl;
......
......@@ -126,6 +126,10 @@ int labcomm_decoder_ioctl(struct labcomm_decoder *decoder,
...);
/* pragma */
struct labcomm_encoder *labcomm_pragma_builder_new(
struct labcomm_encoder *e,
char * pragma_type) ;
int labcomm_pragma_send(struct labcomm_encoder* e);
struct labcomm_pragma_handler {
//struct labcomm_decoder_registry *registry;
//TODO: implement map (char * pragma_type) --> decoder_registry *
......
......@@ -97,7 +97,8 @@ struct pragma_packet_builder {
struct labcomm_encoder *labcomm_pragma_builder_new(
struct labcomm_encoder *e,
char * pragma_type) {
char * pragma_type)
{
struct labcomm_writer *dyn_writer = labcomm_dynamic_buffer_writer_new(
e->memory);
struct labcomm_encoder *pb = labcomm_encoder_new(dyn_writer,
......
......@@ -37,6 +37,12 @@ public class DecoderChannel implements Decoder {
ReadBytes(signature, signature_length);
registry.add(index, name, signature);
} break;
case Constant.PRAGMA: {
System.out.println("Pragma: skipping "+length+" bytes");
for(int i=0; i<length; i++) {
decodeByte();
}
} break;
default: {
DecoderRegistry.Entry e = registry.get(tag);
if (e == null) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment