flip_store_apps.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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 50
  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. extern int catalog_iteration;
  16. typedef struct
  17. {
  18. char app_name[MAX_APP_NAME_LENGTH];
  19. char app_id[MAX_APP_NAME_LENGTH];
  20. char app_build_id[MAX_ID_LENGTH];
  21. char app_version[MAX_APP_VERSION_LENGTH];
  22. char app_description[MAX_APP_DESCRIPTION_LENGTH];
  23. size_t count;
  24. int iteration;
  25. } FlipStoreAppInfo;
  26. extern FlipStoreAppInfo *flip_catalog;
  27. extern uint32_t app_selected_index;
  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(FlipperHTTP *fhttp);
  40. // function to handle the entire installation process "asynchronously"
  41. bool flip_store_install_app(FlipperHTTP *fhttp, char *category);
  42. #endif // FLIP_STORE_APPS_H