flip_store_apps.h 1.4 KB

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