From e96f9f3869c6ea5803f5759bf1737547a46be22f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Mon, 19 Jul 2021 11:32:34 +0200 Subject: Change function declaration style This is a very sweeping change, but I feel that it is necessary. --- src/command.c | 40 ++++++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 10 deletions(-) (limited to 'src/command.c') diff --git a/src/command.c b/src/command.c index b82498d..5f47126 100644 --- a/src/command.c +++ b/src/command.c @@ -28,14 +28,18 @@ static void ReleaseCommands(CommandNode **commands); static void AddCommand(CommandNode **commands, const char *command); /** Initialize the command lists. */ -void InitializeCommands() { +void +InitializeCommands() +{ startupCommands = NULL; shutdownCommands = NULL; restartCommands = NULL; } /** Process startup/restart commands. */ -void StartupCommands() { +void +StartupCommands() +{ if(isRestarting) { RunCommands(restartCommands); @@ -46,7 +50,9 @@ void StartupCommands() { } /** Process shutdown commands. */ -void ShutdownCommands() { +void +ShutdownCommands() +{ if(!shouldRestart) { RunCommands(shutdownCommands); @@ -55,14 +61,18 @@ void ShutdownCommands() { } /** Destroy the command lists. */ -void DestroyCommands() { +void +DestroyCommands() +{ ReleaseCommands(&startupCommands); ReleaseCommands(&shutdownCommands); ReleaseCommands(&restartCommands); } /** Run the commands in a command list. */ -void RunCommands(CommandNode *commands) { +void +RunCommands(CommandNode *commands) +{ CommandNode *cp; @@ -73,7 +83,9 @@ void RunCommands(CommandNode *commands) { } /** Release a command list. */ -void ReleaseCommands(CommandNode **commands) { +void +ReleaseCommands(CommandNode **commands) +{ CommandNode *cp; @@ -89,7 +101,9 @@ void ReleaseCommands(CommandNode **commands) { } /** Add a command to a command list. */ -void AddCommand(CommandNode **commands, const char *command) { +void +AddCommand(CommandNode **commands, const char *command) +{ CommandNode *cp; @@ -108,17 +122,23 @@ void AddCommand(CommandNode **commands, const char *command) { } /** Add a startup command. */ -void AddStartupCommand(const char *command) { +void +AddStartupCommand(const char *command) +{ AddCommand(&startupCommands, command); } /** Add a shutdown command. */ -void AddShutdownCommand(const char *command) { +void +AddShutdownCommand(const char *command) +{ AddCommand(&shutdownCommands, command); } /** Add a restart command. */ -void AddRestartCommand(const char *command) { +void +AddRestartCommand(const char *command) +{ AddCommand(&restartCommands, command); } -- cgit v1.2.3