Commit f0e558a4 authored by Zhukov, Alexander P's avatar Zhukov, Alexander P
Browse files

Added return status

parent 251b78c2
......@@ -7,7 +7,7 @@ There are two examples: **test_MPS** and **test_DBL**.
It replicates structure from [SoftIOC > Errant > MPS > DTL_LLRF_HPM6_fault > 20200214_135209](https://ics-srv-web2.sns.ornl.gov/Diagnostics/index.php?dir=Instruments%2FSoftIOC%2FErrant%2FMPS%2FDTL_LLRF_HPM6_fault%2F20200214_135209%2F)
1. #### DBL
This creates a ~10Mb file that stores waveforms.
This creates a relatively large file that stores waveforms.
## Compilation
To compile **test_XXX** executable run following from **c-code** directory
......
......@@ -39,7 +39,7 @@ void close_record(BinaryStorage *bs){
free(bs->contents);
bs->contents = temp;
bs->buf_size = newsz;
printf("Buffer size was doubled, new size is %d\n",newsz);
// printf("Buffer size was doubled, new size is %zu\n",newsz);
}
bs->contents[bs->con_idx]=ftell(bs->file);
......@@ -94,10 +94,12 @@ int write_meta(BinaryStorage *bs, char* name, TSTMP timestamp, TAGS *tags, char*
fwrite(&raw_len,4,1,bs->file);
fwrite(description, 1,length,bs->file);
}
return 0;
}
int bsWriteTagsOnly(BinaryStorage *bs, char* name, TSTMP timestamp, TAGS *tags, char* description){
write_meta(bs, name, timestamp, tags, description, 0);
close_record(bs);
return 0;
}
int bsWriteDBL(BinaryStorage *bs, char* name, TSTMP timestamp, DBL value, TAGS *tags, char* description){
uint32_t count = value.count;
......@@ -121,6 +123,7 @@ int bsWriteDBL(BinaryStorage *bs, char* name, TSTMP timestamp, DBL value, TAGS *
}
close_record(bs);
return 0;
}
......
Markdown is supported
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