mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-03 18:14:25 +03:00
6016620f42
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
54 lines
1.4 KiB
C
54 lines
1.4 KiB
C
/** \file background.h
|
|
* \brief Header: Background support
|
|
*/
|
|
|
|
#ifndef MC__BACKGROUND_H
|
|
#define MC__BACKGROUND_H
|
|
|
|
#ifdef WITH_BACKGROUND
|
|
|
|
#include <sys/types.h> /* pid_t */
|
|
|
|
/*** typedefs(not structures) and defined constants **********************************************/
|
|
|
|
enum TaskState
|
|
{
|
|
Task_Running,
|
|
Task_Stopped
|
|
};
|
|
|
|
typedef struct TaskList
|
|
{
|
|
int fd;
|
|
int to_child_fd;
|
|
pid_t pid;
|
|
int state;
|
|
char *info;
|
|
struct TaskList *next;
|
|
} TaskList;
|
|
|
|
struct FileOpContext;
|
|
|
|
/*** enums ***************************************************************************************/
|
|
|
|
/*** structures declarations (and typedefs of structures)*****************************************/
|
|
|
|
/*** global variables defined in .c file *********************************************************/
|
|
|
|
extern struct TaskList *task_list;
|
|
|
|
/*** declarations of public functions ************************************************************/
|
|
|
|
int do_background (struct FileOpContext *ctx, char *info);
|
|
int parent_call (void *routine, struct FileOpContext *ctx, int argc, ...);
|
|
char *parent_call_string (void *routine, int argc, ...);
|
|
|
|
void unregister_task_running (pid_t pid, int fd);
|
|
void unregister_task_with_pid (pid_t pid);
|
|
|
|
/*** inline functions ****************************************************************************/
|
|
|
|
#endif /* !WITH_BACKGROUND */
|
|
|
|
#endif /* MC__BACKGROUND_H */
|