From ddf7f5c131b04f2caee28c9456b98eeebe0c94ab Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 13 Jun 2012 21:38:28 +0200 Subject: update_internal.h: split header --- Makefile.am | 5 ++--- src/update.c | 7 ++++++- src/update_internal.h | 50 -------------------------------------------------- src/update_queue.c | 2 +- src/update_queue.h | 33 +++++++++++++++++++++++++++++++++ src/update_walk.c | 5 ++++- src/update_walk.h | 39 +++++++++++++++++++++++++++++++++++++++ 7 files changed, 85 insertions(+), 56 deletions(-) delete mode 100644 src/update_internal.h create mode 100644 src/update_queue.h create mode 100644 src/update_walk.h diff --git a/Makefile.am b/Makefile.am index 9b54b999..c8ab8cee 100644 --- a/Makefile.am +++ b/Makefile.am @@ -89,7 +89,6 @@ mpd_headers = \ src/fd_util.h \ src/glib_compat.h \ src/update.h \ - src/update_internal.h \ src/inotify_source.h \ src/inotify_queue.h \ src/inotify_update.h \ @@ -266,10 +265,10 @@ src_mpd_SOURCES = \ src/filter_plugin.c \ src/filter_registry.c \ src/update.c \ - src/update_queue.c \ + src/update_queue.c src/update_queue.h \ src/update_io.c src/update_io.h \ src/update_db.c src/update_db.h \ - src/update_walk.c \ + src/update_walk.c src/update_walk.h \ src/update_remove.c \ src/client.c \ src/client_event.c \ diff --git a/src/update.c b/src/update.c index 2df1a5bf..12eec40c 100644 --- a/src/update.c +++ b/src/update.c @@ -18,7 +18,9 @@ */ #include "config.h" -#include "update_internal.h" +#include "update.h" +#include "update_queue.h" +#include "update_walk.h" #include "update_remove.h" #include "update.h" #include "database.h" @@ -35,6 +37,9 @@ #include +#undef G_LOG_DOMAIN +#define G_LOG_DOMAIN "update" + static enum update_progress { UPDATE_PROGRESS_IDLE = 0, UPDATE_PROGRESS_RUNNING = 1, diff --git a/src/update_internal.h b/src/update_internal.h deleted file mode 100644 index 9da74d52..00000000 --- a/src/update_internal.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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_UPDATE_INTERNAL_H -#define MPD_UPDATE_INTERNAL_H - -#include - -#undef G_LOG_DOMAIN -#define G_LOG_DOMAIN "update" - -struct stat; -struct song; -struct directory; - -unsigned -update_queue_push(const char *path, bool discard, unsigned base); - -char * -update_queue_shift(bool *discard_r); - -void -update_walk_global_init(void); - -void -update_walk_global_finish(void); - -/** - * Returns true if the database was modified. - */ -bool -update_walk(const char *path, bool discard); - -#endif diff --git a/src/update_queue.c b/src/update_queue.c index 4de250cc..2150fa4e 100644 --- a/src/update_queue.c +++ b/src/update_queue.c @@ -18,7 +18,7 @@ */ #include "config.h" -#include "update_internal.h" +#include "update_queue.h" #include diff --git a/src/update_queue.h b/src/update_queue.h new file mode 100644 index 00000000..84ba474b --- /dev/null +++ b/src/update_queue.h @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2003-2012 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_UPDATE_QUEUE_H +#define MPD_UPDATE_QUEUE_H + +#include "check.h" + +#include + +unsigned +update_queue_push(const char *path, bool discard, unsigned base); + +char * +update_queue_shift(bool *discard_r); + +#endif diff --git a/src/update_walk.c b/src/update_walk.c index c9d6d81c..72abf39c 100644 --- a/src/update_walk.c +++ b/src/update_walk.c @@ -18,7 +18,7 @@ */ #include "config.h" /* must be first for large file support */ -#include "update_internal.h" +#include "update_walk.h" #include "update_io.h" #include "update_db.h" #include "database.h" @@ -54,6 +54,9 @@ #include #include +#undef G_LOG_DOMAIN +#define G_LOG_DOMAIN "update" + static bool walk_discard; static bool modified; diff --git a/src/update_walk.h b/src/update_walk.h new file mode 100644 index 00000000..ab1e41fb --- /dev/null +++ b/src/update_walk.h @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2003-2012 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_UPDATE_WALK_H +#define MPD_UPDATE_WALK_H + +#include "check.h" + +#include + +void +update_walk_global_init(void); + +void +update_walk_global_finish(void); + +/** + * Returns true if the database was modified. + */ +bool +update_walk(const char *path, bool discard); + +#endif -- cgit v1.2.3