summaryrefslogtreecommitdiff
path: root/jobs.c
diff options
context:
space:
mode:
Diffstat (limited to 'jobs.c')
-rw-r--r--jobs.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/jobs.c b/jobs.c
index 5fe1c6e..9cf7854 100644
--- a/jobs.c
+++ b/jobs.c
@@ -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[])
{