flip_store_apps.h 1.5 KB

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