#ifndef SMWLD_H #define SMWLD_H #include #include #ifdef __cplusplus extern "C" { #endif #if defined(_WIN32) || defined(__CYGWIN__) # ifdef SMWLD_BUILD # define SMWLD_API __declspec(dllexport) # else # define SMWLD_API __declspec(dllimport) # endif #else # if defined(__GNUC__) || defined(__clang__) # define SMWLD_API __attribute__((visibility("default"))) # else # define SMWLD_API # endif #endif SMWLD_API const char *smwld_version(void); SMWLD_API int smwld_abi_version(void); SMWLD_API const char *smwld_last_error(void); SMWLD_API void smwld_free(void *ptr); SMWLD_API int smwld_selftest(void); /* Strict MusicBrainz UUID validator (8-4-4-4-12 hex). Returns 0 if valid, -1 otherwise. */ SMWLD_API int smwld_is_valid_mbid(const char *mbid); /* Build Cover Art Archive URL ("https://coverartarchive.org/release-group//front-"). * size: 250 or 500 (defaults to 250). Caller frees with smwld_free(). */ SMWLD_API char *smwld_cover_art_url(const char *release_group_mbid, int size); /* Normalize a MusicBrainz ID into a SCORPIO MUSIC wishlist ID: "mb-". * Caller frees with smwld_free(). */ SMWLD_API char *smwld_wishlist_item_id(const char *mbid); /* Endpoint URL builders for music.scorpiox.net/world/api (transport-agnostic). */ SMWLD_API char *smwld_build_shelves_url(const char *hub_base, int limit, const char *genres_csv); SMWLD_API char *smwld_build_album_url(const char *hub_base, const char *mbid); SMWLD_API char *smwld_build_artist_url(const char *hub_base, const char *mbid); SMWLD_API char *smwld_build_genre_url(const char *hub_base, const char *genre_name, int page); /* Normalize raw /world/api?view=shelves JSON (injects coverURL + wishlistItemId + dotColor). */ SMWLD_API char *smwld_normalize_shelves_json(const char *raw_json, size_t len); /* Normalize raw /world/api?view=album JSON (preserves multi-disc tracks, editions, coverURL, dotColor). */ SMWLD_API char *smwld_normalize_album_json(const char *raw_json, size_t len); /* Availability dot helper: returns "green" (in_library), "yellow" (wanted), or "none". */ SMWLD_API const char *smwld_availability_dot(int in_library, int is_wanted); #ifdef __cplusplus } #endif #endif /* SMWLD_H */