DatabaseVisitor, ...: use GError forward declaration

This commit is contained in:
Max Kellermann 2012-08-02 18:20:46 +02:00
parent b25b7693ba
commit edf811fa02
31 changed files with 72 additions and 29 deletions

View File

@ -87,6 +87,7 @@ mpd_headers = \
src/encoder_api.h \ src/encoder_api.h \
src/exclude.h \ src/exclude.h \
src/fd_util.h \ src/fd_util.h \
src/gerror.h \
src/glib_compat.h \ src/glib_compat.h \
src/update.h \ src/update.h \
src/inotify_source.h \ src/inotify_source.h \

View File

@ -20,9 +20,9 @@
#ifndef MPD_DATABASE_VISITOR_HXX #ifndef MPD_DATABASE_VISITOR_HXX
#define MPD_DATABASE_VISITOR_HXX #define MPD_DATABASE_VISITOR_HXX
#include <functional> #include "gerror.h"
#include <glib.h> #include <functional>
struct directory; struct directory;
struct song; struct song;

View File

@ -25,7 +25,7 @@
#ifndef AUDIO_PARSER_H #ifndef AUDIO_PARSER_H
#define AUDIO_PARSER_H #define AUDIO_PARSER_H
#include <glib.h> #include "gerror.h"
#include <stdbool.h> #include <stdbool.h>

View File

@ -21,8 +21,8 @@
#define MPD_DB_UTILS_H #define MPD_DB_UTILS_H
#include "gcc.h" #include "gcc.h"
#include "gerror.h"
#include <glib.h>
#include <stdbool.h> #include <stdbool.h>
struct locate_item_list; struct locate_item_list;

View File

@ -21,8 +21,8 @@
#define MPD_DB_PRINT_H #define MPD_DB_PRINT_H
#include "gcc.h" #include "gcc.h"
#include "gerror.h"
#include <glib.h>
#include <stdbool.h> #include <stdbool.h>
struct client; struct client;

View File

@ -20,7 +20,8 @@
#ifndef MPD_DB_SAVE_H #ifndef MPD_DB_SAVE_H
#define MPD_DB_SAVE_H #define MPD_DB_SAVE_H
#include <glib.h> #include "gerror.h"
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>

View File

@ -23,6 +23,7 @@
#include "gcc.h" #include "gcc.h"
#include <assert.h> #include <assert.h>
#include <stddef.h>
struct directory; struct directory;
struct song; struct song;

View File

@ -20,7 +20,7 @@
#ifndef MPD_ENCODER_PLUGIN_H #ifndef MPD_ENCODER_PLUGIN_H
#define MPD_ENCODER_PLUGIN_H #define MPD_ENCODER_PLUGIN_H
#include <glib.h> #include "gerror.h"
#include <assert.h> #include <assert.h>
#include <stdbool.h> #include <stdbool.h>

View File

@ -20,8 +20,6 @@
#ifndef EVENT_PIPE_H #ifndef EVENT_PIPE_H
#define EVENT_PIPE_H #define EVENT_PIPE_H
#include <glib.h>
enum pipe_event { enum pipe_event {
/** database update was finished */ /** database update was finished */
PIPE_EVENT_UPDATE, PIPE_EVENT_UPDATE,

View File

@ -29,6 +29,7 @@
#include "filter_internal.h" #include "filter_internal.h"
#include "filter_registry.h" #include "filter_registry.h"
#include <glib.h>
#include <assert.h> #include <assert.h>
struct null_filter { struct null_filter {

View File

@ -26,7 +26,7 @@
#ifndef MPD_FILTER_PLUGIN_H #ifndef MPD_FILTER_PLUGIN_H
#define MPD_FILTER_PLUGIN_H #define MPD_FILTER_PLUGIN_H
#include <glib.h> #include "gerror.h"
#include <stdbool.h> #include <stdbool.h>
#include <stddef.h> #include <stddef.h>

25
src/gerror.h Normal file
View File

@ -0,0 +1,25 @@
/*
* Copyright (C) 2003-2011 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPD_GERROR_H
#define MPD_GERROR_H
typedef struct _GError GError;
#endif

View File

@ -23,6 +23,8 @@
#include "fd_util.h" #include "fd_util.h"
#include "mpd_error.h" #include "mpd_error.h"
#include <glib.h>
#include <sys/inotify.h> #include <sys/inotify.h>
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>

View File

@ -20,7 +20,7 @@
#ifndef MPD_INOTIFY_SOURCE_H #ifndef MPD_INOTIFY_SOURCE_H
#define MPD_INOTIFY_SOURCE_H #define MPD_INOTIFY_SOURCE_H
#include <glib.h> #include "gerror.h"
typedef void (*mpd_inotify_callback_t)(int wd, unsigned mask, typedef void (*mpd_inotify_callback_t)(int wd, unsigned mask,
const char *name, void *ctx); const char *name, void *ctx);

View File

@ -20,9 +20,8 @@
#ifndef MPD_INPUT_INIT_H #ifndef MPD_INPUT_INIT_H
#define MPD_INPUT_INIT_H #define MPD_INPUT_INIT_H
#include "check.h" #include "gerror.h"
#include <glib.h>
#include <stdbool.h> #include <stdbool.h>
/** /**

View File

@ -20,7 +20,7 @@
#ifndef MPD_LISTEN_H #ifndef MPD_LISTEN_H
#define MPD_LISTEN_H #define MPD_LISTEN_H
#include <glib.h> #include "gerror.h"
#include <stdbool.h> #include <stdbool.h>

View File

@ -24,6 +24,8 @@
#ifndef MPD_MAPPER_H #ifndef MPD_MAPPER_H
#define MPD_MAPPER_H #define MPD_MAPPER_H
#include "gerror.h"
#include <glib.h> #include <glib.h>
#include <stdbool.h> #include <stdbool.h>

View File

@ -25,7 +25,7 @@
#ifndef MPD_MIXER_CONTROL_H #ifndef MPD_MIXER_CONTROL_H
#define MPD_MIXER_CONTROL_H #define MPD_MIXER_CONTROL_H
#include <glib.h> #include "gerror.h"
#include <stdbool.h> #include <stdbool.h>

View File

@ -27,7 +27,7 @@
#ifndef MPD_MIXER_PLUGIN_H #ifndef MPD_MIXER_PLUGIN_H
#define MPD_MIXER_PLUGIN_H #define MPD_MIXER_PLUGIN_H
#include <glib.h> #include "gerror.h"
#include <stdbool.h> #include <stdbool.h>

View File

@ -20,9 +20,9 @@
#ifndef MPD_PULSE_OUTPUT_PLUGIN_H #ifndef MPD_PULSE_OUTPUT_PLUGIN_H
#define MPD_PULSE_OUTPUT_PLUGIN_H #define MPD_PULSE_OUTPUT_PLUGIN_H
#include <stdbool.h> #include "gerror.h"
#include <glib.h> #include <stdbool.h>
struct pulse_output; struct pulse_output;
struct pulse_mixer; struct pulse_mixer;

View File

@ -20,6 +20,8 @@
#ifndef MPD_OUTPUT_PLUGIN_H #ifndef MPD_OUTPUT_PLUGIN_H
#define MPD_OUTPUT_PLUGIN_H #define MPD_OUTPUT_PLUGIN_H
#include "gerror.h"
#include <glib.h> #include <glib.h>
#include <stdbool.h> #include <stdbool.h>

View File

@ -20,9 +20,10 @@
#ifndef MPD_SERVER_SOCKET_H #ifndef MPD_SERVER_SOCKET_H
#define MPD_SERVER_SOCKET_H #define MPD_SERVER_SOCKET_H
#include <stdbool.h> #include "gerror.h"
#include <glib.h> #include <stdbool.h>
#include <stddef.h>
struct sockaddr; struct sockaddr;

View File

@ -21,6 +21,8 @@
#include "socket_util.h" #include "socket_util.h"
#include "fd_util.h" #include "fd_util.h"
#include <glib.h>
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>

View File

@ -26,7 +26,9 @@
#ifndef SOCKET_UTIL_H #ifndef SOCKET_UTIL_H
#define SOCKET_UTIL_H #define SOCKET_UTIL_H
#include <glib.h> #include "gerror.h"
#include <stddef.h>
struct sockaddr; struct sockaddr;

View File

@ -42,7 +42,7 @@
#ifndef STICKER_H #ifndef STICKER_H
#define STICKER_H #define STICKER_H
#include <glib.h> #include "gerror.h"
#include <stdbool.h> #include <stdbool.h>
@ -127,8 +127,8 @@ sticker_get_value(const struct sticker *sticker, const char *name);
void void
sticker_foreach(const struct sticker *sticker, sticker_foreach(const struct sticker *sticker,
void (*func)(const char *name, const char *value, void (*func)(const char *name, const char *value,
gpointer user_data), void *user_data),
gpointer user_data); void *user_data);
/** /**
* Loads the sticker for the specified resource. * Loads the sticker for the specified resource.
@ -153,7 +153,7 @@ sticker_load(const char *type, const char *uri);
bool bool
sticker_find(const char *type, const char *base_uri, const char *name, sticker_find(const char *type, const char *base_uri, const char *name,
void (*func)(const char *uri, const char *value, void (*func)(const char *uri, const char *value,
gpointer user_data), void *user_data),
gpointer user_data); void *user_data);
#endif #endif

View File

@ -30,7 +30,7 @@ sticker_print_value(struct client *client,
} }
static void static void
print_sticker_cb(const char *name, const char *value, gpointer data) print_sticker_cb(const char *name, const char *value, void *data)
{ {
struct client *client = data; struct client *client = data;

View File

@ -21,6 +21,7 @@
#define MPD_TAG_ID3_H #define MPD_TAG_ID3_H
#include "check.h" #include "check.h"
#include "gerror.h"
#include <glib.h> #include <glib.h>

View File

@ -21,6 +21,8 @@
#include "tokenizer.h" #include "tokenizer.h"
#include "string_util.h" #include "string_util.h"
#include <glib.h>
#include <stdbool.h> #include <stdbool.h>
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>

View File

@ -20,7 +20,7 @@
#ifndef MPD_TOKENIZER_H #ifndef MPD_TOKENIZER_H
#define MPD_TOKENIZER_H #define MPD_TOKENIZER_H
#include <glib.h> #include "gerror.h"
/** /**
* Reads the next word from the input string. This function modifies * Reads the next word from the input string. This function modifies

View File

@ -20,7 +20,8 @@
#ifndef MPD_UTILS_H #ifndef MPD_UTILS_H
#define MPD_UTILS_H #define MPD_UTILS_H
#include <glib.h> #include "gerror.h"
#include <stdbool.h> #include <stdbool.h>
#ifndef assert_static #ifndef assert_static

View File

@ -20,6 +20,8 @@
#include "config.h" #include "config.h"
#include "inotify_source.h" #include "inotify_source.h"
#include <glib.h>
#include <stdbool.h> #include <stdbool.h>
#include <sys/inotify.h> #include <sys/inotify.h>
#include <signal.h> #include <signal.h>