Changeset 5231:8b30ddb689b8 in roaraudio
- Timestamp:
- 11/12/11 14:31:25 (12 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
include/libroar/basic.h
r5230 r5231 48 48 49 49 #define ROAR_CON_FLAGS_NONE 0x00 50 #define ROAR_CON_FLAGS_FH 0x01 51 #define ROAR_CON_FLAGS_VIO 0x02 50 #define ROAR_CON_FLAGS_FH 0x01 /* obsoleted */ 51 #define ROAR_CON_FLAGS_VIO 0x02 /* mandatory */ 52 52 #define ROAR_CON_FLAGS_ISCLIENT 0x04 53 #define ROAR_CON_FLAGS_SUPPORT_V2 0x08 53 #define ROAR_CON_FLAGS_SUPPORT_V2 0x08 /* mandatory if con.version == 2 */ 54 #define ROAR_CON_FLAGS_SUPPORT_EF 0x10 /* Both peers support error frames */ 54 55 55 56 struct roar_message { … … 67 68 68 69 struct roar_connection { 69 int __fh; 70 int32_t flags; 70 size_t refc; 71 uint32_t flags; 72 int version; 71 73 struct roar_vio_calls viocon; 72 struct roar_ buffer * msgqueue;73 void * userdata;74 void (*cb)(struct roar_connection * con, struct roar_message * mes, void * userdata);74 struct roar_error_frame errorframe; 75 void * cb_userdata; 76 void (*cb)(struct roar_connection * con, struct roar_message * mes, void * data, void * userdata); 75 77 }; 76 78 … … 83 85 int roar_connect_fh (struct roar_connection * con, int fh); 84 86 int roar_get_connection_fh (struct roar_connection * con); 85 int roar_get_connection_vio (struct roar_connection * con, struct roar_vio_calls * vio) _LIBROAR_ATTR_DEPRECATED;86 87 struct roar_vio_calls * roar_get_connection_vio2 (struct roar_connection * con); 87 88 int roar_disconnect (struct roar_connection * con); … … 90 91 void (*cb)(struct roar_connection * con, 91 92 struct roar_message * mes, 93 void * data, 92 94 void * userdata), 93 95 void * userdata); -
libroar/basic.c
r5228 r5231 286 286 memset(con, 0, sizeof(struct roar_connection)); 287 287 288 con->flags = ROAR_CON_FLAGS_FH; 289 con->__fh = fh; 290 291 if ( roar_vio_open_fh_socket(&(con->viocon), fh) != -1 ) 288 if ( roar_vio_open_fh_socket(&(con->viocon), fh) != -1 ) { 292 289 con->flags |= ROAR_CON_FLAGS_VIO; 290 } 293 291 294 292 roar_err_set(ROAR_ERROR_NONE); … … 297 295 298 296 int roar_get_connection_fh (struct roar_connection * con) { 297 int fh; 298 299 ROAR_DBG("roar_get_connection_fh(con=%p) = ?", con); 300 299 301 roar_debug_warn_sysio("roar_get_connection_fh", "roar_get_connection_vio2", NULL); 300 302 … … 302 304 return -1; 303 305 304 if ( !(con->flags & ROAR_CON_FLAGS_FH) ) 305 return -1; 306 307 return con->__fh; 308 } 309 310 int roar_get_connection_vio (struct roar_connection * con, struct roar_vio_calls * vio) { 311 roar_debug_warn_obsolete("roar_get_connection_vio", "roar_get_connection_vio2", NULL); 312 313 if ( con == NULL || vio == NULL ) 314 return -1; 315 316 if ( !(con->flags & ROAR_CON_FLAGS_FH) ) 317 return -1; 318 319 return roar_vio_open_fh_socket(vio, con->__fh); 306 ROAR_DBG("roar_get_connection_fh(con=%p) = ?", con); 307 308 if ( roar_vio_ctl(&(con->viocon), ROAR_VIO_CTL_GET_FH, &fh) == -1 ) 309 return -1; 310 311 ROAR_DBG("roar_get_connection_fh(con=%p) = %i", con, fh); 312 313 return fh; 320 314 } 321 315 … … 359 353 void (*cb)(struct roar_connection * con, 360 354 struct roar_message * mes, 355 void * data, 361 356 void * userdata), 362 357 void * userdata) { … … 365 360 366 361 con->cb = cb; 367 con-> userdata = userdata;362 con->cb_userdata = userdata; 368 363 369 364 return 0;
Note: See TracChangeset
for help on using the changeset viewer.