flip_store_apps.h 1.5 KB

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