flip_store_apps.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. {
  12. char *app_name;
  13. char *app_id;
  14. char *app_build_id;
  15. } FlipStoreAppInfo;
  16. extern FlipStoreAppInfo *flip_catalog;
  17. extern uint32_t app_selected_index;
  18. extern bool flip_store_sent_request;
  19. extern bool flip_store_success;
  20. extern bool flip_store_saved_data;
  21. extern bool flip_store_saved_success;
  22. extern uint32_t flip_store_category_index;
  23. enum ObjectState
  24. {
  25. OBJECT_EXPECT_KEY,
  26. OBJECT_EXPECT_COLON,
  27. OBJECT_EXPECT_VALUE,
  28. OBJECT_EXPECT_COMMA_OR_END
  29. };
  30. FlipStoreAppInfo *flip_catalog_alloc();
  31. void flip_catalog_free();
  32. // Utility function to parse JSON incrementally from a file
  33. bool flip_store_process_app_list();
  34. bool flip_store_get_fap_file(char *build_id, uint8_t target, uint16_t api_major, uint16_t api_minor);
  35. void flip_store_request_error(Canvas *canvas);
  36. // function to handle the entire installation process "asynchronously"
  37. bool flip_store_install_app(Canvas *canvas, char *category);
  38. // process the app list and return view
  39. int32_t flip_store_handle_app_list(FlipStoreApp *app, int32_t success_view, char *category, Submenu **submenu);
  40. #endif // FLIP_STORE_APPS_H