equal
deleted
inserted
replaced
|
1 /* |
|
2 stdin mix - a mixer/multiplexer for stdin to processes |
|
3 Copyright (C) 2007 Lluís Batlle i Rossell |
|
4 |
|
5 Please find the license in the provided COPYING file. |
|
6 */ |
1 #include <stdio.h> |
7 #include <stdio.h> |
2 #include <stdlib.h> |
8 #include <stdlib.h> |
3 #include <sys/types.h> |
9 #include <sys/types.h> |
4 #include <unistd.h> |
10 #include <unistd.h> |
5 #include <errno.h> |
11 #include <errno.h> |
6 |
12 |
7 #include "main.h" |
13 #include "main.h" |
|
14 |
|
15 static const char version[] = "0.9"; |
8 |
16 |
9 static int max(int a, int b) |
17 static int max(int a, int b) |
10 { |
18 { |
11 if (a > b) |
19 if (a > b) |
12 return a; |
20 return a; |
209 return 0; |
217 return 0; |
210 } |
218 } |
211 |
219 |
212 static int showhelp(const char *pname) |
220 static int showhelp(const char *pname) |
213 { |
221 { |
214 printf("sdtdin-mix - Copyright 2007 Lluís Batlle i Rossell\n"); |
222 printf("sdtdin-mix v%s - Copyright (C) 2007 Lluis Batlle i Rossell\n", |
|
223 version); |
215 printf("usage: %s [appcommand] [param1] [param2] ...\n", pname); |
224 printf("usage: %s [appcommand] [param1] [param2] ...\n", pname); |
216 printf(" If you give _appcommand_, it starts the application and\n"); |
225 printf(" If you give _appcommand_, it starts the application and\n"); |
217 printf(" a stdin server on $SM_SOCKET or /tmp/socket-sm.UID.\n"); |
226 printf(" a stdin server on $SM_SOCKET or /tmp/socket-sm.UID.\n"); |
218 printf(" If not given, it starts a stdin client for the same socket.\n"); |
227 printf(" If not given, it starts a stdin client for the same socket.\n"); |
219 return 0; |
228 return 0; |