diff options
author | cflip <cflip@cflip.net> | 2023-01-08 14:57:40 -0700 |
---|---|---|
committer | cflip <cflip@cflip.net> | 2023-01-08 14:57:40 -0700 |
commit | 095ef2947d858df7ccc9baa4806fe7366fca26bc (patch) | |
tree | 8682d0df1d02f755ca45584d619bc5f2ecb1998d | |
parent | 91195d34e1f71246cadc41705004d66ab647087e (diff) |
Use C-style include guards instead of #pragma once
-rw-r--r-- | buffer.h | 5 | ||||
-rw-r--r-- | editor.h | 5 | ||||
-rw-r--r-- | file.h | 5 | ||||
-rw-r--r-- | input.h | 5 | ||||
-rw-r--r-- | row.h | 5 | ||||
-rw-r--r-- | syntax.h | 5 | ||||
-rw-r--r-- | terminal.h | 5 |
7 files changed, 28 insertions, 7 deletions
@@ -1,4 +1,5 @@ -#pragma once +#ifndef _BUFFER_H +#define _BUFFER_H struct append_buffer { char* buffer; @@ -9,3 +10,5 @@ struct append_buffer { void ab_append(struct append_buffer* ab, const char* string, int length); void ab_free(struct append_buffer* ab); + +#endif @@ -1,4 +1,5 @@ -#pragma once +#ifndef _EDITOR_H +#define _EDITOR_H #include <time.h> #include "buffer.h" @@ -33,3 +34,5 @@ void editor_scroll(struct editor_state* editor); void editor_draw_rows(struct editor_state* editor, struct append_buffer* buffer); void editor_draw_status_bar(struct editor_state* editor, struct append_buffer* buffer); void editor_draw_message_bar(struct editor_state* editor, struct append_buffer* buffer); + +#endif @@ -1,6 +1,9 @@ -#pragma once +#ifndef _FILE_H +#define _FILE_H #include "editor.h" void editor_open(struct editor_state* editor, char* filename); void editor_save(struct editor_state* editor); + +#endif @@ -1,4 +1,5 @@ -#pragma once +#ifndef _INPUT_H +#define _INPUT_H #include "editor.h" @@ -20,3 +21,5 @@ enum editor_key { int editor_read_key(); void editor_move_cursor(struct editor_state* editor, int key); void editor_process_keypress(struct editor_state* editor); + +#endif @@ -1,4 +1,5 @@ -#pragma once +#ifndef _ROW_H +#define _ROW_H #include <ctype.h> @@ -25,3 +26,5 @@ void delete_row(struct editor_state* editor, int at); void row_insert_char(struct editor_state* editor, struct editor_row* row, int at, int c); void row_append_string(struct editor_state* editor, struct editor_row* row, char* string, size_t length); void row_delete_char(struct editor_state* editor, struct editor_row* row, int at); + +#endif @@ -1,4 +1,5 @@ -#pragma once +#ifndef _SYNTAX_H +#define _SYNTAX_H #include <stdlib.h> @@ -34,3 +35,5 @@ enum editor_highlight { void editor_update_syntax(struct editor_state* editor, struct editor_row* row); int editor_syntax_to_colour(int highlight); void editor_select_syntax_highlight(struct editor_state* editor); + +#endif @@ -1,7 +1,10 @@ -#pragma once +#ifndef _TERMINAL_H +#define _TERMINAL_H void die(const char* message); void disable_raw_mode(); void enable_raw_mode(); int get_cursor_position(int* rows, int* cols); int get_window_size(int* rows, int* cols); + +#endif |