Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

Uploads (C compatible)

Ahmed Castro edited this page Apr 3, 2019 · 4 revisions

modioSetUploadListener

void modioSetUploadListener(void (*callback)(u32 response_code, u32 mod_id)); 

C++ wrapper: Uploads#setuploadlistener

Registers a function to be called every time a modfile upload finishes.

Function parameters

Name Type Description
callback void (*callback)(u32 response_code, u32 mod_id) Function to be called every time a modfile upload finishes.

Callback parameters

Name Type Description
response_code u32 Response code from mod.io backend. See Response Codes.
mod_id u32 Id of the mod that was just uploaded.

Examples

void onAddModfile(u32 response_code, u32 mod_id)
{
  if (response_code == 201)
  {
    //Modfile uploaded successfully
  }
}

[...]

modioSetUploadListener(&onAddModfile);

modioGetModUploadQueueCount

u32 modioGetModUploadQueueCount();

C++ wrapper: n/a

Returns the size of the upload queue.

Examples

u32 queue_size = modioGetModUploadQueueCount();

modioGetModfileUploadQueue

void modioGetModfileUploadQueue(ModioQueuedModfileUpload* upload_queue);

C++ wrapper: Uploads#getmoduploadqueue

Returns an array of ModioQueuedModfileUpload objects which represents the mods that are currently queued to be uploaded.

Function parameters

Name Type Description
upload_queue ModioQueuedModfileUpload* Array where the contents of the queue will be copied.

Examples

u32 queue_size = modioGetModUploadQueueCount();
ModioQueuedModfileUpload *upload_queue = malloc(queue_size * sizeof(*upload_queue));
modioGetModfileUploadQueue(upload_queue);

[...]

free(upload_queue);

modioFreeQueuedModfileUpload

void modioFreeQueuedModfileUpload(ModioQueuedModfileUpload* queued_modfile_upload);

C++ wrapper: n/a

Frees the privided ModioQueuedModfileUpload, use this to free the returned queue from modioGetModfileUploadQueue.

Function parameters

Name Type Description
queued_mod_download ModioQueuedModfileUpload ModioQueuedModfileUpload object to be freed.

Contents

Clone this wiki locally