Back to index

lightdm  1.3.2
process.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2010-2011 Robert Ancell.
00003  * Author: Robert Ancell <robert.ancell@canonical.com>
00004  * 
00005  * This program is free software: you can redistribute it and/or modify it under
00006  * the terms of the GNU General Public License as published by the Free Software
00007  * Foundation, either version 3 of the License, or (at your option) any later
00008  * version. See http://www.gnu.org/copyleft/gpl.html the full text of the
00009  * license.
00010  */
00011 
00012 #ifndef _PROCESS_H_
00013 #define _PROCESS_H_
00014 
00015 #include <glib-object.h>
00016 
00017 G_BEGIN_DECLS
00018 
00019 #define PROCESS_TYPE (process_get_type())
00020 #define PROCESS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROCESS_TYPE, ProcessClass))
00021 #define PROCESS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROCESS_TYPE, Process))
00022 #define PROCESS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROCESS_TYPE, ProcessClass))
00023 
00024 typedef struct ProcessPrivate ProcessPrivate;
00025 
00026 typedef struct
00027 {
00028     GObject              parent_instance;
00029     ProcessPrivate *priv;
00030 } Process;
00031 
00032 typedef struct
00033 {
00034     GObjectClass parent_class;
00035     void (*run)(Process *process);
00036     void (*got_data)(Process *process);
00037     void (*got_signal)(Process *process, int signum);
00038     void (*stopped)(Process *process);
00039 } ProcessClass;
00040 
00041 GType process_get_type (void);
00042 
00043 Process *process_get_current (void);
00044 
00045 Process *process_new (void);
00046 
00047 void process_set_clear_environment (Process *process, gboolean clear_environment);
00048 
00049 gboolean process_get_clear_environment (Process *process);
00050 
00051 void process_set_env (Process *process, const gchar *name, const gchar *value);
00052 
00053 const gchar *process_get_env (Process *process, const gchar *name);
00054 
00055 void process_set_command (Process *process, const gchar *command);
00056 
00057 const gchar *process_get_command (Process *process);
00058 
00059 gboolean process_start (Process *process);
00060 
00061 gboolean process_get_is_running (Process *process);
00062 
00063 GPid process_get_pid (Process *process);
00064 
00065 void process_signal (Process *process, int signum);
00066 
00067 void process_stop (Process *process);
00068 
00069 void process_wait (Process *process);
00070 
00071 int process_get_exit_status (Process *process);
00072 
00073 G_END_DECLS
00074 
00075 #endif /* _PROCESS_H_ */