From b7b542671224781c20e578905c2501da97c60a10 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Wed, 4 Jan 2023 10:42:03 +0000 Subject: [PATCH] Restyled by clang-format --- src/tools/kdb/colors.c | 17 +++++++++-------- src/tools/kdb/command.h | 2 +- src/tools/kdb/mountpoint-mount.c | 4 ++-- src/tools/kdb/mountpoint-mount.h | 12 ++++++------ src/tools/kdb/mountpoint-remount.c | 13 +++++++------ src/tools/kdb/mountpoint-remount.h | 12 ++++++------ src/tools/kdb/mountpoint-umount.h | 12 ++++++------ src/tools/kdb/mountpoint.h | 12 ++++++------ 8 files changed, 43 insertions(+), 41 deletions(-) diff --git a/src/tools/kdb/colors.c b/src/tools/kdb/colors.c index 869c3279e2d..77ec933201b 100644 --- a/src/tools/kdb/colors.c +++ b/src/tools/kdb/colors.c @@ -1,10 +1,10 @@ /** -* @file -* -* @brief Implementation of ANSI escape helper functions in the kdb tool -* -* @copyright BSD License (see LICENSE.md or https://www.libelektra.org) -*/ + * @file + * + * @brief Implementation of ANSI escape helper functions in the kdb tool + * + * @copyright BSD License (see LICENSE.md or https://www.libelektra.org) + */ #include #include @@ -13,7 +13,8 @@ const char * formatString (char ** buffer, int colorMode, const char * escapeCode, const char * text) { if (colorMode == CLI_COLOR_NEVER) return text; - if (*buffer == NULL) { + if (*buffer == NULL) + { *buffer = elektraMalloc (4096); } char * tmp = elektraMalloc (elektraStrLen (escapeCode) + elektraStrLen (text) + elektraStrLen (RESET) + 1); @@ -22,7 +23,7 @@ const char * formatString (char ** buffer, int colorMode, const char * escapeCod strcat (tmp, RESET); **buffer = '\0'; - strcpy(*buffer, tmp); + strcpy (*buffer, tmp); elektraFree (tmp); return *buffer; diff --git a/src/tools/kdb/command.h b/src/tools/kdb/command.h index b551967779d..04d08078814 100644 --- a/src/tools/kdb/command.h +++ b/src/tools/kdb/command.h @@ -80,7 +80,7 @@ colorMode = CLI_COLOR_ALWAYS; \ } \ } \ - char * fmtBuffer = NULL; \ + char * fmtBuffer = NULL; \ if (!isatty (STDOUT_FILENO)) \ { \ colorMode = CLI_COLOR_NEVER; \ diff --git a/src/tools/kdb/mountpoint-mount.c b/src/tools/kdb/mountpoint-mount.c index 757fe136b63..04eb8a60343 100644 --- a/src/tools/kdb/mountpoint-mount.c +++ b/src/tools/kdb/mountpoint-mount.c @@ -6,10 +6,10 @@ * @copyright BSD License (see LICENSE.md or https://www.libelektra.org) */ -#include #include -#include +#include #include +#include #include #include diff --git a/src/tools/kdb/mountpoint-mount.h b/src/tools/kdb/mountpoint-mount.h index 382365363f9..423264bae86 100644 --- a/src/tools/kdb/mountpoint-mount.h +++ b/src/tools/kdb/mountpoint-mount.h @@ -1,10 +1,10 @@ /** -* @file -* -* @brief Header for mount command -* -* @copyright BSD License (see LICENSE.md or https://www.libelektra.org) -*/ + * @file + * + * @brief Header for mount command + * + * @copyright BSD License (see LICENSE.md or https://www.libelektra.org) + */ #ifndef ELEKTRA_KDB_MOUNT_H #define ELEKTRA_KDB_MOUNT_H diff --git a/src/tools/kdb/mountpoint-remount.c b/src/tools/kdb/mountpoint-remount.c index 3377eb559ea..29b3cf47517 100644 --- a/src/tools/kdb/mountpoint-remount.c +++ b/src/tools/kdb/mountpoint-remount.c @@ -24,14 +24,15 @@ void addRemountSpec (KeySet * spec) { - ksAppendKey (spec, keyNew (COMMAND_SPEC_KEY (COMMAND_NAME), KEY_META, "description", "Remount an existing backend with a different filename.", KEY_META, - "command", "remount", KEY_END)); + ksAppendKey (spec, keyNew (COMMAND_SPEC_KEY (COMMAND_NAME), KEY_META, "description", + "Remount an existing backend with a different filename.", KEY_META, "command", "remount", KEY_END)); ksAppendKey (spec, keyNew (COMMAND_SPEC_KEY (COMMAND_NAME) "/filename", KEY_META, "description", "The new filename.", KEY_META, "args", "indexed", KEY_META, "args/index", "0", KEY_END)); - ksAppendKey (spec, keyNew (COMMAND_SPEC_KEY (COMMAND_NAME) "/path", KEY_META, "description", "The new path.", KEY_META, - "args", "indexed", KEY_META, "args/index", "1", KEY_END)); - ksAppendKey (spec, keyNew (COMMAND_SPEC_KEY (COMMAND_NAME) "/mountpoint", KEY_META, "description", "The mountpoint that should be remounted", KEY_META, - "args", "indexed", KEY_META, "args/index", "2", KEY_END)); + ksAppendKey (spec, keyNew (COMMAND_SPEC_KEY (COMMAND_NAME) "/path", KEY_META, "description", "The new path.", KEY_META, "args", + "indexed", KEY_META, "args/index", "1", KEY_END)); + ksAppendKey (spec, + keyNew (COMMAND_SPEC_KEY (COMMAND_NAME) "/mountpoint", KEY_META, "description", + "The mountpoint that should be remounted", KEY_META, "args", "indexed", KEY_META, "args/index", "2", KEY_END)); ADD_BASIC_OPTIONS (spec, COMMAND_SPEC_KEY (COMMAND_NAME)) diff --git a/src/tools/kdb/mountpoint-remount.h b/src/tools/kdb/mountpoint-remount.h index 2b7fd46a46c..ebc5f133459 100644 --- a/src/tools/kdb/mountpoint-remount.h +++ b/src/tools/kdb/mountpoint-remount.h @@ -1,10 +1,10 @@ /** -* @file -* -* @brief Header for remount command -* -* @copyright BSD License (see LICENSE.md or https://www.libelektra.org) -*/ + * @file + * + * @brief Header for remount command + * + * @copyright BSD License (see LICENSE.md or https://www.libelektra.org) + */ #ifndef ELEKTRA_KDB_REMOUNT_H #define ELEKTRA_KDB_REMOUNT_H diff --git a/src/tools/kdb/mountpoint-umount.h b/src/tools/kdb/mountpoint-umount.h index fd193ebd7e4..2efcc181085 100644 --- a/src/tools/kdb/mountpoint-umount.h +++ b/src/tools/kdb/mountpoint-umount.h @@ -1,10 +1,10 @@ /** -* @file -* -* @brief Header for umount command -* -* @copyright BSD License (see LICENSE.md or https://www.libelektra.org) -*/ + * @file + * + * @brief Header for umount command + * + * @copyright BSD License (see LICENSE.md or https://www.libelektra.org) + */ #ifndef ELEKTRA_KDB_UMOUNT_H #define ELEKTRA_KDB_UMOUNT_H diff --git a/src/tools/kdb/mountpoint.h b/src/tools/kdb/mountpoint.h index f43edf5eac4..d761e44e33d 100644 --- a/src/tools/kdb/mountpoint.h +++ b/src/tools/kdb/mountpoint.h @@ -1,9 +1,9 @@ /** -* @file -* -* @brief Header for mount command -* -* @copyright BSD License (see LICENSE.md or https://www.libelektra.org) + * @file + * + * @brief Header for mount command + * + * @copyright BSD License (see LICENSE.md or https://www.libelektra.org) */ #ifndef ELEKTRA_KDB_MOUNTPOINT_H @@ -33,6 +33,6 @@ void addMountpointSpec (KeySet * spec); int execMountpoint (KeySet * options, Key * errorKey); // helper functions -KeySet * getMountConfig(KDB * handle, Key * ); +KeySet * getMountConfig (KDB * handle, Key *); #endif // ELEKTRA_KDB_MOUNTPOINT_H