Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
Restyled by clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
restyled-commits authored and hannes99 committed Mar 1, 2023
1 parent 628080e commit b7b5426
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 41 deletions.
17 changes: 9 additions & 8 deletions src/tools/kdb/colors.c
Original file line number Diff line number Diff line change
@@ -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 <colors.h>
#include <kdberrors.h>
Expand All @@ -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);
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/tools/kdb/command.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
colorMode = CLI_COLOR_ALWAYS; \
} \
} \
char * fmtBuffer = NULL; \
char * fmtBuffer = NULL; \
if (!isatty (STDOUT_FILENO)) \
{ \
colorMode = CLI_COLOR_NEVER; \
Expand Down
4 changes: 2 additions & 2 deletions src/tools/kdb/mountpoint-mount.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
* @copyright BSD License (see LICENSE.md or https://www.libelektra.org)
*/

#include <command.h>
#include <cmerge.h>
#include <mountpoint.h>
#include <command.h>
#include <mountpoint-mount.h>
#include <mountpoint.h>

#include <kdb.h>
#include <kdbassert.h>
Expand Down
12 changes: 6 additions & 6 deletions src/tools/kdb/mountpoint-mount.h
Original file line number Diff line number Diff line change
@@ -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
Expand Down
13 changes: 7 additions & 6 deletions src/tools/kdb/mountpoint-remount.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
12 changes: 6 additions & 6 deletions src/tools/kdb/mountpoint-remount.h
Original file line number Diff line number Diff line change
@@ -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
Expand Down
12 changes: 6 additions & 6 deletions src/tools/kdb/mountpoint-umount.h
Original file line number Diff line number Diff line change
@@ -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
Expand Down
12 changes: 6 additions & 6 deletions src/tools/kdb/mountpoint.h
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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

0 comments on commit b7b5426

Please sign in to comment.