flip_store_apps.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #ifndef FLIP_STORE_APPS_H
  2. #define FLIP_STORE_APPS_H
  3. #include <flip_store.h>
  4. #include <flip_storage/flip_store_storage.h>
  5. #include <callback/flip_store_callback.h>
  6. // Define maximum limits
  7. #define MAX_APP_NAME_LENGTH 32
  8. #define MAX_ID_LENGTH 32
  9. #define MAX_APP_COUNT 100
  10. typedef struct {
  11. char* app_name;
  12. char* app_id;
  13. char* app_build_id;
  14. } FlipStoreAppInfo;
  15. extern FlipStoreAppInfo* flip_catalog;
  16. extern uint32_t app_selected_index;
  17. extern bool flip_store_sent_request;
  18. extern bool flip_store_success;
  19. extern bool flip_store_saved_data;
  20. extern bool flip_store_saved_success;
  21. extern uint32_t flip_store_category_index;
  22. enum ObjectState {
  23. OBJECT_EXPECT_KEY,
  24. OBJECT_EXPECT_COLON,
  25. OBJECT_EXPECT_VALUE,
  26. OBJECT_EXPECT_COMMA_OR_END
  27. };
  28. FlipStoreAppInfo* flip_catalog_alloc();
  29. void flip_catalog_free();
  30. // Utility function to parse JSON incrementally from a file
  31. bool flip_store_process_app_list();
  32. bool flip_store_get_fap_file(
  33. char* build_id,
  34. uint8_t target,
  35. uint16_t api_major,
  36. uint16_t api_minor);
  37. void flip_store_request_error(Canvas* canvas);
  38. // function to handle the entire installation process "asynchronously"
  39. bool flip_store_install_app(Canvas* canvas, char* category);
  40. // process the app list and return view
  41. int32_t flip_store_handle_app_list(
  42. FlipStoreApp* app,
  43. int32_t success_view,
  44. char* category,
  45. Submenu** submenu);
  46. #endif // FLIP_STORE_APPS_H