Save file update (incomplete)
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
/**
|
||||
* Copyright (c) 2026 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "error/error.h"
|
||||
#include "save/savefile.h"
|
||||
|
||||
#define SAVE_LINUX_PATH_MAX FILENAME_MAX
|
||||
#define SAVE_LINUX_FILE_FORMAT "%s/save_%u.dat"
|
||||
|
||||
#ifndef SAVE_LINUX_PATH
|
||||
#define SAVE_LINUX_PATH "./saves"
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
char_t savePath[SAVE_LINUX_PATH_MAX];
|
||||
} savelinux_t;
|
||||
|
||||
/**
|
||||
* Initializes the save system on Linux.
|
||||
*
|
||||
* @return An error code if initialization fails.
|
||||
*/
|
||||
errorret_t saveInitLinux(void);
|
||||
|
||||
/**
|
||||
* Disposes of the save system on Linux.
|
||||
*
|
||||
* @return An error code if disposal fails.
|
||||
*/
|
||||
errorret_t saveDisposeLinux(void);
|
||||
|
||||
/**
|
||||
* Loads a save file from disk for the given slot.
|
||||
*
|
||||
* @param slot The save slot index.
|
||||
* @param file Output save file data.
|
||||
* @return An error code if the load fails.
|
||||
*/
|
||||
errorret_t saveLoadLinux(const uint8_t slot, savefile_t *file);
|
||||
|
||||
/**
|
||||
* Writes a save file to disk for the given slot.
|
||||
*
|
||||
* @param slot The save slot index.
|
||||
* @param file Save file data to write.
|
||||
* @return An error code if the write fails.
|
||||
*/
|
||||
errorret_t saveWriteLinux(const uint8_t slot, const savefile_t *file);
|
||||
|
||||
/**
|
||||
* Deletes the save file for the given slot from disk.
|
||||
*
|
||||
* @param slot The save slot index.
|
||||
* @return An error code if the delete fails.
|
||||
*/
|
||||
errorret_t saveDeleteLinux(const uint8_t slot);
|
||||
Reference in New Issue
Block a user