Make source file headers consistent

- Standardize copyright and license notice
- Standardize header guards
This commit is contained in:
Dietrich Epp 2022-04-10 04:22:58 -04:00
parent ad220442d7
commit 3bf095fb49
38 changed files with 142 additions and 24 deletions

7
.header Normal file
View File

@ -0,0 +1,7 @@
width = 80
tabsize = 4
guards = true
copyright_notice = <<EOF
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.
EOF

View File

@ -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 "convert/convert.h"
struct ConvertEngine {

View File

@ -1,5 +1,8 @@
#ifndef convert_h
#define convert_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 CONVERT_CONVERT_H
#define CONVERT_CONVERT_H
/* convert.h - character set conversion routines. */
#include "lib/defs.h"

View File

@ -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.
/* convert_1f.c - Forward conversion from extended ASCII to UTF-8. */
#include "convert/convert.h"
#include "lib/defs.h"

View File

@ -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.
/* convert_1r.c - Reverse conversion from UTF-8 to extended ASCII. */
#include "convert/convert.h"
#include "lib/defs.h"

View File

@ -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 "convert/convert.h"
#include "convert/data.h"
#include "lib/test.h"

View File

@ -1,5 +1,8 @@
#ifndef data_h
#define data_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 CONVERT_DATA_H
#define CONVERT_DATA_H
/* data.h - charmap data, not used for classic Mac OS builds */
#include "lib/defs.h"

View File

@ -1,3 +1,11 @@
// 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 CONVERT_RESOURCES_H
#define CONVERT_RESOURCES_H
#define rSTRS_Charmaps 128
#define rSTRS_Scripts 129
#define rSTRS_Regions 130
#endif

View File

@ -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/crc32.h"
static int gCRCInitted;

View File

@ -1,5 +1,8 @@
#ifndef CRC32_H
#define CRC32_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_CRC32_H
#define LIB_CRC32_H
#include "lib/defs.h"

View File

@ -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/crc32.h"
#include <stdio.h>

View File

@ -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. */
/*==============================================================================

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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 <stdarg.h>

View File

@ -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. */

View File

@ -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"

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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 <string.h>

View File

@ -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

View File

@ -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"

View File

@ -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 <stdio.h>

View File

@ -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"

View File

@ -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"