1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
|
// SPDX-License-Identifier: BSD-3-Clause
// Copyright The Music Player Daemon Project
/*! \file
* \brief MPD client library
*
* Do not include this header directly. Use mpd/client.h instead.
*/
#ifndef MPD_READPICTURE_H
#define MPD_READPICTURE_H
#include "compiler.h"
#include <stdbool.h>
#include <stddef.h>
struct mpd_connection;
#ifdef __cplusplus
extern "C" {
#endif
/**
* Sends the "readpicture" command to MPD. Call mpd_recv_readpicture() to
* read response lines.
*
* @param connection a valid and connected #mpd_connection
* @param uri the URI of the song
* @param offset to read from
* @return true on success
*
* @since libmpdclient 2.20, MPD 0.22
*/
bool
mpd_send_readpicture(struct mpd_connection *connection, const char *uri, unsigned offset);
/**
* Receives the "readpicture" response
*
* @param connection a valid and connected #mpd_connection
* @param buffer an already allocated buffer, the size must be the same or greater than
* the binary chunk size (default 8192, can be set with binarylimit command)
* @param buffer_size the size of the allocated buffer
* @return read size on success, -1 on failure
*
* @since libmpdclient 2.20, MPD 0.22
*/
int
mpd_recv_readpicture(struct mpd_connection *connection, void *buffer, size_t buffer_size);
/**
* Shortcut for mpd_send_readpicture(), mpd_recv_readpicture() and
* mpd_response_finish().
*
* @param connection a valid and connected #mpd_connection
* @param uri the URI of the song
* @param offset to read from
* @param buffer an already allocated buffer, the size must be the same or greater than
* the binary chunk size (default 8192, can be set with binarylimit command)
* @param buffer_size the size of the allocated buffer
* @return read size on success, -1 on failure
*
* @since libmpdclient 2.20, MPD 0.22
*/
int
mpd_run_readpicture(struct mpd_connection *connection,
const char *uri, unsigned offset,
void *buffer, size_t buffer_size);
#ifdef __cplusplus
}
#endif
#endif
|