aboutsummaryrefslogtreecommitdiffhomepage
path: root/proc.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2011-12-27 00:06:07 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2011-12-27 00:06:07 -0800
commit451399b3445f2a8f929bfe8893df9b3e931ac2b1 (patch)
tree63ec1a66f45badf99e5aabfabb7eea05f1c1da16 /proc.cpp
parent22a8e57a57fcf41d295fbd8716e89dbdae423a32 (diff)
Migrate to std::vector in event class
Diffstat (limited to 'proc.cpp')
-rw-r--r--proc.cpp21
1 files changed, 7 insertions, 14 deletions
diff --git a/proc.cpp b/proc.cpp
index 86c31b52..356e136b 100644
--- a/proc.cpp
+++ b/proc.cpp
@@ -132,7 +132,7 @@ void proc_init()
{
interactive_stack = al_halloc( global_context );
proc_push_interactive( 0 );
- al_init( &event.arguments );
+ event.arguments = new wcstring_list_t;
sb_init( &event_pid );
sb_init( &event_status );
}
@@ -177,7 +177,8 @@ void job_free( job_t * j )
void proc_destroy()
{
- al_destroy( &event.arguments );
+ delete event.arguments;
+ event.arguments = NULL;
sb_destroy( &event_pid );
sb_destroy( &event_status );
while( first_job )
@@ -535,19 +536,11 @@ void proc_fire_event( const wchar_t *msg, int type, pid_t pid, int status )
event.type=type;
event.param1.pid = pid;
- al_push( &event.arguments, msg );
-
- sb_printf( &event_pid, L"%d", pid );
- al_push( &event.arguments, event_pid.buff );
-
- sb_printf( &event_status, L"%d", status );
- al_push( &event.arguments, event_status.buff );
-
+ event.arguments->push_back(msg);
+ event.arguments->push_back(format_val<int>(pid));
+ event.arguments->push_back(format_val<int>(status));
event_fire( &event );
-
- al_truncate( &event.arguments, 0 );
- sb_clear( &event_pid );
- sb_clear( &event_status );
+ event.arguments->resize(0);
}
int job_reap( int interactive )