aboutsummaryrefslogtreecommitdiff
path: root/sokol_fetch.h
diff options
context:
space:
mode:
authorTrace Andreason <tandreason@gmail.com>2024-05-14 09:57:07 -0700
committerTrace Andreason <tandreason@gmail.com>2024-05-14 09:57:07 -0700
commit0c8d43ea8e16025374dc5d92b1f3c54e306e8704 (patch)
treee861b58239db6380c8700b8afdbcda7f4b8f17c3 /sokol_fetch.h
parent57d10ef03fabf65d5059aba0adef0e979f949937 (diff)
remove callback typedef
Diffstat (limited to 'sokol_fetch.h')
-rw-r--r--sokol_fetch.h17
1 files changed, 7 insertions, 10 deletions
diff --git a/sokol_fetch.h b/sokol_fetch.h
index 510c5b5b..f94f5c82 100644
--- a/sokol_fetch.h
+++ b/sokol_fetch.h
@@ -1071,17 +1071,14 @@ typedef struct sfetch_response_t {
sfetch_range_t buffer; // the user-provided buffer which holds the fetched data
} sfetch_response_t;
-/* response callback function signature */
-typedef void(*sfetch_callback_t)(const sfetch_response_t*);
-
/* request parameters passed to sfetch_send() */
typedef struct sfetch_request_t {
- uint32_t channel; // index of channel this request is assigned to (default: 0)
- const char* path; // filesystem path or HTTP URL (required)
- sfetch_callback_t callback; // response callback function pointer (required)
- uint32_t chunk_size; // number of bytes to load per stream-block (optional)
- sfetch_range_t buffer; // a memory buffer where the data will be loaded into (optional)
- sfetch_range_t user_data; // ptr/size of a POD user data block which will be memcpy'd (optional)
+ uint32_t channel; // index of channel this request is assigned to (default: 0)
+ const char* path; // filesystem path or HTTP URL (required)
+ void (*callback) (const sfetch_response_t*); // response callback function pointer (required)
+ uint32_t chunk_size; // number of bytes to load per stream-block (optional)
+ sfetch_range_t buffer; // a memory buffer where the data will be loaded into (optional)
+ sfetch_range_t user_data; // ptr/size of a POD user data block which will be memcpy'd (optional)
} sfetch_request_t;
/* setup sokol-fetch (can be called on multiple threads) */
@@ -1302,7 +1299,7 @@ typedef struct {
uint32_t channel;
uint32_t lane;
uint32_t chunk_size;
- sfetch_callback_t callback;
+ void (*callback) (const sfetch_response_t*);
sfetch_range_t buffer;
/* updated by IO-thread, off-limits to user thread */