Skip to content
Snippets Groups Projects
Commit 38892389 authored by Sven Robertz's avatar Sven Robertz
Browse files

changed prototype of labcomm_sizeof_sample to include signature_t

parent 7c208306
Branches
No related tags found
No related merge requests found
...@@ -807,7 +807,7 @@ aspect C_Signature { ...@@ -807,7 +807,7 @@ aspect C_Signature {
env.prefix + getName() + " = {"); env.prefix + getName() + " = {");
env.indent(); env.indent();
env.println("LABCOMM_SAMPLE, \"" + getName() + "\","); env.println("LABCOMM_SAMPLE, \"" + getName() + "\",");
env.println("(int (*)(void *))labcomm_sizeof_" + env.println("(int (*)(labcomm_signature_t *, void *))labcomm_sizeof_" +
env.prefix + getName() + ","); env.prefix + getName() + ",");
env.println("sizeof(signature_bytes_" + getName() + "),"); env.println("sizeof(signature_bytes_" + getName() + "),");
env.println("signature_bytes_"+ getName()); env.println("signature_bytes_"+ getName());
...@@ -905,7 +905,7 @@ aspect C_Sizeof { ...@@ -905,7 +905,7 @@ aspect C_Sizeof {
public void SampleDecl.C_emitSizeofDeclaration(C_env env) { public void SampleDecl.C_emitSizeofDeclaration(C_env env) {
env.println("extern int labcomm_sizeof_" + env.prefix + getName() + env.println("extern int labcomm_sizeof_" + env.prefix + getName() +
"(" + env.prefix + getName() + " *v);"); "(labcomm_signature_t *sig, " + env.prefix + getName() + " *v);");
} }
public int Decl.C_fixedSizeof() { public int Decl.C_fixedSizeof() {
...@@ -966,7 +966,7 @@ aspect C_Sizeof { ...@@ -966,7 +966,7 @@ aspect C_Sizeof {
public void SampleDecl.C_emitSizeof(C_env env) { public void SampleDecl.C_emitSizeof(C_env env) {
env = env.nestStruct("(*v)"); env = env.nestStruct("(*v)");
env.println("int labcomm_sizeof_" + env.prefix + getName() + env.println("int labcomm_sizeof_" + env.prefix + getName() +
"(" + env.prefix + getName() + " *v)"); "(labcomm_signature_t *sig, " + env.prefix + getName() + " *v)");
env.println("{"); env.println("{");
env.indent(); env.indent();
if (C_isDynamic()) { if (C_isDynamic()) {
......
...@@ -23,17 +23,14 @@ struct labcomm_decoder; ...@@ -23,17 +23,14 @@ struct labcomm_decoder;
/* /*
* Signature entry * Signature entry
*/ */
typedef struct { typedef struct labcomm_signature{
int type; int type;
char *name; char *name;
int (*encoded_size)(void *); int (*encoded_size)(struct labcomm_signature *, void *); // void * == encoded_sample *
int size; int size;
unsigned char *signature; unsigned char *signature;
} labcomm_signature_t; } labcomm_signature_t;
//TODO: something along the lines of...
void labcomm_encode_signature(struct labcomm_encoder*, labcomm_signature_t*);
/* /*
* Error handling. * Error handling.
*/ */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment