snapkitty
compilers
c
python
nasm
File size: 714 Bytes
9abace2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#ifndef SOVEREIGN_DOCUMENT_H
#define SOVEREIGN_DOCUMENT_H

#include <windows.h>
#include "buffer.h"
#include "../core/errors.h"
#include <stdbool.h>
#include <stddef.h>

typedef enum LineEnding { LE_LF, LE_CRLF, LE_CR } LineEnding;

typedef struct Document {
    Buffer     *buffer;
    wchar_t     path[MAX_PATH];
    LineEnding  line_ending;
    bool        has_path;
} Document;

SovResult document_open(Document *doc, const wchar_t *path);
SovResult document_save(Document *doc);
SovResult document_save_as(Document *doc, const wchar_t *path);
void      document_new(Document *doc);
void      document_destroy(Document *doc);
bool      document_is_dirty(const Document *doc);

#endif