makefiles: Add common rules for installing the main man page.
[wine/wine-gecko.git] / programs / ping / ping_main.c
blob037fa4d62987768e7402ff4ac393b12bcc9582b5
1 /*
2 * ping stub
3 * Copyright (C) 2010 Trey Hunner
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #include <unistd.h>
21 #include <stdio.h>
22 #include <windows.h>
24 #include "wine/debug.h"
26 WINE_DEFAULT_DEBUG_CHANNEL(ping);
28 static void usage(void)
30 printf("Usage: ping [-n count] [-w timeout] target_name\n\n"
31 "Options:\n"
32 " -n Number of echo requests to send.\n"
33 " -w Timeout in milliseconds to wait for each reply.\n");
36 int main(int argc, char** argv)
38 unsigned int n = 0;
39 int optc;
41 WINE_FIXME( "this command currently just sleeps based on -n parameter\n" );
43 while ((optc = getopt( argc, argv, "n:w:tal:fi:v:r:s:j:k:" )) != -1)
45 switch(optc)
47 case 'n':
48 n = atoi(optarg);
49 if (n == 0)
51 printf("Bad value for option -n, valid range is from 1 to 4294967295.\n");
52 exit(1);
54 break;
55 case '?':
56 usage();
57 exit(1);
58 default:
59 usage();
60 WINE_FIXME( "this command currently only supports the -n parameter\n" );
61 exit(1);
65 if (n != 0)
66 Sleep((n - 1) * 1000);
68 return 0;