Adding splitting screen and buffer switching

This commit is contained in:
Arthur Barraux
2026-01-24 19:29:46 +01:00
parent b039cf3ded
commit 5a7b073041
22 changed files with 1171 additions and 384 deletions
+51 -1
View File
@@ -1,8 +1,58 @@
/**
* @file buffer.h
* @brief Buffer management for handling multiple open files
*/
#ifndef BUFFER_H_
#define BUFFER_H_
#include "data.h"
int new_buffer(enum buffer_type type, char * filename, int width, int height);
/**
* @brief Creates a new buffer for a file
* @param filename Path to the file
* @return Buffer ID on success, -1 on failure
*/
int bufferCreate(const char *filename);
/**
* @brief Switches to a specific buffer by ID
* @param buffer_id The buffer ID to switch to
* @return 0 on success, -1 on failure
*/
int bufferSwitch(int buffer_id);
struct buffer_t *bufferFindById(int buffer_id);
/**
* @brief Closes a buffer by ID
* @param buffer_id The buffer ID to close
* @return 0 on success, -1 on failure
*/
int bufferClose(int buffer_id);
/**
* @brief Gets the current active buffer
* @return Pointer to current buffer_t, NULL if none
*/
struct buffer_t *bufferGetCurrent(void);
/**
* @brief Lists all open buffers
* @return Number of open buffers
*/
int bufferListAll(void);
/**
* @brief Saves current buffer to disk
* @return 0 on success, -1 on failure
*/
int bufferSave(void);
/**
* @brief Saves all buffers to disk
* @return 0 on success, -1 on failure
*/
int bufferSaveAll(void);
#endif