Commit 941a9284 authored by Max Kellermann's avatar Max Kellermann

playlist/SoundCloud: rename struct parse_data to SoundCloudJsonData

parent 4ee3820b
...@@ -101,7 +101,7 @@ static const char *const key_str[] = { ...@@ -101,7 +101,7 @@ static const char *const key_str[] = {
nullptr, nullptr,
}; };
struct parse_data { struct SoundCloudJsonData {
int key; int key;
char* stream_url; char* stream_url;
long duration; long duration;
...@@ -114,7 +114,7 @@ struct parse_data { ...@@ -114,7 +114,7 @@ struct parse_data {
static int static int
handle_integer(void *ctx, long long intval) handle_integer(void *ctx, long long intval)
{ {
struct parse_data *data = (struct parse_data *) ctx; auto *data = (SoundCloudJsonData *) ctx;
switch (data->key) { switch (data->key) {
case Duration: case Duration:
...@@ -130,7 +130,7 @@ handle_integer(void *ctx, long long intval) ...@@ -130,7 +130,7 @@ handle_integer(void *ctx, long long intval)
static int static int
handle_string(void *ctx, const unsigned char *stringval, size_t stringlen) handle_string(void *ctx, const unsigned char *stringval, size_t stringlen)
{ {
struct parse_data *data = (struct parse_data *) ctx; auto *data = (SoundCloudJsonData *) ctx;
const char *s = (const char *) stringval; const char *s = (const char *) stringval;
switch (data->key) { switch (data->key) {
...@@ -153,7 +153,7 @@ handle_string(void *ctx, const unsigned char *stringval, size_t stringlen) ...@@ -153,7 +153,7 @@ handle_string(void *ctx, const unsigned char *stringval, size_t stringlen)
static int static int
handle_mapkey(void *ctx, const unsigned char *stringval, size_t stringlen) handle_mapkey(void *ctx, const unsigned char *stringval, size_t stringlen)
{ {
struct parse_data *data = (struct parse_data *) ctx; auto *data = (SoundCloudJsonData *) ctx;
int i; int i;
data->key = Other; data->key = Other;
...@@ -171,7 +171,7 @@ handle_mapkey(void *ctx, const unsigned char *stringval, size_t stringlen) ...@@ -171,7 +171,7 @@ handle_mapkey(void *ctx, const unsigned char *stringval, size_t stringlen)
static int static int
handle_start_map(void *ctx) handle_start_map(void *ctx)
{ {
struct parse_data *data = (struct parse_data *) ctx; auto *data = (SoundCloudJsonData *) ctx;
if (data->got_url > 0) if (data->got_url > 0)
data->got_url++; data->got_url++;
...@@ -182,7 +182,7 @@ handle_start_map(void *ctx) ...@@ -182,7 +182,7 @@ handle_start_map(void *ctx)
static int static int
handle_end_map(void *ctx) handle_end_map(void *ctx)
{ {
struct parse_data *data = (struct parse_data *) ctx; auto *data = (SoundCloudJsonData *) ctx;
if (data->got_url > 1) { if (data->got_url > 1) {
data->got_url--; data->got_url--;
...@@ -325,7 +325,7 @@ soundcloud_open_uri(const char *uri, Mutex &mutex, Cond &cond) ...@@ -325,7 +325,7 @@ soundcloud_open_uri(const char *uri, Mutex &mutex, Cond &cond)
return nullptr; return nullptr;
} }
struct parse_data data; SoundCloudJsonData data;
data.got_url = 0; data.got_url = 0;
data.title = nullptr; data.title = nullptr;
data.stream_url = nullptr; data.stream_url = nullptr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment