summaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/compat.c9
-rw-r--r--src/common/compat.h14
-rw-r--r--src/common/config-parser.c9
-rw-r--r--src/common/config-parser.h14
-rw-r--r--src/common/error.c9
-rw-r--r--src/common/error.h14
-rw-r--r--src/common/file.c9
-rw-r--r--src/common/file.h14
-rw-r--r--src/common/sort.c9
-rw-r--r--src/common/sort.h14
-rw-r--r--src/common/stdin.c9
-rw-r--r--src/common/stdin.h14
-rw-r--r--src/common/utf8.c26
-rw-r--r--src/common/utf8.h14
-rw-r--r--src/common/utils.c9
-rw-r--r--src/common/utils.h14
16 files changed, 41 insertions, 160 deletions
diff --git a/src/common/compat.c b/src/common/compat.c
index f7394c8..179e97b 100644
--- a/src/common/compat.c
+++ b/src/common/compat.c
@@ -1,10 +1,5 @@
-/*
- * blogc: A blog compiler.
- * Copyright (C) 2014-2019 Rafael G. Martins <rafael@rafaelmartins.eng.br>
- *
- * This program can be distributed under the terms of the BSD License.
- * See the file LICENSE.
- */
+// SPDX-FileCopyrightText: 2014-2024 Rafael G. Martins <rafael@rafaelmartins.eng.br>
+// SPDX-License-Identifier: BSD-3-Clause
#ifdef HAVE_CONFIG_H
#include <config.h>
diff --git a/src/common/compat.h b/src/common/compat.h
index 1e743db..4acf167 100644
--- a/src/common/compat.h
+++ b/src/common/compat.h
@@ -1,14 +1,6 @@
-/*
- * blogc: A blog compiler.
- * Copyright (C) 2014-2019 Rafael G. Martins <rafael@rafaelmartins.eng.br>
- *
- * This program can be distributed under the terms of the BSD License.
- * See the file LICENSE.
- */
+// SPDX-FileCopyrightText: 2014-2024 Rafael G. Martins <rafael@rafaelmartins.eng.br>
+// SPDX-License-Identifier: BSD-3-Clause
-#ifndef _COMPAT_H
-#define _COMPAT_H
+#pragma once
int bc_compat_status_code(int waitstatus);
-
-#endif /* _COMPAT_H */
diff --git a/src/common/config-parser.c b/src/common/config-parser.c
index fbb79af..511d4ea 100644
--- a/src/common/config-parser.c
+++ b/src/common/config-parser.c
@@ -1,10 +1,5 @@
-/*
- * blogc: A blog compiler.
- * Copyright (C) 2014-2019 Rafael G. Martins <rafael@rafaelmartins.eng.br>
- *
- * This program can be distributed under the terms of the BSD License.
- * See the file LICENSE.
- */
+// SPDX-FileCopyrightText: 2014-2024 Rafael G. Martins <rafael@rafaelmartins.eng.br>
+// SPDX-License-Identifier: BSD-3-Clause
#include <stdbool.h>
#include <stdlib.h>
diff --git a/src/common/config-parser.h b/src/common/config-parser.h
index 0b75ff8..700bc0b 100644
--- a/src/common/config-parser.h
+++ b/src/common/config-parser.h
@@ -1,13 +1,7 @@
-/*
- * blogc: A blog compiler.
- * Copyright (C) 2014-2019 Rafael G. Martins <rafael@rafaelmartins.eng.br>
- *
- * This program can be distributed under the terms of the BSD License.
- * See the file LICENSE.
- */
+// SPDX-FileCopyrightText: 2014-2024 Rafael G. Martins <rafael@rafaelmartins.eng.br>
+// SPDX-License-Identifier: BSD-3-Clause
-#ifndef _CONFIG_PARSER_H
-#define _CONFIG_PARSER_H
+#pragma once
#include <stddef.h>
#include "utils.h"
@@ -27,5 +21,3 @@ const char* bc_config_get_with_default(bc_config_t *config, const char *section,
const char *key, const char *default_);
char** bc_config_get_list(bc_config_t *config, const char *section);
void bc_config_free(bc_config_t *config);
-
-#endif /* _CONFIG_PARSER_H */
diff --git a/src/common/error.c b/src/common/error.c
index caf47c3..3522a5c 100644
--- a/src/common/error.c
+++ b/src/common/error.c
@@ -1,10 +1,5 @@
-/*
- * blogc: A blog compiler.
- * Copyright (C) 2014-2019 Rafael G. Martins <rafael@rafaelmartins.eng.br>
- *
- * This program can be distributed under the terms of the BSD License.
- * See the file LICENSE.
- */
+// SPDX-FileCopyrightText: 2014-2024 Rafael G. Martins <rafael@rafaelmartins.eng.br>
+// SPDX-License-Identifier: BSD-3-Clause
#include <stdio.h>
#include <stdlib.h>
diff --git a/src/common/error.h b/src/common/error.h
index b85f006..f1f3c96 100644
--- a/src/common/error.h
+++ b/src/common/error.h
@@ -1,13 +1,7 @@
-/*
- * blogc: A blog compiler.
- * Copyright (C) 2014-2019 Rafael G. Martins <rafael@rafaelmartins.eng.br>
- *
- * This program can be distributed under the terms of the BSD License.
- * See the file LICENSE.
- */
+// SPDX-FileCopyrightText: 2014-2024 Rafael G. Martins <rafael@rafaelmartins.eng.br>
+// SPDX-License-Identifier: BSD-3-Clause
-#ifndef _ERROR_H
-#define _ERROR_H
+#pragma once
#include <stddef.h>
@@ -43,5 +37,3 @@ bc_error_t* bc_error_parser(bc_error_type_t type, const char *src,
size_t src_len, size_t current, const char *format, ...);
void bc_error_print(bc_error_t *err, const char *prefix);
void bc_error_free(bc_error_t *err);
-
-#endif /* _ERROR_H */
diff --git a/src/common/file.c b/src/common/file.c
index 1e55f64..121b91e 100644
--- a/src/common/file.c
+++ b/src/common/file.c
@@ -1,10 +1,5 @@
-/*
- * blogc: A blog compiler.
- * Copyright (C) 2014-2019 Rafael G. Martins <rafael@rafaelmartins.eng.br>
- *
- * This program can be distributed under the terms of the BSD License.
- * See the file LICENSE.
- */
+// SPDX-FileCopyrightText: 2014-2024 Rafael G. Martins <rafael@rafaelmartins.eng.br>
+// SPDX-License-Identifier: BSD-3-Clause
#include <errno.h>
#include <stdbool.h>
diff --git a/src/common/file.h b/src/common/file.h
index d002bf7..18d631d 100644
--- a/src/common/file.h
+++ b/src/common/file.h
@@ -1,13 +1,7 @@
-/*
- * blogc: A blog compiler.
- * Copyright (C) 2014-2019 Rafael G. Martins <rafael@rafaelmartins.eng.br>
- *
- * This program can be distributed under the terms of the BSD License.
- * See the file LICENSE.
- */
+// SPDX-FileCopyrightText: 2014-2024 Rafael G. Martins <rafael@rafaelmartins.eng.br>
+// SPDX-License-Identifier: BSD-3-Clause
-#ifndef _FILE_H
-#define _FILE_H
+#pragma once
#include <stddef.h>
#include <stdbool.h>
@@ -16,5 +10,3 @@
#define BC_FILE_CHUNK_SIZE 1024
char* bc_file_get_contents(const char *path, bool utf8, size_t *len, bc_error_t **err);
-
-#endif /* _FILE_H */
diff --git a/src/common/sort.c b/src/common/sort.c
index 3e24706..6b5da49 100644
--- a/src/common/sort.c
+++ b/src/common/sort.c
@@ -1,10 +1,5 @@
-/*
- * blogc: A blog compiler.
- * Copyright (C) 2014-2019 Rafael G. Martins <rafael@rafaelmartins.eng.br>
- *
- * This program can be distributed under the terms of the BSD License.
- * See the file LICENSE.
- */
+// SPDX-FileCopyrightText: 2014-2024 Rafael G. Martins <rafael@rafaelmartins.eng.br>
+// SPDX-License-Identifier: BSD-3-Clause
#include <stdbool.h>
#include "utils.h"
diff --git a/src/common/sort.h b/src/common/sort.h
index 9f4dda2..b77d682 100644
--- a/src/common/sort.h
+++ b/src/common/sort.h
@@ -1,18 +1,10 @@
-/*
- * blogc: A blog compiler.
- * Copyright (C) 2014-2019 Rafael G. Martins <rafael@rafaelmartins.eng.br>
- *
- * This program can be distributed under the terms of the BSD License.
- * See the file LICENSE.
- */
+// SPDX-FileCopyrightText: 2014-2024 Rafael G. Martins <rafael@rafaelmartins.eng.br>
+// SPDX-License-Identifier: BSD-3-Clause
-#ifndef _SORT_H
-#define _SORT_H
+#pragma once
#include "utils.h"
typedef int (*bc_sort_func_t) (const void *a, const void *b);
bc_slist_t* bc_slist_sort(bc_slist_t *l, bc_sort_func_t cmp);
-
-#endif /* _SORT_H */
diff --git a/src/common/stdin.c b/src/common/stdin.c
index 556c7cf..3bd9abc 100644
--- a/src/common/stdin.c
+++ b/src/common/stdin.c
@@ -1,10 +1,5 @@
-/*
- * blogc: A blog compiler.
- * Copyright (C) 2014-2020 Rafael G. Martins <rafael@rafaelmartins.eng.br>
- *
- * This program can be distributed under the terms of the BSD License.
- * See the file LICENSE.
- */
+// SPDX-FileCopyrightText: 2014-2024 Rafael G. Martins <rafael@rafaelmartins.eng.br>
+// SPDX-License-Identifier: BSD-3-Clause
#include <stdbool.h>
#include <stdio.h>
diff --git a/src/common/stdin.h b/src/common/stdin.h
index b27ecaf..a781b8c 100644
--- a/src/common/stdin.h
+++ b/src/common/stdin.h
@@ -1,16 +1,8 @@
-/*
- * blogc: A blog compiler.
- * Copyright (C) 2014-2020 Rafael G. Martins <rafael@rafaelmartins.eng.br>
- *
- * This program can be distributed under the terms of the BSD License.
- * See the file LICENSE.
- */
+// SPDX-FileCopyrightText: 2014-2024 Rafael G. Martins <rafael@rafaelmartins.eng.br>
+// SPDX-License-Identifier: BSD-3-Clause
-#ifndef _STDIN_H
-#define _STDIN_H
+#pragma once
#include <stddef.h>
char* bc_stdin_read(size_t *len);
-
-#endif /* _STDIN_H */
diff --git a/src/common/utf8.c b/src/common/utf8.c
index df5e2d2..be5d2b2 100644
--- a/src/common/utf8.c
+++ b/src/common/utf8.c
@@ -1,26 +1,6 @@
-/*
- * blogc: A blog compiler.
- * Copyright (c) 2008-2010 Bjoern Hoehrmann <bjoern@hoehrmann.de>
- * Copyright (c) 2014-2019 Rafael G. Martins <rafael@rafaelmartins.eng.br>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
+// SPDX-FileCopyrightText: 2008-2010 Bjoern Hoehrmann <bjoern@hoehrmann.de>
+// SPDX-FileCopyrightText: 2014-2024 Rafael G. Martins <rafael@rafaelmartins.eng.br>
+// SPDX-License-Identifier: MIT
// Based on Bjoern Hoehrmann's algorithm.
// See http://bjoern.hoehrmann.de/utf-8/decoder/dfa/ for details.
diff --git a/src/common/utf8.h b/src/common/utf8.h
index bf0f1ae..6c1a992 100644
--- a/src/common/utf8.h
+++ b/src/common/utf8.h
@@ -1,13 +1,7 @@
-/*
- * blogc: A blog compiler.
- * Copyright (C) 2014-2019 Rafael G. Martins <rafael@rafaelmartins.eng.br>
- *
- * This program can be distributed under the terms of the BSD License.
- * See the file LICENSE.
- */
+// SPDX-FileCopyrightText: 2014-2024 Rafael G. Martins <rafael@rafaelmartins.eng.br>
+// SPDX-License-Identifier: BSD-3-Clause
-#ifndef _UTF_8_H
-#define _UTF_8_H
+#pragma once
#include <stdbool.h>
#include <stddef.h>
@@ -17,5 +11,3 @@
bool bc_utf8_validate(const uint8_t *str, size_t len);
bool bc_utf8_validate_str(bc_string_t *str);
size_t bc_utf8_skip_bom(const uint8_t *str, size_t len);
-
-#endif /* _UTF_8_H */
diff --git a/src/common/utils.c b/src/common/utils.c
index ddd3911..7491ce6 100644
--- a/src/common/utils.c
+++ b/src/common/utils.c
@@ -1,10 +1,5 @@
-/*
- * blogc: A blog compiler.
- * Copyright (C) 2014-2020 Rafael G. Martins <rafael@rafaelmartins.eng.br>
- *
- * This program can be distributed under the terms of the BSD License.
- * See the file LICENSE.
- */
+// SPDX-FileCopyrightText: 2014-2024 Rafael G. Martins <rafael@rafaelmartins.eng.br>
+// SPDX-License-Identifier: BSD-3-Clause
#define BC_STRING_CHUNK_SIZE 128
diff --git a/src/common/utils.h b/src/common/utils.h
index 4bdab8c..a9aa731 100644
--- a/src/common/utils.h
+++ b/src/common/utils.h
@@ -1,13 +1,7 @@
-/*
- * blogc: A blog compiler.
- * Copyright (C) 2014-2020 Rafael G. Martins <rafael@rafaelmartins.eng.br>
- *
- * This program can be distributed under the terms of the BSD License.
- * See the file LICENSE.
- */
+// SPDX-FileCopyrightText: 2014-2024 Rafael G. Martins <rafael@rafaelmartins.eng.br>
+// SPDX-License-Identifier: BSD-3-Clause
-#ifndef _UTILS_H
-#define _UTILS_H
+#pragma once
#include <stddef.h>
#include <stdarg.h>
@@ -106,5 +100,3 @@ void bc_trie_foreach(bc_trie_t *trie, bc_trie_foreach_func_t func,
// shell
char* bc_shell_quote(const char *command);
-
-#endif /* _UTILS_H */