diff options
Diffstat (limited to 'jobs.c')
-rw-r--r-- | jobs.c | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -1,5 +1,28 @@ #define _XOPEN_SOURCE 700 #include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include "jobcontrol.h" + +pid_t pidfrom(const char *s) +{ + if (*s == '%') { + if (!strcmp(s, "%%") || !strcmp(s, "%+")) { + /* return current_job; */ + } else if (!strcmp(s, "%-")) { + /* return previous_job; */ + } + + /* %digits => job # */ + /* %string => command begins with string */ + /* %?string => command contains string */ + + return -1; + } + + return atoi(s); +} int jobs_main(int argc, char *argv[]) { |