Line | |
---|
1 | //roarsocktypes.c: |
---|
2 | |
---|
3 | #include <roaraudio.h> |
---|
4 | |
---|
5 | int main (void) { |
---|
6 | int i, fh; |
---|
7 | struct { |
---|
8 | char * name; |
---|
9 | int (*func)(void); |
---|
10 | } tests[] = { |
---|
11 | {"TCPv4" , roar_socket_new_tcp }, |
---|
12 | {"UDPv4" , roar_socket_new_udp }, |
---|
13 | {"TCPv6" , roar_socket_new_tcp6}, |
---|
14 | {"UDPv6" , roar_socket_new_udp6}, |
---|
15 | {"UNIX" , roar_socket_new_unix}, |
---|
16 | {"DECnet seqpacket", roar_socket_new_decnet_seqpacket}, |
---|
17 | {"DECnet stream" , roar_socket_new_decnet_stream}, |
---|
18 | {"IPX" , roar_socket_new_ipx}, |
---|
19 | {"IPX/SPX" , roar_socket_new_ipxspx}, |
---|
20 | {NULL, NULL} |
---|
21 | }; |
---|
22 | |
---|
23 | for (i = 0; tests[i].func; i++) { |
---|
24 | printf("Type %-16s ", tests[i].name); |
---|
25 | errno = 0; |
---|
26 | fh = tests[i].func(); |
---|
27 | if ( fh == -1 ) { |
---|
28 | printf("not working: %s\n", strerror(errno)); |
---|
29 | } else { |
---|
30 | close(fh); |
---|
31 | printf("working\n"); |
---|
32 | } |
---|
33 | } |
---|
34 | |
---|
35 | return 0; |
---|
36 | } |
---|
37 | |
---|
38 | //ll |
---|
Note: See
TracBrowser
for help on using the repository browser.