~emersion/mrsh

ref: 537899b8a63adf88d442790b4cf6a38edd9288d9 mrsh/include/shell/task.h -rw-r--r-- 977 bytes
537899b8Simon Ser shell/arithm: strip mrsh_ prefix for static functions 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef SHELL_TASK_H
#define SHELL_TASK_H

#include "shell/shell.h"
#include "shell/word.h"

/**
 * The task is waiting for child processes to finish.
 */
#define TASK_STATUS_WAIT -1
/**
 * A fatal error occured, the task should be destroyed.
 */
#define TASK_STATUS_ERROR -2
/**
 * The task has been stopped and the job has been put in the background.
 */
#define TASK_STATUS_STOPPED -3
/**
 * The task has been interrupted for some reason.
 */
#define TASK_STATUS_INTERRUPTED -4

struct context;

int run_word(struct context *ctx, struct mrsh_word **word_ptr,
	enum tilde_expansion tilde_expansion);
int run_simple_command(struct context *ctx, struct mrsh_simple_command *sc);
int run_command(struct context *ctx, struct mrsh_command *cmd);
int run_and_or_list(struct context *ctx, struct mrsh_and_or_list *and_or_list);
int run_pipeline(struct context *ctx, struct mrsh_pipeline *pipeline);
int run_command_list_array(struct context *ctx, struct mrsh_array *array);

#endif