#ifndef STORELIB_RS_H
#define STORELIB_RS_H
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct StorelibHandle StorelibHandle;
#define STORELIB_OK 0
#define STORELIB_ERR_NULL -1
#define STORELIB_ERR_HTTP -2
#define STORELIB_ERR_JSON -3
#define STORELIB_ERR_XML -4
#define STORELIB_ERR_NOT_FOUND -5
#define STORELIB_ERR_TIMEOUT -6
#define STORELIB_ERR_OTHER -7
#define STORELIB_ID_PRODUCT_ID 0
#define STORELIB_ID_XBOX_TITLE_ID 1
#define STORELIB_ID_PACKAGE_FAMILY_NAME 2
#define STORELIB_ID_CONTENT_ID 3
#define STORELIB_ID_LEGACY_PHONE 4
#define STORELIB_ID_LEGACY_STORE 5
#define STORELIB_ID_LEGACY_XBOX 6
#define STORELIB_FAMILY_DESKTOP 0
#define STORELIB_FAMILY_MOBILE 1
#define STORELIB_FAMILY_XBOX 2
#define STORELIB_FAMILY_SERVER 3
#define STORELIB_FAMILY_IOT 4
#define STORELIB_FAMILY_HOLOLENS 5
#define STORELIB_FAMILY_ANDROMEDA 6
#define STORELIB_FAMILY_UNIVERSAL 7
#define STORELIB_FAMILY_WCOS 8
StorelibHandle* storelib_new(void);
void storelib_free(StorelibHandle* handle);
const char* storelib_last_error(const StorelibHandle* handle);
int32_t storelib_query(
StorelibHandle* handle,
const char* id,
uint32_t id_type,
const char* auth_token
);
int32_t storelib_is_found(const StorelibHandle* handle);
char* storelib_product_json(const StorelibHandle* handle);
char* storelib_packages_json(StorelibHandle* handle, const char* msa_token);
char* storelib_search_json(StorelibHandle* handle, const char* query, uint32_t family);
void storelib_free_string(char* s);
#ifdef __cplusplus
}
#endif
#endif