JWM Source Documentation
Data Structures | Typedefs | Functions | Variables
command.c File Reference

Handle running startup, shutdown, and restart commands. More...

#include "jwm.h"
#include "command.h"
#include "misc.h"
#include "main.h"
#include "error.h"

Go to the source code of this file.

Data Structures

struct  CommandNode
 Structure to represent a list of commands. More...
 

Typedefs

typedef struct CommandNode CommandNode
 Structure to represent a list of commands.
 

Functions

static void RunCommands (CommandNode *commands)
 Run the commands in a command list.
 
static void ReleaseCommands (CommandNode **commands)
 Release a command list.
 
static void AddCommand (CommandNode **commands, const char *command)
 Add a command to a command list.
 
void StartupCommands (void)
 Process startup/restart commands.
 
void ShutdownCommands (void)
 Process shutdown commands.
 
void DestroyCommands (void)
 Destroy the command lists.
 
void AddStartupCommand (const char *command)
 Add a startup command.
 
void AddShutdownCommand (const char *command)
 Add a shutdown command.
 
void AddRestartCommand (const char *command)
 Add a restart command.
 
void RunCommand (const char *command)
 Execute an external program.
 

Variables

static CommandNodestartupCommands = NULL
 
static CommandNodeshutdownCommands = NULL
 
static CommandNoderestartCommands = NULL
 

Detailed Description

Handle running startup, shutdown, and restart commands.

Author
Joe Wingbermuehle
Date
2004-2006

Definition in file command.c.

Typedef Documentation

typedef struct CommandNode CommandNode

Structure to represent a list of commands.

Function Documentation

void AddCommand ( CommandNode **  commands,
const char *  command 
)
static

Add a command to a command list.

Definition at line 84 of file command.c.

References Allocate, Assert, CommandNode::command, CopyString(), and CommandNode::next.

Referenced by AddRestartCommand(), AddShutdownCommand(), and AddStartupCommand().

void AddRestartCommand ( const char *  command)

Add a restart command.

Add a command to be executed after a restart.

Definition at line 113 of file command.c.

References AddCommand().

Referenced by Parse().

void AddShutdownCommand ( const char *  command)

Add a shutdown command.

Add a command to be executed at shutdown.

Definition at line 108 of file command.c.

References AddCommand().

Referenced by Parse().

void AddStartupCommand ( const char *  command)

Add a startup command.

Add a command to be executed at startup.

Definition at line 102 of file command.c.

References AddCommand().

Referenced by Parse().

void DestroyCommands ( void  )

Destroy the command lists.

Definition at line 49 of file command.c.

References ReleaseCommands().

Referenced by Destroy().

void ReleaseCommands ( CommandNode **  commands)
static

Release a command list.

Definition at line 68 of file command.c.

References Assert, CommandNode::next, and Release.

Referenced by DestroyCommands().

void RunCommand ( const char *  command)

Execute an external program.

Run a command.

Definition at line 118 of file command.c.

References _, display, displayString, JUNLIKELY, SHELL_NAME, and Warning().

Referenced by LoadBackground(), ProcessActionPress(), ProcessActionRelease(), RunCommands(), RunKeyCommand(), RunRootCommand(), and StartupSwallow().

void RunCommands ( CommandNode commands)
static

Run the commands in a command list.

Definition at line 57 of file command.c.

References CommandNode::command, CommandNode::next, and RunCommand().

Referenced by ShutdownCommands(), and StartupCommands().

void ShutdownCommands ( void  )

Process shutdown commands.

Definition at line 41 of file command.c.

References RunCommands(), and shouldRestart.

Referenced by Shutdown().

void StartupCommands ( void  )

Process startup/restart commands.

Definition at line 31 of file command.c.

References isRestarting, and RunCommands().

Referenced by Startup().

Variable Documentation

CommandNode* restartCommands = NULL
static

Definition at line 24 of file command.c.

CommandNode* shutdownCommands = NULL
static

Definition at line 23 of file command.c.

CommandNode* startupCommands = NULL
static

Definition at line 22 of file command.c.

joewing.net / Projects / JWM