… | |
… | |
36 | { |
36 | { |
37 | client c; |
37 | client c; |
38 | char buf[PATH_MAX]; |
38 | char buf[PATH_MAX]; |
39 | |
39 | |
40 | c.send ("NEW"); |
40 | c.send ("NEW"); |
41 | c.send ("DISPLAY"); c.send (getenv ("DISPLAY")); |
41 | c.send ("DISPLAY"), c.send (getenv ("DISPLAY")); |
42 | // instead of getcwd we could opendir(".") and pass the fd for fchdir *g* |
42 | // instead of getcwd we could opendir(".") and pass the fd for fchdir *g* |
43 | c.send ("CWD"); c.send (getcwd (buf, sizeof (buf))); |
43 | c.send ("CWD"), c.send (getcwd (buf, sizeof (buf))); |
44 | |
44 | |
45 | c.send ("ARGV"); c.send (argc); |
|
|
46 | for (int i = 0; i < argc; i++) |
45 | for (int i = 0; i < argc; i++) |
47 | c.send (argv[i]); |
46 | c.send ("ARG"), c.send (argv[i]); |
|
|
47 | |
48 | c.send ("END"); |
48 | c.send ("END"); |
49 | } |
49 | } |
50 | |
50 | |