parser.h
Go to the documentation of this file.
/* libmpdclient
(c) 2003-2015 The Music Player Daemon Project
This project's homepage is: http://www.musicpd.org
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef LIBMPDCLIENT_PARSER_H
#define LIBMPDCLIENT_PARSER_H
#include <mpd/protocol.h>
#include <mpd/compiler.h>
#include <stdbool.h>
enum mpd_parser_result {
MPD_PARSER_MALFORMED,
MPD_PARSER_SUCCESS,
MPD_PARSER_ERROR,
MPD_PARSER_PAIR,
};
struct mpd_parser;
#ifdef __cplusplus
extern "C" {
#endif
mpd_malloc
struct mpd_parser *
mpd_parser_new(void);
void
mpd_parser_free(struct mpd_parser *parser);
enum mpd_parser_result
mpd_parser_feed(struct mpd_parser *parser, char *line);
mpd_pure
bool
mpd_parser_is_discrete(const struct mpd_parser *parser);
mpd_pure
enum mpd_server_error
mpd_parser_get_server_error(const struct mpd_parser *parser);
mpd_pure
unsigned
mpd_parser_get_at(const struct mpd_parser *parser);
mpd_pure
const char *
mpd_parser_get_message(const struct mpd_parser *parser);
mpd_pure
const char *
mpd_parser_get_name(const struct mpd_parser *parser);
mpd_pure
const char *
mpd_parser_get_value(const struct mpd_parser *parser);
#ifdef __cplusplus
}
#endif
#endif
mpd_parser_get_message
mpd_pure const char * mpd_parser_get_message(const struct mpd_parser *parser)
MPD_PARSER_SUCCESS
Definition: parser.h:47
mpd_server_error
mpd_server_error
Definition: protocol.h:39
mpd_parser
mpd_parser_is_discrete
mpd_pure bool mpd_parser_is_discrete(const struct mpd_parser *parser)
mpd_parser_get_at
mpd_pure unsigned mpd_parser_get_at(const struct mpd_parser *parser)
mpd_parser_new
mpd_malloc struct mpd_parser * mpd_parser_new(void)
protocol.h
MPD client library.
mpd_parser_free
void mpd_parser_free(struct mpd_parser *parser)
compiler.h
Compiler specific definitions.
MPD_PARSER_ERROR
Definition: parser.h:53
MPD_PARSER_PAIR
Definition: parser.h:59
mpd_parser_get_server_error
mpd_pure enum mpd_server_error mpd_parser_get_server_error(const struct mpd_parser *parser)
mpd_parser_get_value
mpd_pure const char * mpd_parser_get_value(const struct mpd_parser *parser)
mpd_parser_get_name
mpd_pure const char * mpd_parser_get_name(const struct mpd_parser *parser)
mpd_parser_feed
enum mpd_parser_result mpd_parser_feed(struct mpd_parser *parser, char *line)
mpd_parser_result
mpd_parser_result
Definition: parser.h:37
MPD_PARSER_MALFORMED
Definition: parser.h:41