Datablocks are one of the highlights of the upcoming version 5. This is a first patch which intends to extend their usefulness even further by using them as in-memory-data. This can help to avoid temporary files.
This patch implements set print $datablock [append]
, i.e. print
output is not written to a file but to a in-memory datablock. The update to fitmulti.dem included in the patch demonstrates a possible use.
I intend to apply this idea to implement set table $datablock
and fit parameter files. save/load commands for datablocks will complete this functionality.
These commands could also help to implement the idea of [patches:#427].
Maybe also useful to replace the current test_palette()?
Patch now in CVS. I'll look into 'test palette' later.
I look forward to the "set table $FOO" extension. That strikes me as being the more important part.
By the way - I originally implemented a routine to dump a datablock to a file but then I realized it is not necessary. "set print 'foo.dat'; print $FOO" already does this. I'm not certain whether a separate load command is needed. It may be that this will be handled by "set table $FOO; plot 'foo.dat' with table". That was not the original idea behind the "plot with table" patch but it might work for this.
This patch implements
set table $datablock
. Comments appreciated.from a log of valgrind run on vector.dem
==2715== Conditional jump or move depends on uninitialised value(s)
==2715== at 0xD9847AA: vfprintf (in /usr/lib64/libc-2.18.so)
==2715== by 0xD9ACAC8: vsnprintf (in /usr/lib64/libc-2.18.so)
==2715== by 0xD98A991: snprintf (in /usr/lib64/libc-2.18.so)
==2715== by 0x4C1AC6: print_3dtable (tabulate.c:458)
==2715== by 0x495AC1: plot3drequest (plot3d.c:2203)
==2715== by 0x4389E4: replotrequest (command.c:2347)
==2715== by 0x439A24: do_line (command.c:615)
==2715== by 0x4765F8: load_file (misc.c:376)
==2715== by 0x4288D2: main (plot.c:653)
==2715==
==2715== 19 bytes in 2 blocks are definitely lost in loss record 72 of 291
==2715== at 0x4C266ED: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==2715== by 0xD9BDCB9: strdup (in /usr/lib64/libc-2.18.so)
==2715== by 0x4ACC2B: set_command (set.c:4572)
==2715== by 0x439A24: do_line (command.c:615)
==2715== by 0x4765F8: load_file (misc.c:376)
==2715== by 0x4288D2: main (plot.c:653)
==2715==