From 66d7627ed84a2a1ae9a269b7382f5a2bcecff191 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sun, 22 Oct 2023 21:16:39 -0500 Subject: [PATCH] [ox/claw] Add missing file --- deps/ox/src/ox/claw/readclaw.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 deps/ox/src/ox/claw/readclaw.cpp diff --git a/deps/ox/src/ox/claw/readclaw.cpp b/deps/ox/src/ox/claw/readclaw.cpp new file mode 100644 index 00000000..93f7a76e --- /dev/null +++ b/deps/ox/src/ox/claw/readclaw.cpp @@ -0,0 +1,30 @@ +/* + * Copyright 2015 - 2023 gary@drinkingtea.net + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include + +#include +#include + +#include "claw.hpp" + + +int main(int argc, char **args) { + if (argc > 2) { + oxErr("Too many arguments"); + return -1; + } + auto const file = argc == 1 ? stdin : fopen(args[1], "r"); + if (fseek(file, 0, SEEK_END)) { + oxErr("Could not get file size\n"); + return -2; + } + auto const size = static_cast(ftell(file)); + oxDebugf("{}", size); + return 0; +}