2009-02-05 21:28:18 +03:00
|
|
|
/** \file background.h
|
|
|
|
* \brief Header: Background support
|
|
|
|
*/
|
|
|
|
|
2010-11-09 14:02:28 +03:00
|
|
|
#ifndef MC__BACKGROUND_H
|
|
|
|
#define MC__BACKGROUND_H
|
1998-02-27 07:54:42 +03:00
|
|
|
|
2010-11-09 14:02:28 +03:00
|
|
|
#include <sys/types.h> /* pid_t */
|
|
|
|
|
|
|
|
/*** typedefs(not structures) and defined constants **********************************************/
|
2009-03-07 15:23:15 +03:00
|
|
|
|
2010-11-09 14:02:28 +03:00
|
|
|
enum TaskState
|
|
|
|
{
|
1998-02-27 07:54:42 +03:00
|
|
|
Task_Running,
|
|
|
|
Task_Stopped
|
|
|
|
};
|
|
|
|
|
2010-11-09 14:02:28 +03:00
|
|
|
typedef struct TaskList
|
|
|
|
{
|
2003-10-26 03:58:14 +03:00
|
|
|
int fd;
|
2009-10-20 01:30:55 +04:00
|
|
|
int to_child_fd;
|
1998-02-27 07:54:42 +03:00
|
|
|
pid_t pid;
|
2003-10-26 03:58:14 +03:00
|
|
|
int state;
|
|
|
|
char *info;
|
1998-02-27 07:54:42 +03:00
|
|
|
struct TaskList *next;
|
|
|
|
} TaskList;
|
|
|
|
|
2010-11-09 14:02:28 +03:00
|
|
|
struct FileOpContext;
|
|
|
|
|
|
|
|
/*** enums ***************************************************************************************/
|
|
|
|
|
|
|
|
/*** structures declarations (and typedefs of structures)*****************************************/
|
|
|
|
|
|
|
|
/*** global variables defined in .c file *********************************************************/
|
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
extern struct TaskList *task_list;
|
|
|
|
|
2010-11-09 14:02:28 +03:00
|
|
|
/*** declarations of public functions ************************************************************/
|
|
|
|
|
2003-10-24 22:28:32 +04:00
|
|
|
int do_background (struct FileOpContext *ctx, char *info);
|
|
|
|
int parent_call (void *routine, struct FileOpContext *ctx, int argc, ...);
|
2003-10-26 01:54:55 +04:00
|
|
|
char *parent_call_string (void *routine, int argc, ...);
|
1998-02-27 07:54:42 +03:00
|
|
|
|
2003-10-26 08:42:29 +03:00
|
|
|
void unregister_task_running (pid_t pid, int fd);
|
2009-10-24 16:47:16 +04:00
|
|
|
void unregister_task_with_pid (pid_t pid);
|
1998-02-27 07:54:42 +03:00
|
|
|
|
2011-02-18 15:50:30 +03:00
|
|
|
gboolean background_parent_call (const gchar * event_group_name, const gchar * event_name,
|
|
|
|
gpointer init_data, gpointer data);
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
background_parent_call_string (const gchar * event_group_name, const gchar * event_name,
|
|
|
|
gpointer init_data, gpointer data);
|
|
|
|
|
2010-11-09 14:02:28 +03:00
|
|
|
/*** inline functions ****************************************************************************/
|
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
#endif /* MC__BACKGROUND_H */
|