flip_store_apps.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. 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. int count;
  23. } FlipStoreAppInfo;
  24. extern FlipStoreAppInfo *flip_catalog;
  25. extern uint32_t app_selected_index;
  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(FlipperHTTP *fhttp);
  38. // function to handle the entire installation process "asynchronously"
  39. bool flip_store_install_app(FlipperHTTP *fhttp, char *category);
  40. #endif // FLIP_STORE_APPS_H