Adding splitting screen and buffer switching
This commit is contained in:
+51
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user