mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-07 21:03:00 -05:00
[dmap] Use a wrapper for dmap_find_field()
Avoids the need to have definition of dmap_find_field in dmap_common.h that must be kept in sync with the definition that gperf generates. Also should fix compilation problems when gperf is not present, ref pr #390
This commit is contained in:
@@ -42,6 +42,12 @@ dmap_get_fields_table(int *nfields)
|
||||
return dmap_fields;
|
||||
}
|
||||
|
||||
// This wrapper is so callers don't need to include dmap_fields_hash.h
|
||||
const struct dmap_field *
|
||||
dmap_find_field_wrapper(const char *str, int len)
|
||||
{
|
||||
return dmap_find_field(str, len);
|
||||
}
|
||||
|
||||
void
|
||||
dmap_add_container(struct evbuffer *evbuf, const char *tag, int len)
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
#ifndef __DMAP_HELPERS_H__
|
||||
#define __DMAP_HELPERS_H__
|
||||
|
||||
#include "config.h"
|
||||
#include <event2/buffer.h>
|
||||
#include <event2/http.h>
|
||||
|
||||
@@ -45,9 +44,8 @@ extern const struct dmap_field_map dfm_dmap_aeSP;
|
||||
const struct dmap_field *
|
||||
dmap_get_fields_table(int *nfields);
|
||||
|
||||
/* From dmap_fields.gperf - keep in sync, don't alter */
|
||||
const struct dmap_field *
|
||||
dmap_find_field (register const char *str, register GPERF_LEN_TYPE len);
|
||||
dmap_find_field_wrapper(const char *str, int len);
|
||||
|
||||
|
||||
void
|
||||
|
||||
@@ -738,7 +738,7 @@ parse_meta(struct evhttp_request *req, char *tag, const char *param, const struc
|
||||
|
||||
if (n == i)
|
||||
{
|
||||
meta[i] = dmap_find_field(field, strlen(field));
|
||||
meta[i] = dmap_find_field_wrapper(field, strlen(field));
|
||||
|
||||
if (!meta[i])
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user