blob: 9cf7854e1b16861c12bc811452b0cb2f47be88a4 (
plain)
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
|
#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[])
{
printf("Sorry, %s isn't implemented yet.\n", argv[0]);
return argc;
}
|