![]() |
YASH 0.1
CLI written in C
|
Job control functions for the YASH shell. More...
#include "yash.h"Go to the source code of this file.
Classes | |
| struct | Job |
| Represents a job. More... | |
Typedefs | |
| typedef struct Job | Job |
| Represents a job. | |
Enumerations | |
| enum | JobStatus { JOB_RUNNING , JOB_STOPPED , JOB_DONE } |
| Represents the status of a job. | |
Functions | |
| void | jobs_init (void) |
| Initialize the job table. | |
| int | jobs_add (pid_t pgid, const char *cmdline, int is_background) |
| Add a job to the job table. | |
| void | jobs_mark (pid_t pgid, JobStatus status) |
| Mark a job as running or stopped. | |
| void | jobs_print () |
| Print all jobs. | |
| int | jobs_pick_most_recent_for_fg (void) |
| Pick the most recent job for foreground. | |
| int | jobs_pick_most_recent_stopped_for_bg (void) |
| Pick the most recent stopped job for background. | |
| pid_t | jobs_get_pgid (int job_id) |
| Get the pgid of a job. | |
| void | jobs_reap_done_and_print (void) |
| Reap done jobs and print them. | |
| void | jobs_print_one (int job_id) |
| Print a single job. | |
| const char * | jobs_get_cmdline (int job_id) |
| Get the cmdline of a job. | |
| void | jobs_set_background (pid_t pgid, int is_bg) |
| Set the background of a job. | |
Job control functions for the YASH shell.
This header file contains the job control functions for the YASH shell.
| int jobs_add | ( | pid_t | pgid, |
| const char * | cmdline, | ||
| int | is_background ) |
Add a job to the job table.
| pgid | |
| cmdline | |
| is_background |
| const char * jobs_get_cmdline | ( | int | job_id | ) |
Get the cmdline of a job.
| job_id |
| pid_t jobs_get_pgid | ( | int | job_id | ) |
Get the pgid of a job.
| job_id |
| void jobs_mark | ( | pid_t | pgid, |
| JobStatus | status ) |
Mark a job as running or stopped.
| pgid | |
| status |
| int jobs_pick_most_recent_for_fg | ( | void | ) |
Pick the most recent job for foreground.
| int jobs_pick_most_recent_stopped_for_bg | ( | void | ) |
Pick the most recent stopped job for background.
| void jobs_print_one | ( | int | job_id | ) |
Print a single job.
| job_id |
| void jobs_set_background | ( | pid_t | pgid, |
| int | is_bg ) |
Set the background of a job.
| pgid | |
| is_bg |