aboutsummaryrefslogtreecommitdiffhomepage
path: root/event.h
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-11-18 16:30:30 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-11-18 16:30:30 -0800
commit9992b8eb0e3366ff8a3948aa0b66a19c3c12c737 (patch)
tree6dda0fef85812016fbba9ea067c9d586092b506d /event.h
parentbab69f26724028d16054a3daf5c78aad7c67bb2d (diff)
Apply new indentation, brace, and whitespace style
Diffstat (limited to 'event.h')
-rw-r--r--event.h65
1 files changed, 33 insertions, 32 deletions
diff --git a/event.h b/event.h
index 7ed5efac..034dafab 100644
--- a/event.h
+++ b/event.h
@@ -31,14 +31,14 @@
*/
enum
{
- EVENT_ANY, /**< Matches any event type (Not always any event, as the function name may limit the choice as well */
- EVENT_SIGNAL, /**< An event triggered by a signal */
- EVENT_VARIABLE, /**< An event triggered by a variable update */
- EVENT_EXIT, /**< An event triggered by a job or process exit */
- EVENT_JOB_ID, /**< An event triggered by a job exit */
- EVENT_GENERIC, /**< A generic event */
+ EVENT_ANY, /**< Matches any event type (Not always any event, as the function name may limit the choice as well */
+ EVENT_SIGNAL, /**< An event triggered by a signal */
+ EVENT_VARIABLE, /**< An event triggered by a variable update */
+ EVENT_EXIT, /**< An event triggered by a job or process exit */
+ EVENT_JOB_ID, /**< An event triggered by a job exit */
+ EVENT_GENERIC, /**< A generic event */
}
- ;
+;
/**
The structure which represents an event. The event_t struct has
@@ -49,18 +49,19 @@ enum
*/
struct event_t
{
- /**
- Type of event
- */
- int type;
+ /**
+ Type of event
+ */
+ int type;
- /** The type-specific parameter. The int types are one of the following:
+ /** The type-specific parameter. The int types are one of the following:
- signal: Signal number for signal-type events.Use EVENT_ANY_SIGNAL to match any signal
- pid: Process id for process-type events. Use EVENT_ANY_PID to match any pid.
- job_id: Job id for EVENT_JOB_ID type events
- */
- union {
+ signal: Signal number for signal-type events.Use EVENT_ANY_SIGNAL to match any signal
+ pid: Process id for process-type events. Use EVENT_ANY_PID to match any pid.
+ job_id: Job id for EVENT_JOB_ID type events
+ */
+ union
+ {
int signal;
int job_id;
pid_t pid;
@@ -73,16 +74,16 @@ struct event_t
*/
wcstring str_param1;
- /**
- The name of the event handler function
- */
- wcstring function_name;
+ /**
+ The name of the event handler function
+ */
+ wcstring function_name;
- /**
- The argument list. Only used when sending a new event using
- event_fire. In all other situations, the value of this variable
- is ignored.
- */
+ /**
+ The argument list. Only used when sending a new event using
+ event_fire. In all other situations, the value of this variable
+ is ignored.
+ */
std::auto_ptr<wcstring_list_t> arguments;
event_t(int t) : type(t), param1(), str_param1(), function_name(), arguments() { }
@@ -100,14 +101,14 @@ struct event_t
May not be called by a signal handler, since it may allocate new memory.
*/
-void event_add_handler( const event_t *event );
+void event_add_handler(const event_t *event);
/**
Remove all events matching the specified criterion.
May not be called by a signal handler, since it may free allocated memory.
*/
-void event_remove( event_t *event );
+void event_remove(event_t *event);
/**
Return all events which match the specified event class
@@ -120,7 +121,7 @@ void event_remove( event_t *event );
\return the number of found matches
*/
-int event_get( event_t *criterion, std::vector<event_t *> *out );
+int event_get(event_t *criterion, std::vector<event_t *> *out);
/**
Returns whether an event listener is registered for the given signal.
@@ -144,7 +145,7 @@ bool event_is_signal_observed(int signal);
\param event the specific event whose handlers should fire. If
null, then all delayed events will be fired.
*/
-void event_fire( event_t *event );
+void event_fire(event_t *event);
/** Like event_fire, but takes a signal directly. */
void event_fire_signal(int signal);
@@ -162,12 +163,12 @@ void event_destroy();
/**
Free all memory used by the specified event
*/
-void event_free( event_t *e );
+void event_free(event_t *e);
/**
Returns a string describing the specified event.
*/
-wcstring event_get_desc( const event_t *e );
+wcstring event_get_desc(const event_t *e);
/**
Fire a generic event with the specified name