aboutsummaryrefslogtreecommitdiff
path: root/fsutils.c
diff options
context:
space:
mode:
authorMistivia <i@mistivia.com>2025-09-13 16:44:13 +0800
committerMistivia <i@mistivia.com>2025-09-13 16:44:13 +0800
commitf3eeea1d7092f3ca98836035bf75b941d14c2067 (patch)
tree694dcda14f42c48959340e086ae94b021f9d18f8 /fsutils.c
parent7540ded75ee07b026950486172aca08cd0686a4e (diff)
write m3u8
Diffstat (limited to 'fsutils.c')
-rw-r--r--fsutils.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/fsutils.c b/fsutils.c
new file mode 100644
index 0000000..0c38eaf
--- /dev/null
+++ b/fsutils.c
@@ -0,0 +1,47 @@
+#include "fsutils.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+void tmp_local_filename(const char *prefix, char *buf) {
+ static const char hex[] = "0123456789abcdef";
+ int prefix_len = strlen(prefix);
+ memcpy(buf, prefix, prefix_len);
+ buf = buf + prefix_len;
+ size_t i;
+ for (i = 0; i < 4; i++) {
+ unsigned char r = rand() & 0xFF;
+ buf[i * 2] = hex[r >> 4];
+ buf[i * 2 + 1] = hex[r & 0xF];
+ }
+ buf[i*2] = '\0';
+}
+
+void tmp_ts_prefix(char *buf) {
+ static const char hex[] = "0123456789abcdef";
+ size_t i;
+ for (i = 0; i < 4; i++) {
+ unsigned char r = rand() & 0xFF;
+ buf[i * 2] = hex[r >> 4];
+ buf[i * 2 + 1] = hex[r & 0xF];
+ }
+ buf[i*2] = '\0';
+}
+
+void ts_filename(const char *prefix, int num, char *buf) {
+ snprintf(buf, 256, "s%s%04d.ts", prefix, num);
+}
+
+void upload_file(const char *local, const char *remote) {
+ // TODO
+}
+
+void remove_remote(const char *remote) {
+ // TODO
+}
+
+char ** list_file() {
+ // TODO
+ return NULL;
+} \ No newline at end of file