OpenFPGA/libs/libopenfpgacapnproto/serdes_utils.h

22 lines
552 B
C
Raw Normal View History

2024-09-25 05:42:04 -05:00
#ifndef SERDES_UTILS_H_
#define SERDES_UTILS_H_
#include <limits>
#include <string>
2024-09-27 05:41:30 -05:00
2024-09-25 05:42:04 -05:00
#include "capnp/serialize.h"
// Platform indepedent way to file message to a file on disk.
void writeMessageToFile(const std::string& file,
2024-09-27 05:41:30 -05:00
::capnp::MessageBuilder* builder);
2024-09-25 05:42:04 -05:00
inline ::capnp::ReaderOptions default_large_capnp_opts() {
2024-09-27 05:41:30 -05:00
::capnp::ReaderOptions opts = ::capnp::ReaderOptions();
2024-09-25 05:42:04 -05:00
2024-09-27 05:41:30 -05:00
/* Remove traversal limit */
opts.traversalLimitInWords = std::numeric_limits<uint64_t>::max();
return opts;
2024-09-25 05:42:04 -05:00
}
#endif /* SERDES_UTILS_H_ */