RetroArch/tasks/task_file_transfer.h

87 lines
1.9 KiB
C
Raw Normal View History

2019-02-03 23:38:41 +00:00
/* 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 <http://www.gnu.org/licenses/>.
*/
#ifndef TASKS_FILE_TRANSFER_H
#define TASKS_FILE_TRANSFER_H
#include <boolean.h>
#include <retro_common_api.h>
#include <retro_miscellaneous.h>
2020-01-18 03:36:28 +00:00
#include <queues/task_queue.h>
2019-02-03 23:38:41 +00:00
#include "../msg_hash.h"
RETRO_BEGIN_DECLS
enum nbio_status_enum
{
NBIO_STATUS_INIT = 0,
NBIO_STATUS_TRANSFER,
NBIO_STATUS_TRANSFER_PARSE,
NBIO_STATUS_TRANSFER_FINISHED
};
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
{
void *data;
char *path;
struct nbio_t *handle;
transfer_cb_t cb;
2020-08-14 16:51:50 +00:00
unsigned status;
unsigned pos_increment;
uint32_t status_flags;
enum nbio_type type;
bool is_finished;
2019-02-03 23:38:41 +00:00
} nbio_handle_t;
typedef struct
{
2020-08-14 16:51:50 +00:00
void *user_data;
2019-02-03 23:38:41 +00:00
enum msg_hash_enums enum_idx;
char path[PATH_MAX_LENGTH];
} file_transfer_t;
2020-01-18 02:48:40 +00:00
void* task_push_http_transfer_file(const char* url, bool mute, const char* type,
retro_task_callback_t cb, file_transfer_t* transfer_data);
2019-02-03 23:38:41 +00:00
RETRO_END_DECLS
#endif