Logo Search packages:      
Sourcecode: libmpdclient version File versions  Download package

char* mpd_sync_recv_line ( struct mpd_async async,
const struct timeval *  tv 
)

Synchronous wrapper for mpd_async_recv_line().

Definition at line 178 of file sync.c.

References mpd_async_get_error(), mpd_async_recv_line(), and MPD_ERROR_SUCCESS.

{
      struct timeval tv, *tvp;
      char *line;

      if (tv0 != NULL) {
            tv = *tv0;
            tvp = &tv;
      } else
            tvp = NULL;

      while (true) {
            line = mpd_async_recv_line(async);
            if (line != NULL)
                  return line;

            if (mpd_async_get_error(async) != MPD_ERROR_SUCCESS ||
                !mpd_sync_io(async, tvp))
                  return NULL;
      }
}


Generated by  Doxygen 1.6.0   Back to index