+static int unmarshall_origin(char *data, struct queue_entry *q,
+ size_t offset,
+ void (*error_handler)(const char *, void *),
+ void *u) {
+ int n;
+
+ if((n = table_find(track_origins, 0, sizeof (char *),
+ sizeof track_origins / sizeof *track_origins,
+ data)) < 0) {
+ D(("origin=[%s] n=%d", data, n));
+ error_handler("invalid origin", u);
+ return -1;
+ }
+ VALUE(q, offset, enum track_origin) = n;
+ return 0;
+}
+