summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHunter Kvalevog <hunter@kvog.sh>2026-10-02 21:48:10 -0500
committerHunter Kvalevog <hunter@kvog.sh>2026-10-02 21:48:10 -0500
commit02d8f1c62896576e1266553a56980eddbc2a88d7 (patch)
treed73ad4bfa3ad91bd4789febabbd58d5ae9e6f17f
parent43ec6d4963a2b40c2bcde33505c7cfc7855e507d (diff)
riffprobe: remove riffprobe
-rw-r--r--README1
-rwxr-xr-xriffprobe/build.sh4
-rw-r--r--riffprobe/riffprobe.c91
3 files changed, 0 insertions, 96 deletions
diff --git a/README b/README
index acec7e3..b4115a7 100644
--- a/README
+++ b/README
@@ -11,7 +11,6 @@ ffmpeg-shadertoy Basic offline Shadertoy renderer
gl-asylum Procedurally generated 3D OpenGL scene
huffman Huffman encoding demo
qoidec Quite OK Image Format decoder
-riffprobe Basic RIFF/WAVE file traversal
rust-asm Rust -> assembly interop demo
rustlings rustlings
vk-cube Spinning cube Vulkan demo
diff --git a/riffprobe/build.sh b/riffprobe/build.sh
deleted file mode 100755
index 51b6656..0000000
--- a/riffprobe/build.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-set -euo pipefail
-mkdir -p bin
-cc -o bin/riffprobe -Wall -Wextra -Wpedantic -O0 -g ./riffprobe.c
diff --git a/riffprobe/riffprobe.c b/riffprobe/riffprobe.c
deleted file mode 100644
index 29918df..0000000
--- a/riffprobe/riffprobe.c
+++ /dev/null
@@ -1,91 +0,0 @@
-// ================================================================================================
-// Basic RIFF/WAVE file traversal. Does not do any real parsing.
-//
-// ref: https://mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/riffmci.pdf
-//
-// Changelog:
-// 9/20/2026: Initial release
-// 9/22/2026: Can now accept multiple files
-//
-// License:
-// SPDX-License-Identifier: 0BSD
-// Copyright (c) 2026 Hunter Kvalevog
-//
-// Permission to use, copy, modify, and/or distribute this software for any
-// purpose with or without fee is hereby granted.
-//
-// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-// WITH REGARD TO THIS SOFTWARE.
-// ================================================================================================
-
-#include <ctype.h>
-#include <errno.h>
-#include <stdarg.h>
-#include <stdbool.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#ifdef __GNUC__
-# define ATTR_NORETURN __attribute__((noreturn))
-# define ATTR_PRINTF(A1, A2) __attribute__((format(printf, A1, A2)))
-#else
-# define ATTR_NORETURN
-# define ATTR_PRINTF(A1, A2)
-#endif
-
-ATTR_NORETURN
-ATTR_PRINTF(1, 2)
-static void die(const char *fmt, ...)
-{
- va_list va; va_start(va, fmt);
- vprintf(fmt, va);
- va_end(va);
-
- exit(1);
-}
-
-static const char *unfourcc(uint32_t id)
-{
- static char b[5] = { 0 };
- b[0] = (id) & 0xFF;
- b[1] = (id >> 8) & 0xFF;
- b[2] = (id >> 16) & 0xFF;
- b[3] = (id >> 24) & 0xFF;
- return b;
-}
-
-int main(int argc, const char **argv)
-{
- if (argc < 2)
- die("no file");
-
- for (int i = 1; i < argc; ++i)
- {
- printf("%s:\n", argv[i]);
-
- FILE* fp = fopen(argv[i], "rb");
- if (!fp)
- die("failed to open file: %s", strerror(errno));
-
- uint8_t buf[256];
-
- if (fread(buf, 1, 12, fp) != 12)
- return 1;
-
- if (memcmp(buf, "RIFF", 4) || memcmp(buf + 8, "WAVE", 4))
- die("Invalid file");
-
- while (!feof(fp))
- {
- if (fread(buf, 1, 8, fp) != 8)
- break;
- uint32_t tag = *(uint32_t *)buf;
- uint32_t size = *(uint32_t *)(buf + 4);
- printf(" %s\n", unfourcc(tag));
- fseek(fp, size, SEEK_CUR);
- }
- }
-
- return 0;
-}