Commit 38892389 authored by Sven Robertz's avatar Sven Robertz
Browse files

changed prototype of labcomm_sizeof_sample to include signature_t

parent 7c208306
......@@ -807,7 +807,7 @@ aspect C_Signature {
env.prefix + getName() + " = {");
env.indent();
env.println("LABCOMM_SAMPLE, \"" + getName() + "\",");
env.println("(int (*)(void *))labcomm_sizeof_" +
env.println("(int (*)(labcomm_signature_t *, void *))labcomm_sizeof_" +
env.prefix + getName() + ",");
env.println("sizeof(signature_bytes_" + getName() + "),");
env.println("signature_bytes_"+ getName());
......@@ -905,7 +905,7 @@ aspect C_Sizeof {
public void SampleDecl.C_emitSizeofDeclaration(C_env env) {
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() {
......@@ -966,7 +966,7 @@ aspect C_Sizeof {
public void SampleDecl.C_emitSizeof(C_env env) {
env = env.nestStruct("(*v)");
env.println("int labcomm_sizeof_" + env.prefix + getName() +
"(" + env.prefix + getName() + " *v)");
"(labcomm_signature_t *sig, " + env.prefix + getName() + " *v)");
env.println("{");
env.indent();
if (C_isDynamic()) {
......
......@@ -23,17 +23,14 @@ struct labcomm_decoder;
/*
* Signature entry
*/
typedef struct {
typedef struct labcomm_signature{
int type;
char *name;
int (*encoded_size)(void *);
int (*encoded_size)(struct labcomm_signature *, void *); // void * == encoded_sample *
int size;
unsigned char *signature;
} labcomm_signature_t;
//TODO: something along the lines of...
void labcomm_encode_signature(struct labcomm_encoder*, labcomm_signature_t*);
/*
* Error handling.
*/
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment