diff --git a/img/src/BlobSetReframer.cxx b/img/src/BlobSetReframer.cxx index 4269de6ca..d8e848d33 100644 --- a/img/src/BlobSetReframer.cxx +++ b/img/src/BlobSetReframer.cxx @@ -120,7 +120,7 @@ struct FromActivity { activity[ich->ident()] = act; } - double qtot=0; + // double qtot=0; // check each layer of the blob for (const auto& strip : blob.strips()) { @@ -145,7 +145,7 @@ struct FromActivity { auto strace = std::make_shared(chid, tbin, charge); traces.push_back(strace); - qtot += act_charge; + // qtot += act_charge; } } return traces; diff --git a/util/inc/WireCellUtil/Persist.h b/util/inc/WireCellUtil/Persist.h index ed127b9fd..7b88ed878 100644 --- a/util/inc/WireCellUtil/Persist.h +++ b/util/inc/WireCellUtil/Persist.h @@ -19,16 +19,22 @@ #define WIRECELL_PERSIST #include -//#include "libjsonnet++.h" -// -// Note, you can build WCT against the C-bindings to the Go jsonnet -// library which will provide substantial speed up ver the native C -// implementation. To do this, configure code like: + +// WCT can use the C bindings to either the Go or C++ Jsonnet library. +// The Go version is much better optimized and strongly recomended +// over the C++ version though the C++ is default so as to not require +// a dependency on the Go ecosystem. You may tell the WCT build +// system to use the Go version with a command like: // -// ./wcb configure --with-jsonnet-libs=gojsonnet [...as usual...] +// ./wcb configure --with-jsonnet-libs=gojsonnet [...etc...] // +// The C bindings to both C++ and Go provide the same C API. Only the +// shared library is required (not headers). The portion of the C API +// used is declared in Persist.cxx and is not exposed to external code +// compiling against WCT. +// extern "C" { -#include "libjsonnet.h" + struct JsonnetVm; } #include #include diff --git a/util/inc/WireCellUtil/custard/custard.hpp b/util/inc/WireCellUtil/custard/custard.hpp index 9cc60dbea..ef8b58109 100644 --- a/util/inc/WireCellUtil/custard/custard.hpp +++ b/util/inc/WireCellUtil/custard/custard.hpp @@ -95,8 +95,7 @@ namespace custard { return sum; } - class Header - { /* byte offset */ + struct TarHeader { char name_[100]; /* 0 */ char mode_[8]; /* 100 */ char uid_[8]; /* 108 */ @@ -114,6 +113,10 @@ namespace custard { char devminor_[8]; /* 337 */ char prefix_[155]; /* 345 */ char padding_[12]; /* 500 */ + }; + + class Header : private TarHeader + { /* byte offset */ /* 512 */ public: Header(std::string filename="", size_t siz=0) diff --git a/util/src/Persist.cxx b/util/src/Persist.cxx index eebb3fb66..633538993 100644 --- a/util/src/Persist.cxx +++ b/util/src/Persist.cxx @@ -15,6 +15,22 @@ #include #include +// see #239 for why this is here. +extern "C" { + struct JsonnetVm; + struct JsonnetVm* jsonnet_make(); + char *jsonnet_realloc(struct JsonnetVm *vm, char *buf, size_t sz); + void jsonnet_destroy(struct JsonnetVm* vmRef); + void jsonnet_jpath_add(struct JsonnetVm* vmRef, char* path); + void jsonnet_ext_var(struct JsonnetVm* vmRef, char* key, char* value); + void jsonnet_ext_code(struct JsonnetVm* vmRef, char* key, char* value); + void jsonnet_tla_var(struct JsonnetVm* vmRef, char* key, char* value); + void jsonnet_tla_code(struct JsonnetVm* vmRef, char* key, char* value); + char* jsonnet_evaluate_file(struct JsonnetVm* vmRef, char* filename, int* e); + char* jsonnet_evaluate_snippet(struct JsonnetVm* vmRef, char* filename, char* code, int* e); +} + + using spdlog::debug; using spdlog::error; using spdlog::info;