Changeset 3717:29a6203feedc in roaraudio
- Timestamp:
- 04/25/10 04:58:25 (14 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libroar/client.c
r3715 r3717 36 36 #include "libroar.h" 37 37 38 int roar_client_new (struct roar_client * client) { 39 int i; 40 41 if ( client == NULL ) 42 return -1; 43 44 memset(client, 0, sizeof(struct roar_client)); 45 46 client->fh = -1; 47 client->pid = -1; 48 client->uid = -1; 49 client->gid = -1; 50 client->proto = ROAR_PROTO_ROARAUDIO; 51 client->byteorder = ROAR_BYTEORDER_NETWORK; 52 53 for (i = 0; i < ROAR_CLIENTS_MAX_STREAMS_PER_CLIENT; i++) 54 client->streams[i] = -1; 55 56 return 0; 57 } 58 59 int roar_client_set_fh (struct roar_client * client, int fh) { 60 if ( client == NULL ) 61 return -1; 62 63 client->fh = fh; 64 65 return 0; 66 } 67 68 int roar_client_set_proto(struct roar_client * client, int proto, int byteorder) { 69 if ( client == NULL ) 70 return -1; 71 72 client->proto = proto; 73 74 if ( byteorder != -1 ) { 75 client->byteorder = byteorder; 76 } else { 77 switch (proto) { 78 case ROAR_PROTO_ROARAUDIO: 79 client->byteorder = ROAR_BYTEORDER_NETWORK; 80 break; 81 default: 82 return -1; 83 break; 84 } 85 } 86 87 return 0; 88 } 89 90 int roar_client_pass (struct roar_connection * con, struct roar_client * client); 91 38 92 //ll
Note: See TracChangeset
for help on using the changeset viewer.