diff options
author | Robin Krahl <me@robin-krahl.de> | 2016-06-10 14:20:19 +0200 |
---|---|---|
committer | Robin Krahl <me@robin-krahl.de> | 2016-06-10 14:20:19 +0200 |
commit | 635ecce5990cc763160bb7e89b9291f09d06afc5 (patch) | |
tree | efeebe916fa07afbc6f1e48d63cb2555a194920d /dbfp.c | |
parent | 08c86a69b964ca5183fbf93bf29d9a2fa9cb7663 (diff) | |
download | dbfp-635ecce5990cc763160bb7e89b9291f09d06afc5.tar.gz dbfp-635ecce5990cc763160bb7e89b9291f09d06afc5.tar.bz2 |
dbfp_query_departure: remove location argument, only use location_id
Diffstat (limited to 'dbfp.c')
-rw-r--r-- | dbfp.c | 15 |
1 files changed, 5 insertions, 10 deletions
@@ -183,9 +183,8 @@ void dbfp_departure_close(struct dbfp_departure *departure) free(departure->track); } -int dbfp_query_departure(struct dbfp *dbfp, struct dbfp_location *location, - char *location_id, time_t time, size_t *n, - struct dbfp_departure **departures) +int dbfp_query_departure(struct dbfp *dbfp, char *location_id, time_t time, + size_t *n, struct dbfp_departure **departures) { int err = 0; char *query = 0; @@ -196,9 +195,7 @@ int dbfp_query_departure(struct dbfp *dbfp, struct dbfp_location *location, struct parse_data pd = { .error = 0, .data = &dd }; struct tm *tm; - if (!dbfp || !n || !departures) - return EINVAL; - if ((!location && !location_id) || (location && !location->id)) + if (!dbfp || !location_id || !n || !departures) return EINVAL; *n = 0; @@ -220,11 +217,9 @@ int dbfp_query_departure(struct dbfp *dbfp, struct dbfp_location *location, goto cleanup; err = dbfp_format_url(&query, "id=%s&date=%s&time=%s", - location ? location->id : location_id, - query_date, query_time); + location_id, query_date, query_time); } else { - err = dbfp_format_url(&query, "id=%s", - location ? location->id : location_id); + err = dbfp_format_url(&query, "id=%s", location_id); } if (err) goto cleanup; |