From a03216c4dd0d06da63a5040bbb1dce9212fc0271 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 23 Sep 2008 12:08:53 +0200 Subject: lyrics: added callback Instead of letting our caller poll lyrics_result(), call it back as soon as we have the result. --- src/lyrics.h | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'src/lyrics.h') diff --git a/src/lyrics.h b/src/lyrics.h index 34380c344..613ccb338 100644 --- a/src/lyrics.h +++ b/src/lyrics.h @@ -21,11 +21,7 @@ #include -enum lyrics_loader_result { - LYRICS_SUCCESS, - LYRICS_BUSY, - LYRICS_FAILED -}; +typedef void (*lyrics_callback_t)(const GString *result, void *data); struct lyrics_loader; @@ -34,15 +30,10 @@ void lyrics_init(void); void lyrics_deinit(void); struct lyrics_loader * -lyrics_load(const char *artist, const char *title); +lyrics_load(const char *artist, const char *title, + lyrics_callback_t callback, void *callback_data); void lyrics_free(struct lyrics_loader *loader); -enum lyrics_loader_result -lyrics_result(struct lyrics_loader *loader); - -const GString * -lyrics_get(struct lyrics_loader *loader); - #endif -- cgit v1.2.3