mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2025-12-12 04:34:43 +04:00
* feat: app chaining * add `launch_current_app_after_deferred`, remove `get_referring_application` * fix naming * new api * fix f18 * fix deferred launches after errors * fix: memory leak * Updater: MIN_GAP_PAGES = 0 * loader: loader_get_application_launch_path doc * loader: fix freeze * loader: reject mlib, reduce code size * loader: generic synchronous call, reduce size * loader: reject furi_string, reduce size * apps: debug: removed order field from manifests since it is no longer meaningful --------- Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com> Co-authored-by: hedger <hedger@nanode.su>
54 lines
1.2 KiB
C
54 lines
1.2 KiB
C
#pragma once
|
|
|
|
#include <furi.h>
|
|
|
|
#include "loader.h"
|
|
|
|
#define LOADER_QUEUE_MAX_SIZE 4
|
|
|
|
typedef struct {
|
|
char* name_or_path;
|
|
char* args;
|
|
LoaderDeferredLaunchFlag flags;
|
|
} LoaderDeferredLaunchRecord;
|
|
|
|
typedef struct {
|
|
LoaderDeferredLaunchRecord items[LOADER_QUEUE_MAX_SIZE];
|
|
size_t item_cnt;
|
|
} LoaderLaunchQueue;
|
|
|
|
/**
|
|
* @brief Frees internal data in a `DeferredLaunchRecord`
|
|
*
|
|
* @param[out] item Record to clear
|
|
*/
|
|
void loader_queue_item_clear(LoaderDeferredLaunchRecord* item);
|
|
|
|
/**
|
|
* @brief Fetches the next item from the launch queue
|
|
*
|
|
* @param[inout] queue Queue instance
|
|
* @param[out] item Item output
|
|
*
|
|
* @return `true` if `item` was populated, `false` if queue is empty
|
|
*/
|
|
bool loader_queue_pop(LoaderLaunchQueue* queue, LoaderDeferredLaunchRecord* item);
|
|
|
|
/**
|
|
* @brief Puts an item into the launch queue
|
|
*
|
|
* @param[inout] queue Queue instance
|
|
* @param[in] item Item to put in the queue
|
|
*
|
|
* @return `true` if the item was put into the queue, `false` if there's no more
|
|
* space left
|
|
*/
|
|
bool loader_queue_push(LoaderLaunchQueue* queue, LoaderDeferredLaunchRecord* item);
|
|
|
|
/**
|
|
* @brief Clears the launch queue
|
|
*
|
|
* @param[inout] queue Queue instance
|
|
*/
|
|
void loader_queue_clear(LoaderLaunchQueue* queue);
|