diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2022-11-07 22:54:59 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2022-11-07 22:54:59 -0500 |
| commit | 3ed2c195940de9fd2aa320147d1beaa8a0c98654 (patch) | |
| tree | 9b87c3945fdfa986c6be77c77a8740f7d773ff0f | |
| parent | 372eb2647f04c8789679a7fd80a0e91a65e47941 (diff) | |
Use `#pragma once`
| -rw-r--r-- | files.h | 4 | ||||
| -rw-r--r-- | json.h | 4 | ||||
| -rw-r--r-- | match.h | 4 | ||||
| -rw-r--r-- | pattern.h | 4 | ||||
| -rw-r--r-- | printmatch.h | 4 | ||||
| -rw-r--r-- | utf8.h | 4 | ||||
| -rw-r--r-- | utils.h | 4 |
7 files changed, 7 insertions, 21 deletions
@@ -1,8 +1,7 @@ // // files.h - Definitions of an API for loading files. // -#ifndef FILES__H -#define FILES__H +#pragma once #include <stdio.h> #include <unistd.h> @@ -32,5 +31,4 @@ size_t get_line_column(file_t *f, const char *p); __attribute__((pure, nonnull)) const char *get_line(file_t *f, size_t line_number); -#endif // vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0 @@ -1,8 +1,7 @@ // // json.h - Header file for JSON output. // -#ifndef JSON__H -#define JSON__H +#pragma once #include <stdbool.h> @@ -11,5 +10,4 @@ __attribute__((nonnull)) void json_match(const char *text, match_t *m, bool verbose); -#endif // vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0 @@ -1,8 +1,7 @@ // // match.h - Header file for BP virtual machine. // -#ifndef MATCH__H -#define MATCH__H +#pragma once #include <stdbool.h> #include <stdio.h> @@ -39,5 +38,4 @@ match_t *get_numbered_capture(match_t *m, int n); __attribute__((nonnull, pure)) match_t *get_named_capture(match_t *m, const char *name, ssize_t namelen); -#endif // vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0 @@ -1,8 +1,7 @@ // // pattern.h - Header file for BP pattern compilation. // -#ifndef PATTERN__H -#define PATTERN__H +#pragma once #include <stdbool.h> #include <stdint.h> @@ -127,5 +126,4 @@ void free_all_pats(void); __attribute__((nonnull)) void delete_pat(pat_t **at_pat, bool recursive); -#endif // vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0 diff --git a/printmatch.h b/printmatch.h index f6a894d..2c4b3ce 100644 --- a/printmatch.h +++ b/printmatch.h @@ -1,8 +1,7 @@ // // Debug visualization of matches // -#ifndef EXPLAIN__H -#define EXPLAIN__H +#pragma once #include "match.h" @@ -18,5 +17,4 @@ void fprint_match(FILE *out, const char *file_start, match_t *m, print_options_t __attribute__((nonnull)) void explain_match(match_t *m); -#endif // vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0 @@ -1,8 +1,7 @@ // // utf8.h - UTF8 helper functions // -#ifndef UTF8__H -#define UTF8__H +#pragma once #include <stdbool.h> @@ -17,5 +16,4 @@ bool isidstart(const char *str, const char *end); __attribute__((nonnull, pure)) bool isidcontinue(const char *str, const char *end); -#endif // vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0 @@ -1,8 +1,7 @@ // // utils.h - Some utility and printing functions. // -#ifndef UTILS__H -#define UTILS__H +#pragma once #include <err.h> #include <stdarg.h> @@ -58,5 +57,4 @@ bool matchstr(const char **str, const char *target, bool skip_nl, const char *en __attribute__((nonnull)) void delete(void *p); -#endif // vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0 |
