BSB Developer Docs
Loading...
Searching...
No Matches
fetch_loader.h
Go to the documentation of this file.
1
5#pragma once
6
7#include "fetch_common.h"
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
16typedef struct FetchLoader FetchLoader;
17
24typedef void (*FetchLoaderProgressCallback)(const FetchProgress* progress, void* context);
25
32typedef void (*FetchLoaderStateCallback)(const char* message, void* context);
33
40typedef void (*FetchLoaderDoneCallback)(FetchStatus status, void* context);
41
48
54void fetch_loader_free(FetchLoader* instance);
55
65void fetch_loader_start(FetchLoader* instance, const char* remote_url, const char* file_path);
66
76void fetch_loader_stop(FetchLoader* instance);
77
84void fetch_loader_set_callback_context(FetchLoader* instance, void* context);
85
93 FetchLoader* instance,
95
103
111
112#ifdef __cplusplus
113}
114#endif
Common definitions for Fetch and files that use it.
FetchStatus
Enumeration of possible Fetch completion statuses.
Definition fetch_common.h:30
void(* FetchLoaderProgressCallback)(const FetchProgress *progress, void *context)
Progress callback function type.
Definition fetch_loader.h:24
void fetch_loader_set_progress_callback(FetchLoader *instance, FetchLoaderProgressCallback callback)
Set the callback function for progress notifications.
Definition fetch_loader.c:231
void(* FetchLoaderStateCallback)(const char *message, void *context)
State callback function type.
Definition fetch_loader.h:32
void(* FetchLoaderDoneCallback)(FetchStatus status, void *context)
Done callback function type.
Definition fetch_loader.h:40
void fetch_loader_set_done_callback(FetchLoader *instance, FetchLoaderDoneCallback callback)
Set the callback function for completion notifications.
Definition fetch_loader.c:243
void fetch_loader_set_state_callback(FetchLoader *instance, FetchLoaderStateCallback callback)
Set the callback function for state notifications.
Definition fetch_loader.c:238
void fetch_loader_start(FetchLoader *instance, const char *remote_url, const char *file_path)
Start downloading a file.
Definition fetch_loader.c:204
void fetch_loader_set_callback_context(FetchLoader *instance, void *context)
Set the context for callback functions.
Definition fetch_loader.c:226
void fetch_loader_stop(FetchLoader *instance)
Request the download process to be stopped.
Definition fetch_loader.c:133
void fetch_loader_free(FetchLoader *instance)
Delete a FetchLoader instance.
Definition fetch_loader.c:120
FetchLoader * fetch_loader_alloc(void)
Create a FetchLoader instance.
Definition fetch_loader.c:104
Definition fetch_loader.c:14
Fetch download progress structure.
Definition fetch_common.h:20