diff --git a/discord/discord.c b/discord/discord.c index e971825597..401f7d167d 100644 --- a/discord/discord.c +++ b/discord/discord.c @@ -31,6 +31,7 @@ #include "../verbosity.h" #include "../msg_hash.h" +#include "../tasks/task_file_transfer.h" #ifdef HAVE_NETWORKING #include "../../network/netplay/netplay.h" diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index d95f527b28..c8f5dbe88e 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -57,6 +57,7 @@ #include "../../defaults.h" #include "../../managers/core_option_manager.h" #include "../../managers/cheat_manager.h" +#include "../../tasks/task_file_transfer.h" #include "../../tasks/tasks_internal.h" #include "../../input/input_remapping.h" #include "../../paths.h" diff --git a/menu/menu_networking.c b/menu/menu_networking.c index 4d2a2beec9..38dee85723 100644 --- a/menu/menu_networking.c +++ b/menu/menu_networking.c @@ -39,6 +39,7 @@ #include "../configuration.h" #include "../file_path_special.h" #include "../msg_hash.h" +#include "../tasks/task_file_transfer.h" #include "../tasks/tasks_internal.h" void print_buf_lines(file_list_t *list, char *buf, diff --git a/tasks/task_audio_mixer.c b/tasks/task_audio_mixer.c index 2887d0e86c..19a1758817 100644 --- a/tasks/task_audio_mixer.c +++ b/tasks/task_audio_mixer.c @@ -32,6 +32,7 @@ #include "../file_path_special.h" #include "../verbosity.h" +#include "task_file_transfer.h" #include "tasks_internal.h" typedef struct nbio_buf diff --git a/tasks/task_file_transfer.c b/tasks/task_file_transfer.c index 2249681508..df57c452a4 100644 --- a/tasks/task_file_transfer.c +++ b/tasks/task_file_transfer.c @@ -21,6 +21,7 @@ #include +#include "task_file_transfer.h" #include "tasks_internal.h" #include "../verbosity.h" diff --git a/tasks/task_file_transfer.h b/tasks/task_file_transfer.h new file mode 100644 index 0000000000..ef04c85065 --- /dev/null +++ b/tasks/task_file_transfer.h @@ -0,0 +1,73 @@ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2011-2017 - Daniel De Matteis + * + * RetroArch 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 Found- + * ation, either version 3 of the License, or (at your option) any later version. + * + * RetroArch 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 RetroArch. + * If not, see . + */ + +#ifndef TASKS_FILE_TRANSFER_H +#define TASKS_FILE_TRANSFER_H + +#include +#include +#include + +#include + +#include "../msg_hash.h" + +RETRO_BEGIN_DECLS + +enum nbio_type +{ + NBIO_TYPE_NONE = 0, + NBIO_TYPE_JPEG, + NBIO_TYPE_PNG, + NBIO_TYPE_TGA, + NBIO_TYPE_BMP, + NBIO_TYPE_OGG, + NBIO_TYPE_FLAC, + NBIO_TYPE_MP3, + NBIO_TYPE_MOD, + NBIO_TYPE_WAV +}; + +enum nbio_status_flags +{ + NBIO_FLAG_NONE = 0, + NBIO_FLAG_IMAGE_SUPPORTS_RGBA +}; + +typedef int (*transfer_cb_t)(void *data, size_t len); + +typedef struct nbio_handle +{ + enum nbio_type type; + bool is_finished; + unsigned status; + unsigned pos_increment; + uint32_t status_flags; + void *data; + char *path; + struct nbio_t *handle; + msg_queue_t *msg_queue; + transfer_cb_t cb; +} nbio_handle_t; + +typedef struct +{ + enum msg_hash_enums enum_idx; + char path[PATH_MAX_LENGTH]; +} file_transfer_t; + +RETRO_END_DECLS + +#endif diff --git a/tasks/task_http.c b/tasks/task_http.c index 4c595f18d8..6d9b0cf110 100644 --- a/tasks/task_http.c +++ b/tasks/task_http.c @@ -24,6 +24,7 @@ #include "../verbosity.h" #include "../gfx/video_display_server.h" +#include "task_file_transfer.h" #include "tasks_internal.h" enum http_status_enum diff --git a/tasks/task_image.c b/tasks/task_image.c index 1828cec7c0..5673242da9 100644 --- a/tasks/task_image.c +++ b/tasks/task_image.c @@ -28,6 +28,7 @@ #include "../file_path_special.h" #include "../verbosity.h" +#include "task_file_transfer.h" #include "tasks_internal.h" enum image_status_enum diff --git a/tasks/task_netplay_lan_scan.c b/tasks/task_netplay_lan_scan.c index b05348c63b..dba19116e6 100644 --- a/tasks/task_netplay_lan_scan.c +++ b/tasks/task_netplay_lan_scan.c @@ -18,6 +18,7 @@ #include #include "../paths.h" +#include "task_file_transfer.h" #include "tasks_internal.h" #ifdef HAVE_CONFIG_H diff --git a/tasks/task_wifi.c b/tasks/task_wifi.c index 7003b23163..bf945b3c36 100644 --- a/tasks/task_wifi.c +++ b/tasks/task_wifi.c @@ -21,6 +21,8 @@ #include #include "tasks_internal.h" + +#include "../msg_hash.h" #include "../verbosity.h" #include "../wifi/wifi_driver.h" diff --git a/tasks/tasks_internal.h b/tasks/tasks_internal.h index 3eeaec5a0c..1b94e25f3b 100644 --- a/tasks/tasks_internal.h +++ b/tasks/tasks_internal.h @@ -22,7 +22,6 @@ #include #include -#include #include #ifdef HAVE_CONFIG_H @@ -33,12 +32,9 @@ #include "../content.h" #include "../core_type.h" -#include "../msg_hash.h" RETRO_BEGIN_DECLS -typedef int (*transfer_cb_t)(void *data, size_t len); - enum content_mode_load { CONTENT_MODE_LOAD_NONE = 0, @@ -55,46 +51,6 @@ enum nbio_status_enum NBIO_STATUS_TRANSFER_FINISHED }; -enum nbio_status_flags -{ - NBIO_FLAG_NONE = 0, - NBIO_FLAG_IMAGE_SUPPORTS_RGBA -}; - -enum nbio_type -{ - NBIO_TYPE_NONE = 0, - NBIO_TYPE_JPEG, - NBIO_TYPE_PNG, - NBIO_TYPE_TGA, - NBIO_TYPE_BMP, - NBIO_TYPE_OGG, - NBIO_TYPE_FLAC, - NBIO_TYPE_MP3, - NBIO_TYPE_MOD, - NBIO_TYPE_WAV -}; - -typedef struct nbio_handle -{ - enum nbio_type type; - bool is_finished; - unsigned status; - unsigned pos_increment; - uint32_t status_flags; - void *data; - char *path; - struct nbio_t *handle; - msg_queue_t *msg_queue; - transfer_cb_t cb; -} nbio_handle_t; - -typedef struct -{ - enum msg_hash_enums enum_idx; - char path[PATH_MAX_LENGTH]; -} file_transfer_t; - #ifdef HAVE_NETWORKING typedef struct {