This commit is contained in:
twinaphex 2016-01-28 09:33:09 +01:00
parent 9046626256
commit dbff4e52bc
2 changed files with 28 additions and 27 deletions

View File

@ -35,7 +35,8 @@
#include "../general.h" #include "../general.h"
#include "../verbosity.h" #include "../verbosity.h"
#define MAGIC_LEN 16 #define MAGIC_LEN 16
#define MAX_TOKEN_LEN 255
struct magic_entry struct magic_entry
{ {

View File

@ -21,8 +21,6 @@
#include "../runloop.h" #include "../runloop.h"
#define MAX_TOKEN_LEN 255
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
@ -32,34 +30,40 @@ typedef void (*rarch_task_callback_t)(void *task_data, void *user_data, const ch
typedef void (*rarch_task_handler_t)(rarch_task_t *task); typedef void (*rarch_task_handler_t)(rarch_task_t *task);
typedef bool (*rarch_task_finder_t)(rarch_task_t *task, void *user_data); typedef bool (*rarch_task_finder_t)(rarch_task_t *task, void *user_data);
struct rarch_task { typedef struct
rarch_task_handler_t handler; {
rarch_task_callback_t callback; /* always called from the main loop */ char *source_file;
} decompress_task_data_t;
/* set to true by the handler to signal the task has finished executing. */ struct rarch_task
bool finished; {
rarch_task_handler_t handler;
rarch_task_callback_t callback; /* always called from the main loop */
/* set to true by the task system to signal the task *must* end. */ /* set to true by the handler to signal the task has finished executing. */
bool cancelled; bool finished;
/* created by the handler, destroyed by the user */ /* set to true by the task system to signal the task *must* end. */
void *task_data; bool cancelled;
/* owned by the user */ /* created by the handler, destroyed by the user */
void *user_data; void *task_data;
/* created and destroyed by the code related to the handler */ /* owned by the user */
void *state; void *user_data;
/* created by task handler; destroyed by main loop (after calling the callback) */ /* created and destroyed by the code related to the handler */
char *error; void *state;
/* -1 = unmettered, 0-100 progress value */ /* created by task handler; destroyed by main loop (after calling the callback) */
int8_t progress; char *error;
char *title; /* handler can modify but will be free()d automatically if non-null */
/* don't touch this. */ /* -1 = unmettered, 0-100 progress value */
rarch_task_t *next; int8_t progress;
char *title; /* handler can modify but will be free()d automatically if non-null */
/* don't touch this. */
rarch_task_t *next;
}; };
/** /**
@ -154,10 +158,6 @@ int detect_ps1_game(const char *track_path, char *game_id);
int detect_psp_game(const char *track_path, char *game_id); int detect_psp_game(const char *track_path, char *game_id);
typedef struct {
char *source_file;
} decompress_task_data_t;
bool rarch_task_push_decompress( bool rarch_task_push_decompress(
const char *source_file, const char *source_file,
const char *target_dir, const char *target_dir,