21 lines
440 B
C
21 lines
440 B
C
#include "../include/data.h"
|
|
#include <string.h>
|
|
|
|
int new_buffer(enum buffer_type type, char *filename, int x, int y, int width,
|
|
int height) {
|
|
// Create a new buffer
|
|
|
|
struct buffer_t *buffer = &E.buffers[E.number_of_buffer];
|
|
buffer->type = type;
|
|
|
|
if (type == FILE_BUFF) {
|
|
strcpy(buffer->filename, filename);
|
|
}
|
|
buffer->width = width, buffer->height = height;
|
|
buffer->x = x, buffer->y = y;
|
|
|
|
|
|
|
|
return 1;
|
|
}
|