Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/hound/src/client.c

    rcf13b17 r33b8d024  
    7676        hound_sess_t *session;
    7777        /** context name, reported to the daemon */
    78         const char *name;
     78        char *name;
    7979        /** True if the instance is record context */
    8080        bool record;
     
    123123                        return NULL;
    124124                }
    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) {
    128129                        hound_service_disconnect(new_context->session);
    129130                        free(new_context->name);
     
    194195 * The function will return deice sinks or source based on the context type.
    195196 */
    196 int hound_context_get_available_targets(hound_context_t *hound,
    197     const char ***names, size_t *count)
     197errno_t hound_context_get_available_targets(hound_context_t *hound,
     198    char ***names, size_t *count)
    198199{
    199200        assert(hound);
     
    211212 * @return Error code.
    212213 */
    213 int hound_context_get_connected_targets(hound_context_t *hound,
    214     const char ***names, size_t *count)
     214errno_t hound_context_get_connected_targets(hound_context_t *hound,
     215    char ***names, size_t *count)
    215216{
    216217        assert(hound);
     
    231232 * connect to the first possible target if it is passed this value.
    232233 */
    233 int hound_context_connect_target(hound_context_t *hound, const char* target)
     234errno_t hound_context_connect_target(hound_context_t *hound, const char* target)
    234235{
    235236        assert(hound);
    236237        assert(target);
    237238
    238         const char **tgt = NULL;
     239        char **tgt = NULL;
    239240        size_t count = 1;
    240         int ret = EOK;
     241        errno_t ret = EOK;
    241242        if (str_cmp(target, HOUND_DEFAULT_TARGET) == 0) {
    242243                ret = hound_context_get_available_targets(hound, &tgt, &count);
     
    268269 * @return Error code.
    269270 */
    270 int hound_context_disconnect_target(hound_context_t *hound, const char* target)
     271errno_t hound_context_disconnect_target(hound_context_t *hound, const char* target)
    271272{
    272273        assert(hound);
     
    304305                new_stream->context = hound;
    305306                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,
    307308                    hound->id, flags, format, bsize);
    308309                if (ret != EOK) {
     
    342343 * @return error code.
    343344 */
    344 int hound_stream_write(hound_stream_t *stream, const void *data, size_t size)
     345errno_t hound_stream_write(hound_stream_t *stream, const void *data, size_t size)
    345346{
    346347        assert(stream);
     
    357358 * @return error code.
    358359 */
    359 int hound_stream_read(hound_stream_t *stream, void *data, size_t size)
     360errno_t hound_stream_read(hound_stream_t *stream, void *data, size_t size)
    360361{
    361362        assert(stream);
     
    370371 * @return Error code.
    371372 */
    372 int hound_stream_drain(hound_stream_t *stream)
     373errno_t hound_stream_drain(hound_stream_t *stream)
    373374{
    374375        assert(stream);
     
    401402 * @return error code.
    402403 */
    403 int hound_write_main_stream(hound_context_t *hound,
     404errno_t hound_write_main_stream(hound_context_t *hound,
    404405    const void *data, size_t size)
    405406{
     
    421422 * @return error code.
    422423 */
    423 int hound_read_main_stream(hound_context_t *hound, void *data, size_t size)
     424errno_t hound_read_main_stream(hound_context_t *hound, void *data, size_t size)
    424425{
    425426        assert(hound);
     
    441442 * NOT IMPLEMENTED
    442443 */
    443 int hound_write_replace_main_stream(hound_context_t *hound,
     444errno_t hound_write_replace_main_stream(hound_context_t *hound,
    444445    const void *data, size_t size)
    445446{
     
    459460 * NOT IMPLEMENTED
    460461 */
    461 int hound_context_set_main_stream_params(hound_context_t *hound,
     462errno_t hound_context_set_main_stream_params(hound_context_t *hound,
    462463    pcm_format_t format, size_t bsize)
    463464{
     
    478479 * to drain and destroys it before returning.
    479480 */
    480 int hound_write_immediate(hound_context_t *hound, pcm_format_t format,
     481errno_t hound_write_immediate(hound_context_t *hound, pcm_format_t format,
    481482    const void *data, size_t size)
    482483{
     
    487488        if (!tmpstream)
    488489                return ENOMEM;
    489         const int ret = hound_stream_write(tmpstream, data, size);
     490        const errno_t ret = hound_stream_write(tmpstream, data, size);
    490491        if (ret == EOK) {
    491492                //TODO drain?
Note: See TracChangeset for help on using the changeset viewer.