Changeset 1315:177636363c47 in roaraudio
- Timestamp:
- 03/21/09 01:48:04 (15 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/fixed-api
r1206 r1315 1 1 roar_connect 2 roar_connect_fh 2 3 roar_disconnect 3 4 -
include/libroar/basic.h
r690 r1315 62 62 63 63 int roar_connect (struct roar_connection * con, char * server); 64 int roar_connect_fh (struct roar_connection * con, int fh); 64 65 int roar_disconnect (struct roar_connection * con); 65 66 -
include/roaraudio/error.h
r809 r1315 43 43 #define ROAR_ERROR_MSGSIZE 11 /* Message too long */ 44 44 #define ROAR_ERROR_NOMEM 12 /* Not enough space */ 45 #define ROAR_ERROR_INVAL 13 /* Invalid argument */ 45 46 46 47 #endif -
libroar/basic.c
r1099 r1315 153 153 154 154 int roar_connect (struct roar_connection * con, char * server) { 155 roar_errno = ROAR_ERROR_UNKNOWN; 156 con->fh = roar_connect_raw(server); 157 158 if ( con->fh == -1 ) 159 return -1; 155 int fh; 156 157 if ( con == NULL ) { 158 roar_errno = ROAR_ERROR_INVAL; 159 return -1; 160 } 161 162 roar_errno = ROAR_ERROR_UNKNOWN; 163 fh = roar_connect_raw(server); 164 165 if ( fh == -1 ) 166 return -1; 167 168 return roar_connect_fh(con, fh); 169 } 170 171 int roar_connect_fh (struct roar_connection * con, int fh) { 172 173 if ( con == NULL || fh == -1 ) { 174 roar_errno = ROAR_ERROR_INVAL; 175 return -1; 176 } 177 178 // specal hack to set an ilegal value used internaly in libroar: 179 if ( fh == -2 ) 180 fh = -1; 181 182 memset(con, 0, sizeof(struct roar_connection)); 183 184 con->fh = fh; 160 185 161 186 roar_errno = ROAR_ERROR_NONE; 162 163 187 return 0; 164 188 } -
libroar/file.c
r1196 r1315 273 273 274 274 if ( exec ) { 275 con->fh = -1; 275 // TODO: FIXME: this ma cause a memory leak in future 276 // OLD: con->fh = -1; 277 roar_connect_fh(con, -2); 276 278 } 277 279
Note: See TracChangeset
for help on using the changeset viewer.