Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/hound/include/hound/protocol.h

    r876f5561 r33b8d024  
    5858typedef intptr_t hound_context_id_t;
    5959
    60 /**
    61  * Check context id for errors.
    62  * @param id Context id
    63  * @return Error code.
    64  */
    65 static inline int hound_context_id_err(hound_context_id_t id)
    66 {
    67         return id > 0 ? EOK : (id == 0 ? ENOENT : id);
    68 }
    69 
    7060hound_sess_t *hound_service_connect(const char *service);
    7161void hound_service_disconnect(hound_sess_t *sess);
    7262
    73 hound_context_id_t hound_service_register_context(hound_sess_t *sess,
    74     const char *name, bool record);
    75 int hound_service_unregister_context(hound_sess_t *sess, hound_context_id_t id);
     63errno_t hound_service_register_context(hound_sess_t *sess,
     64    const char *name, bool record, hound_context_id_t *id);
     65errno_t hound_service_unregister_context(hound_sess_t *sess, hound_context_id_t id);
    7666
    77 int hound_service_get_list(hound_sess_t *sess, const char ***ids, size_t *count,
     67errno_t hound_service_get_list(hound_sess_t *sess, char ***ids, size_t *count,
    7868    int flags, const char *connection);
    7969
     
    8676 * @return Error code.
    8777 */
    88 static inline int hound_service_get_list_all(hound_sess_t *sess,
    89     const char ***ids, size_t *count, int flags)
     78static inline errno_t hound_service_get_list_all(hound_sess_t *sess,
     79    char ***ids, size_t *count, int flags)
    9080{
    9181        return hound_service_get_list(sess, ids, count, flags, NULL);
    9282}
    9383
    94 int hound_service_connect_source_sink(hound_sess_t *sess, const char *source,
     84errno_t hound_service_connect_source_sink(hound_sess_t *sess, const char *source,
    9585    const char *sink);
    96 int hound_service_disconnect_source_sink(hound_sess_t *sess, const char *source,
     86errno_t hound_service_disconnect_source_sink(hound_sess_t *sess, const char *source,
    9787    const char *sink);
    9888
    99 int hound_service_stream_enter(async_exch_t *exch, hound_context_id_t id,
     89errno_t hound_service_stream_enter(async_exch_t *exch, hound_context_id_t id,
    10090    int flags, pcm_format_t format, size_t bsize);
    101 int hound_service_stream_drain(async_exch_t *exch);
    102 int hound_service_stream_exit(async_exch_t *exch);
     91errno_t hound_service_stream_drain(async_exch_t *exch);
     92errno_t hound_service_stream_exit(async_exch_t *exch);
    10393
    104 int hound_service_stream_write(async_exch_t *exch, const void *data, size_t size);
    105 int hound_service_stream_read(async_exch_t *exch, void *data, size_t size);
     94errno_t hound_service_stream_write(async_exch_t *exch, const void *data, size_t size);
     95errno_t hound_service_stream_read(async_exch_t *exch, void *data, size_t size);
    10696
    10797/* Server */
     
    110100typedef struct hound_server_iface {
    111101        /** Create new context */
    112         int (*add_context)(void *, hound_context_id_t *, const char *, bool);
     102        errno_t (*add_context)(void *, hound_context_id_t *, const char *, bool);
    113103        /** Destroy existing context */
    114         int (*rem_context)(void *, hound_context_id_t);
     104        errno_t (*rem_context)(void *, hound_context_id_t);
    115105        /** Query context direction */
    116106        bool (*is_record_context)(void *, hound_context_id_t);
    117107        /** Get string identifiers of specified objects */
    118         int (*get_list)(void *, const char ***, size_t *, const char *, int);
     108        errno_t (*get_list)(void *, char ***, size_t *, const char *, int);
    119109        /** Create connection between source and sink */
    120         int (*connect)(void *, const char *, const char *);
     110        errno_t (*connect)(void *, const char *, const char *);
    121111        /** Destroy connection between source and sink */
    122         int (*disconnect)(void *, const char *, const char *);
     112        errno_t (*disconnect)(void *, const char *, const char *);
    123113        /** Create new stream tied to the context */
    124         int (*add_stream)(void *, hound_context_id_t, int, pcm_format_t, size_t,
     114        errno_t (*add_stream)(void *, hound_context_id_t, int, pcm_format_t, size_t,
    125115            void **);
    126116        /** Destroy existing stream */
    127         int (*rem_stream)(void *, void *);
     117        errno_t (*rem_stream)(void *, void *);
    128118        /** Block until the stream buffer is empty */
    129         int (*drain_stream)(void *);
     119        errno_t (*drain_stream)(void *);
    130120        /** Write new data to the stream */
    131         int (*stream_data_write)(void *, const void *, size_t);
     121        errno_t (*stream_data_write)(void *, const void *, size_t);
    132122        /** Read data from the stream */
    133         int (*stream_data_read)(void *, void *, size_t);
     123        errno_t (*stream_data_read)(void *, void *, size_t);
    134124        void *server;
    135125} hound_server_iface_t;
Note: See TracChangeset for help on using the changeset viewer.