From 3bf095fb49ce68979bf0f8f98284e4b3d3c4a0b3 Mon Sep 17 00:00:00 2001 From: Dietrich Epp Date: Sun, 10 Apr 2022 04:22:58 -0400 Subject: [PATCH] Make source file headers consistent - Standardize copyright and license notice - Standardize header guards --- .header | 7 +++++++ convert/convert.c | 3 +++ convert/convert.h | 7 +++++-- convert/convert_1f.c | 3 +++ convert/convert_1r.c | 3 +++ convert/convert_test.c | 3 +++ convert/data.h | 7 +++++-- convert/resources.h | 8 ++++++++ lib/crc32.c | 3 +++ lib/crc32.h | 7 +++++-- lib/crc32_test.c | 3 +++ lib/defs.h | 7 +++++-- lib/endian.h | 9 ++++++--- lib/endian_test.c | 3 +++ lib/test.c | 3 +++ lib/test.h | 7 +++++-- lib/toolbox.c | 3 +++ lib/util.c | 3 +++ lib/util.h | 7 +++++-- macos/choose_directory.c | 3 +++ macos/choose_directory.h | 3 +++ macos/error.c | 3 +++ macos/error.h | 4 +++- macos/main.c | 3 +++ macos/main.h | 4 +++- macos/path.c | 3 +++ macos/path.h | 4 +++- macos/project.c | 3 +++ macos/project.h | 4 +++- macos/resources.h | 3 +++ macos/strutil.c | 3 +++ macos/strutil.h | 4 +++- macos/tempfile.c | 3 +++ macos/tempfile.h | 3 +++ sync/meta.h | 7 +++++-- sync/tree.c | 3 +++ sync/tree.h | 7 +++++-- sync/tree_test.c | 3 +++ 38 files changed, 142 insertions(+), 24 deletions(-) create mode 100644 .header diff --git a/.header b/.header new file mode 100644 index 0000000..f647a29 --- /dev/null +++ b/.header @@ -0,0 +1,7 @@ +width = 80 +tabsize = 4 +guards = true +copyright_notice = < diff --git a/lib/defs.h b/lib/defs.h index cfd72d6..670b1e5 100644 --- a/lib/defs.h +++ b/lib/defs.h @@ -1,5 +1,8 @@ -#ifndef lib_defs_h -#define lib_defs_h +// Copyright 2022 Dietrich Epp. +// This file is part of SyncFiles. SyncFiles is licensed under the terms of the +// Mozilla Public License, version 2.0. See LICENSE.txt for details. +#ifndef LIB_DEFS_H +#define LIB_DEFS_H /* defs.h - common definitions. */ /*============================================================================== diff --git a/lib/endian.h b/lib/endian.h index e95b133..7f97cd7 100644 --- a/lib/endian.h +++ b/lib/endian.h @@ -1,5 +1,8 @@ -#ifndef lib_endian_h -#define lib_endian_h +// Copyright 2022 Dietrich Epp. +// This file is part of SyncFiles. SyncFiles is licensed under the terms of the +// Mozilla Public License, version 2.0. See LICENSE.txt for details. +#ifndef LIB_ENDIAN_H +#define LIB_ENDIAN_H /* endian.h - byte order and byte swapping */ /* @@ -72,4 +75,4 @@ #endif /* TARGET_API_MAC_OS8 */ -#endif /* lib_endian_h */ +#endif diff --git a/lib/endian_test.c b/lib/endian_test.c index 27470ec..e01e1fe 100644 --- a/lib/endian_test.c +++ b/lib/endian_test.c @@ -1,3 +1,6 @@ +// Copyright 2022 Dietrich Epp. +// This file is part of SyncFiles. SyncFiles is licensed under the terms of the +// Mozilla Public License, version 2.0. See LICENSE.txt for details. #include "lib/endian.h" #include "lib/test.h" diff --git a/lib/test.c b/lib/test.c index b51a882..d93cccf 100644 --- a/lib/test.c +++ b/lib/test.c @@ -1,3 +1,6 @@ +// Copyright 2022 Dietrich Epp. +// This file is part of SyncFiles. SyncFiles is licensed under the terms of the +// Mozilla Public License, version 2.0. See LICENSE.txt for details. /* Defined to get vsnprintf. */ #define _XOPEN_SOURCE 500 diff --git a/lib/test.h b/lib/test.h index 186f93f..ea191c7 100644 --- a/lib/test.h +++ b/lib/test.h @@ -1,5 +1,8 @@ -#ifndef test_h -#define test_h +// Copyright 2022 Dietrich Epp. +// This file is part of SyncFiles. SyncFiles is licensed under the terms of the +// Mozilla Public License, version 2.0. See LICENSE.txt for details. +#ifndef LIB_TEST_H +#define LIB_TEST_H /* test.h - unit testing definitions. */ #include "lib/defs.h" diff --git a/lib/toolbox.c b/lib/toolbox.c index aaffb96..456ab9f 100644 --- a/lib/toolbox.c +++ b/lib/toolbox.c @@ -1,3 +1,6 @@ +// Copyright 2022 Dietrich Epp. +// This file is part of SyncFiles. SyncFiles is licensed under the terms of the +// Mozilla Public License, version 2.0. See LICENSE.txt for details. /* toolbox.c - replacement functions for Mac OS toolbox functions This is used to run conversion tests on non-Mac OS systems to make diff --git a/lib/util.c b/lib/util.c index d2bd181..983f243 100644 --- a/lib/util.c +++ b/lib/util.c @@ -1,3 +1,6 @@ +// Copyright 2022 Dietrich Epp. +// This file is part of SyncFiles. SyncFiles is licensed under the terms of the +// Mozilla Public License, version 2.0. See LICENSE.txt for details. #include "lib/util.h" #include diff --git a/lib/util.h b/lib/util.h index a4c1375..f65a586 100644 --- a/lib/util.h +++ b/lib/util.h @@ -1,5 +1,8 @@ -#ifndef lib_util_h -#define lib_util_h +// Copyright 2022 Dietrich Epp. +// This file is part of SyncFiles. SyncFiles is licensed under the terms of the +// Mozilla Public License, version 2.0. See LICENSE.txt for details. +#ifndef LIB_UTIL_H +#define LIB_UTIL_H #include "lib/defs.h" /* Print an error message and exit. */ diff --git a/macos/choose_directory.c b/macos/choose_directory.c index 54ff82f..87ade55 100644 --- a/macos/choose_directory.c +++ b/macos/choose_directory.c @@ -1,3 +1,6 @@ +// Copyright 2022 Dietrich Epp. +// This file is part of SyncFiles. SyncFiles is licensed under the terms of the +// Mozilla Public License, version 2.0. See LICENSE.txt for details. #include "choose_directory.h" #include "error.h" diff --git a/macos/choose_directory.h b/macos/choose_directory.h index b5da516..74d186f 100644 --- a/macos/choose_directory.h +++ b/macos/choose_directory.h @@ -1,3 +1,6 @@ +// Copyright 2022 Dietrich Epp. +// This file is part of SyncFiles. SyncFiles is licensed under the terms of the +// Mozilla Public License, version 2.0. See LICENSE.txt for details. #ifndef MACOS_CHOOSE_DIRECTORY_H #define MACOS_CHOOSE_DIRECTORY_H diff --git a/macos/error.c b/macos/error.c index 4a3590b..0fef764 100644 --- a/macos/error.c +++ b/macos/error.c @@ -1,3 +1,6 @@ +// Copyright 2022 Dietrich Epp. +// This file is part of SyncFiles. SyncFiles is licensed under the terms of the +// Mozilla Public License, version 2.0. See LICENSE.txt for details. #include "error.h" #include "main.h" diff --git a/macos/error.h b/macos/error.h index a70badc..28b342c 100644 --- a/macos/error.h +++ b/macos/error.h @@ -1,4 +1,6 @@ -// error.h - Error handling. +// Copyright 2022 Dietrich Epp. +// This file is part of SyncFiles. SyncFiles is licensed under the terms of the +// Mozilla Public License, version 2.0. See LICENSE.txt for details. #ifndef MACOS_ERROR_H #define MACOS_ERROR_H diff --git a/macos/main.c b/macos/main.c index e92c2b0..324a430 100644 --- a/macos/main.c +++ b/macos/main.c @@ -1,3 +1,6 @@ +// Copyright 2022 Dietrich Epp. +// This file is part of SyncFiles. SyncFiles is licensed under the terms of the +// Mozilla Public License, version 2.0. See LICENSE.txt for details. #include "main.h" #include "error.h" diff --git a/macos/main.h b/macos/main.h index c5b0e1e..957cb66 100644 --- a/macos/main.h +++ b/macos/main.h @@ -1,4 +1,6 @@ -// main.h - Main entry point. +// Copyright 2022 Dietrich Epp. +// This file is part of SyncFiles. SyncFiles is licensed under the terms of the +// Mozilla Public License, version 2.0. See LICENSE.txt for details. #ifndef MACOS_MAIN_H #define MACOS_MAIN_H diff --git a/macos/path.c b/macos/path.c index 0d6b6a4..93cd49f 100644 --- a/macos/path.c +++ b/macos/path.c @@ -1,3 +1,6 @@ +// Copyright 2022 Dietrich Epp. +// This file is part of SyncFiles. SyncFiles is licensed under the terms of the +// Mozilla Public License, version 2.0. See LICENSE.txt for details. #include "path.h" #include "error.h" diff --git a/macos/path.h b/macos/path.h index ef3a18c..c0993eb 100644 --- a/macos/path.h +++ b/macos/path.h @@ -1,4 +1,6 @@ -// path.h - Path manipulation utilities. +// Copyright 2022 Dietrich Epp. +// This file is part of SyncFiles. SyncFiles is licensed under the terms of the +// Mozilla Public License, version 2.0. See LICENSE.txt for details. #ifndef MACOS_PATH_H #define MACOS_PATH_H diff --git a/macos/project.c b/macos/project.c index 9e091a7..d598fcf 100644 --- a/macos/project.c +++ b/macos/project.c @@ -1,3 +1,6 @@ +// Copyright 2022 Dietrich Epp. +// This file is part of SyncFiles. SyncFiles is licensed under the terms of the +// Mozilla Public License, version 2.0. See LICENSE.txt for details. #include "project.h" #include "choose_directory.h" diff --git a/macos/project.h b/macos/project.h index a0503a4..215f79a 100644 --- a/macos/project.h +++ b/macos/project.h @@ -1,4 +1,6 @@ -// project.h - Synchronization projects. +// Copyright 2022 Dietrich Epp. +// This file is part of SyncFiles. SyncFiles is licensed under the terms of the +// Mozilla Public License, version 2.0. See LICENSE.txt for details. #ifndef MACOS_PROJECT_H #define MACOS_PROJECT_H diff --git a/macos/resources.h b/macos/resources.h index 53fabd4..fecf35a 100644 --- a/macos/resources.h +++ b/macos/resources.h @@ -1,3 +1,6 @@ +// Copyright 2022 Dietrich Epp. +// This file is part of SyncFiles. SyncFiles is licensed under the terms of the +// Mozilla Public License, version 2.0. See LICENSE.txt for details. #ifndef MACOS_RESOURCES_H #define MACOS_RESOURCES_H diff --git a/macos/strutil.c b/macos/strutil.c index c01b66e..f06c42d 100644 --- a/macos/strutil.c +++ b/macos/strutil.c @@ -1,3 +1,6 @@ +// Copyright 2022 Dietrich Epp. +// This file is part of SyncFiles. SyncFiles is licensed under the terms of the +// Mozilla Public License, version 2.0. See LICENSE.txt for details. #include "strutil.h" #include "error.h" diff --git a/macos/strutil.h b/macos/strutil.h index af492ec..345bcfd 100644 --- a/macos/strutil.h +++ b/macos/strutil.h @@ -1,4 +1,6 @@ -// strutil.h - String utilities. +// Copyright 2022 Dietrich Epp. +// This file is part of SyncFiles. SyncFiles is licensed under the terms of the +// Mozilla Public License, version 2.0. See LICENSE.txt for details. #ifndef MACOS_STRUTIL_H #define MACOS_STRUTIL_H diff --git a/macos/tempfile.c b/macos/tempfile.c index eeae512..1f251c9 100644 --- a/macos/tempfile.c +++ b/macos/tempfile.c @@ -1,3 +1,6 @@ +// Copyright 2022 Dietrich Epp. +// This file is part of SyncFiles. SyncFiles is licensed under the terms of the +// Mozilla Public License, version 2.0. See LICENSE.txt for details. #include "tempfile.h" #include diff --git a/macos/tempfile.h b/macos/tempfile.h index 7741095..76c29f6 100644 --- a/macos/tempfile.h +++ b/macos/tempfile.h @@ -1,3 +1,6 @@ +// Copyright 2022 Dietrich Epp. +// This file is part of SyncFiles. SyncFiles is licensed under the terms of the +// Mozilla Public License, version 2.0. See LICENSE.txt for details. #ifndef MACOS_TEMPFILE_H #define MACOS_TEMPFILE_H diff --git a/sync/meta.h b/sync/meta.h index 7e89212..a7e9482 100644 --- a/sync/meta.h +++ b/sync/meta.h @@ -1,5 +1,8 @@ -#ifndef sync_meta_h -#define sync_meta_h +// Copyright 2022 Dietrich Epp. +// This file is part of SyncFiles. SyncFiles is licensed under the terms of the +// Mozilla Public License, version 2.0. See LICENSE.txt for details. +#ifndef SYNC_META_H +#define SYNC_META_H /* meta.h - file metadata */ #include "lib/defs.h" diff --git a/sync/tree.c b/sync/tree.c index 3effed8..a697c50 100644 --- a/sync/tree.c +++ b/sync/tree.c @@ -1,3 +1,6 @@ +// Copyright 2022 Dietrich Epp. +// This file is part of SyncFiles. SyncFiles is licensed under the terms of the +// Mozilla Public License, version 2.0. See LICENSE.txt for details. #include "sync/tree.h" #include diff --git a/sync/tree.h b/sync/tree.h index ea25f46..e8faeee 100644 --- a/sync/tree.h +++ b/sync/tree.h @@ -1,5 +1,8 @@ -#ifndef sync_tree_h -#define sync_tree_h +// Copyright 2022 Dietrich Epp. +// This file is part of SyncFiles. SyncFiles is licensed under the terms of the +// Mozilla Public License, version 2.0. See LICENSE.txt for details. +#ifndef SYNC_TREE_H +#define SYNC_TREE_H /* tree.h - binary search trees of file metadata */ #include "sync/meta.h" diff --git a/sync/tree_test.c b/sync/tree_test.c index 7685956..d7b080d 100644 --- a/sync/tree_test.c +++ b/sync/tree_test.c @@ -1,3 +1,6 @@ +// Copyright 2022 Dietrich Epp. +// This file is part of SyncFiles. SyncFiles is licensed under the terms of the +// Mozilla Public License, version 2.0. See LICENSE.txt for details. #include "sync/tree.h"