Changes in uspace/lib/hound/src/client.c [cf13b17:33b8d024] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/hound/src/client.c
rcf13b17 r33b8d024 76 76 hound_sess_t *session; 77 77 /** context name, reported to the daemon */ 78 c onst char *name;78 char *name; 79 79 /** True if the instance is record context */ 80 80 bool record; … … 123 123 return NULL; 124 124 } 125 new_context->id = hound_service_register_context( 126 new_context->session, new_context->name, record); 127 if (hound_context_id_err(new_context->id) != EOK) { 125 errno_t rc = hound_service_register_context( 126 new_context->session, new_context->name, record, 127 &new_context->id); 128 if (rc != EOK) { 128 129 hound_service_disconnect(new_context->session); 129 130 free(new_context->name); … … 194 195 * The function will return deice sinks or source based on the context type. 195 196 */ 196 int hound_context_get_available_targets(hound_context_t *hound,197 c onst char ***names, size_t *count)197 errno_t hound_context_get_available_targets(hound_context_t *hound, 198 char ***names, size_t *count) 198 199 { 199 200 assert(hound); … … 211 212 * @return Error code. 212 213 */ 213 int hound_context_get_connected_targets(hound_context_t *hound,214 c onst char ***names, size_t *count)214 errno_t hound_context_get_connected_targets(hound_context_t *hound, 215 char ***names, size_t *count) 215 216 { 216 217 assert(hound); … … 231 232 * connect to the first possible target if it is passed this value. 232 233 */ 233 int hound_context_connect_target(hound_context_t *hound, const char* target)234 errno_t hound_context_connect_target(hound_context_t *hound, const char* target) 234 235 { 235 236 assert(hound); 236 237 assert(target); 237 238 238 c onst char **tgt = NULL;239 char **tgt = NULL; 239 240 size_t count = 1; 240 int ret = EOK;241 errno_t ret = EOK; 241 242 if (str_cmp(target, HOUND_DEFAULT_TARGET) == 0) { 242 243 ret = hound_context_get_available_targets(hound, &tgt, &count); … … 268 269 * @return Error code. 269 270 */ 270 int hound_context_disconnect_target(hound_context_t *hound, const char* target)271 errno_t hound_context_disconnect_target(hound_context_t *hound, const char* target) 271 272 { 272 273 assert(hound); … … 304 305 new_stream->context = hound; 305 306 new_stream->flags = flags; 306 const int ret = hound_service_stream_enter(new_stream->exch,307 const errno_t ret = hound_service_stream_enter(new_stream->exch, 307 308 hound->id, flags, format, bsize); 308 309 if (ret != EOK) { … … 342 343 * @return error code. 343 344 */ 344 int hound_stream_write(hound_stream_t *stream, const void *data, size_t size)345 errno_t hound_stream_write(hound_stream_t *stream, const void *data, size_t size) 345 346 { 346 347 assert(stream); … … 357 358 * @return error code. 358 359 */ 359 int hound_stream_read(hound_stream_t *stream, void *data, size_t size)360 errno_t hound_stream_read(hound_stream_t *stream, void *data, size_t size) 360 361 { 361 362 assert(stream); … … 370 371 * @return Error code. 371 372 */ 372 int hound_stream_drain(hound_stream_t *stream)373 errno_t hound_stream_drain(hound_stream_t *stream) 373 374 { 374 375 assert(stream); … … 401 402 * @return error code. 402 403 */ 403 int hound_write_main_stream(hound_context_t *hound,404 errno_t hound_write_main_stream(hound_context_t *hound, 404 405 const void *data, size_t size) 405 406 { … … 421 422 * @return error code. 422 423 */ 423 int hound_read_main_stream(hound_context_t *hound, void *data, size_t size)424 errno_t hound_read_main_stream(hound_context_t *hound, void *data, size_t size) 424 425 { 425 426 assert(hound); … … 441 442 * NOT IMPLEMENTED 442 443 */ 443 int hound_write_replace_main_stream(hound_context_t *hound,444 errno_t hound_write_replace_main_stream(hound_context_t *hound, 444 445 const void *data, size_t size) 445 446 { … … 459 460 * NOT IMPLEMENTED 460 461 */ 461 int hound_context_set_main_stream_params(hound_context_t *hound,462 errno_t hound_context_set_main_stream_params(hound_context_t *hound, 462 463 pcm_format_t format, size_t bsize) 463 464 { … … 478 479 * to drain and destroys it before returning. 479 480 */ 480 int hound_write_immediate(hound_context_t *hound, pcm_format_t format,481 errno_t hound_write_immediate(hound_context_t *hound, pcm_format_t format, 481 482 const void *data, size_t size) 482 483 { … … 487 488 if (!tmpstream) 488 489 return ENOMEM; 489 const int ret = hound_stream_write(tmpstream, data, size);490 const errno_t ret = hound_stream_write(tmpstream, data, size); 490 491 if (ret == EOK) { 491 492 //TODO drain?
Note:
See TracChangeset
for help on using the changeset viewer.