Mercurial > molko
changeset 425:bf20b77968fd
core: use err.h in script
author | David Demelier <markand@malikania.fr> |
---|---|
date | Sat, 15 Oct 2022 14:14:38 +0200 |
parents | 2f4a8e166128 |
children | 35dd2068b4ab |
files | src/libmlk-core/core/music.c src/libmlk-core/core/music.h src/libmlk-core/core/script.c |
diffstat | 3 files changed, 4 insertions(+), 24 deletions(-) [+] |
line wrap: on
line diff
--- a/src/libmlk-core/core/music.c Sat Oct 15 14:03:27 2022 +0200 +++ b/src/libmlk-core/core/music.c Sat Oct 15 14:14:38 2022 +0200 @@ -19,10 +19,8 @@ #include <assert.h> #include <string.h> -#include "error.h" +#include "err.h" #include "music.h" -#include "vfs.h" -#include "vfs_p.h" #include "sys_p.h" #define SOURCE(mus) ((const struct audiostream *)mus->handle)->source @@ -52,19 +50,6 @@ } int -music_openvfs(struct music *mus, struct vfs_file *file) -{ - assert(mus); - assert(vfs_file_ok(file)); - - // TODO: implement this. - (void)mus; - (void)file; - - return 0; -} - -int music_ok(const struct music *mus) { return mus && mus->handle;
--- a/src/libmlk-core/core/music.h Sat Oct 15 14:03:27 2022 +0200 +++ b/src/libmlk-core/core/music.h Sat Oct 15 14:14:38 2022 +0200 @@ -23,8 +23,6 @@ #include "core.h" -struct vfs_file; - enum music_flags { MUSIC_NONE = 0, MUSIC_LOOP = (1 << 0) @@ -43,9 +41,6 @@ music_openmem(struct music *, const void *, size_t); int -music_openvfs(struct music *, struct vfs_file *); - -int music_ok(const struct music *); int
--- a/src/libmlk-core/core/script.c Sat Oct 15 14:03:27 2022 +0200 +++ b/src/libmlk-core/core/script.c Sat Oct 15 14:14:38 2022 +0200 @@ -21,7 +21,7 @@ #include <string.h> #include "action.h" -#include "error.h" +#include "err.h" #include "script.h" static struct action * @@ -72,7 +72,7 @@ assert(a); if (s->actionsz >= SCRIPT_ACTION_MAX) - return errorf("script is full"); + return ERR_NO_MEM; s->actions[s->actionsz++] = a; @@ -86,7 +86,7 @@ assert(ev); struct action *a = current(s); - + if (a) action_handle(a, ev); }