Streamtools: Refactor rescaling code
[jpcrr.git] / streamtools / mknulldump.cpp
blob98303ea4c350b5c65ac99736e48b02f89123b4a5
1 #include "newpacket.hpp"
2 #include <iostream>
3 #include <sstream>
4 #include <cstdio>
5 #include <cstring>
6 #include <stdexcept>
7 #include <algorithm>
8 #include "timeparse.hpp"
10 int real_main(int argc, char** argv)
12 if(argc != 3) {
13 std::cerr << "syntax: mknulldmp.exe <length> <output>" << std::endl;
14 exit(1);
17 uint64_t length = parse_timespec(argv[1]);
18 write_channel wchan(argv[2]);
20 std::vector<struct channel> channels;
21 channels.resize(1);
22 channels[0].c_channel = 0;
23 channels[0].c_type = 3;
24 channels[0].c_channel_name = "<DUMMY>";
25 wchan.start_segment(channels);
27 struct packet p2;
28 p2.rp_channel = 0;
29 p2.rp_timestamp = length;
30 p2.rp_minor = 0;
31 wchan.write(p2);
32 return 0;