#ifndef SMWSH_H #define SMWSH_H #include #include #ifdef __cplusplus extern "C" { #endif #if defined(_WIN32) || defined(__CYGWIN__) # ifdef SMWSH_BUILD # define SMWSH_API __declspec(dllexport) # else # define SMWSH_API __declspec(dllimport) # endif #else # if defined(__GNUC__) || defined(__clang__) # define SMWSH_API __attribute__((visibility("default"))) # else # define SMWSH_API # endif #endif typedef struct smwsh_ctx smwsh_ctx; SMWSH_API const char *smwsh_version(void); SMWSH_API int smwsh_abi_version(void); SMWSH_API const char *smwsh_last_error(void); SMWSH_API void smwsh_free(void *ptr); SMWSH_API int smwsh_selftest(void); SMWSH_API smwsh_ctx *smwsh_create(void); SMWSH_API void smwsh_destroy(smwsh_ctx *ctx); /* Validate wishlist kind ("track", "album", "artist", "playlist"). Returns 0 if valid, -1 otherwise. */ SMWSH_API int smwsh_validate_kind(const char *kind); /* Endpoint & request builders matching live music.scorpiox.net/wishlist API. */ SMWSH_API char *smwsh_build_mine_url(const char *hub_base); SMWSH_API char *smwsh_build_wish_request_json( const char *hub_base, int add_wish, const char *kind, const char *item_id, const char *title, const char *artist ); /* Hydrate in-memory wished set from GET /wishlist/api/mine JSON response. Returns item count or -1. */ SMWSH_API int smwsh_load_mine_json(smwsh_ctx *ctx, const char *mine_json, size_t len); /* Query & optimistic toggle on local wished set. */ SMWSH_API int smwsh_is_wished(smwsh_ctx *ctx, const char *kind, const char *item_id); SMWSH_API int smwsh_apply_local_toggle(smwsh_ctx *ctx, const char *kind, const char *item_id, const char *title, const char *artist); SMWSH_API int smwsh_count(smwsh_ctx *ctx); SMWSH_API char *smwsh_export_json(smwsh_ctx *ctx); #ifdef __cplusplus } #endif #endif /* SMWSH_H */