Rev | Line | |
---|
[510] | 1 | //roarsocktypes.c: |
---|
| 2 | |
---|
| 3 | #include <roaraudio.h> |
---|
| 4 | |
---|
| 5 | int main (void) { |
---|
[511] | 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}, |
---|
[530] | 18 | {"IPX" , roar_socket_new_ipx}, |
---|
[527] | 19 | {"IPX/SPX" , roar_socket_new_ipxspx}, |
---|
[511] | 20 | {NULL, NULL} |
---|
| 21 | }; |
---|
| 22 | |
---|
| 23 | for (i = 0; tests[i].func; i++) { |
---|
| 24 | printf("Type %-16s ", tests[i].name); |
---|
[527] | 25 | errno = 0; |
---|
[511] | 26 | fh = tests[i].func(); |
---|
| 27 | if ( fh == -1 ) { |
---|
[527] | 28 | printf("not working: %s\n", strerror(errno)); |
---|
[511] | 29 | } else { |
---|
| 30 | close(fh); |
---|
| 31 | printf("working\n"); |
---|
| 32 | } |
---|
| 33 | } |
---|
| 34 | |
---|
[510] | 35 | return 0; |
---|
| 36 | } |
---|
| 37 | |
---|
| 38 | //ll |
---|
Note: See
TracBrowser
for help on using the repository browser.