Login
1 branch 0 tags
Ben (T14/NixOS) GNU unifont experiments 27b6a39 1 month ago 53 Commits
moon / src / bookmark.h
#pragma once
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>

// Load bookmark position for a file path
// Returns position in milliseconds, or 0 if no bookmark exists
uint32_t bookmark_load(const char *path);

// Save bookmark position for a file path
// Writes to .onigiri/state.toml on the SD card
bool bookmark_save(const char *path, uint32_t position_ms);

// Remove bookmark for a file path (e.g., when playback completes)
bool bookmark_remove(const char *path);

// Load a string bookmark (e.g., directory bookmark stores a filename)
// Returns true if found, copying value into out_buf
bool bookmark_load_string(const char *path, char *out_buf, size_t out_buf_size);

// Save a string bookmark (e.g., directory bookmark with filename value)
bool bookmark_save_string(const char *path, const char *value);

// Clear all bookmarks by removing the bookmark file
bool bookmark_clear_all(void);