4.115
Last change
on this file since 9b4422a2 was
9b4422a2,
checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/12 at 15:09:24
|
Remove All CVS Id Strings Possible Using a Script
Script does what is expected and tries to do it as
smartly as possible.
+ remove occurrences of two blank comment lines
next to each other after Id string line removed.
+ remove entire comment blocks which only exited to
contain CVS Ids
+ If the processing left a blank line at the top of
a file, it was removed.
|
-
Property mode set to
100644
|
File size:
935 bytes
|
Line | |
---|
1 | #ifdef HAVE_CONFIG_H |
---|
2 | #include "config.h" |
---|
3 | #endif |
---|
4 | |
---|
5 | #include <netdb.h> |
---|
6 | #include <string.h> |
---|
7 | #include <sys/types.h> |
---|
8 | #include <sys/socket.h> |
---|
9 | #include <netinet/in.h> |
---|
10 | |
---|
11 | static const struct protoent prototab[] = { |
---|
12 | { "ip", NULL, IPPROTO_IP }, |
---|
13 | { "icmp", NULL, IPPROTO_ICMP }, |
---|
14 | { "tcp", NULL, IPPROTO_TCP }, |
---|
15 | { "udp", NULL, IPPROTO_UDP }, |
---|
16 | }; |
---|
17 | |
---|
18 | /* |
---|
19 | * Dummy version of BSD getprotobyname() |
---|
20 | */ |
---|
21 | struct protoent * |
---|
22 | getprotobyname_static (const char *name) |
---|
23 | { |
---|
24 | int i; |
---|
25 | |
---|
26 | for (i = 0 ; i < (sizeof prototab / sizeof prototab[0]) ; i++) { |
---|
27 | if (strcmp (name, prototab[i].p_name) == 0) |
---|
28 | return (struct protoent *) &prototab[i]; |
---|
29 | } |
---|
30 | return NULL; |
---|
31 | } |
---|
32 | |
---|
33 | /* |
---|
34 | * Dummy version of BSD getprotobynumber() |
---|
35 | */ |
---|
36 | struct protoent * |
---|
37 | getprotobynumber_static (int proto) |
---|
38 | { |
---|
39 | int i; |
---|
40 | |
---|
41 | for (i = 0 ; i < (sizeof prototab / sizeof prototab[0]) ; i++) { |
---|
42 | if (proto == prototab[i].p_proto) |
---|
43 | return (struct protoent *) &prototab[i]; |
---|
44 | } |
---|
45 | return NULL; |
---|
46 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.