125
|
1 /*
|
|
2 * services.h : GeeXboX uShare UPnP services handler header.
|
|
3 * Originally developped for the GeeXboX project.
|
|
4 * Parts of the code are originated from GMediaServer from Oskar Liljeblad.
|
|
5 * Copyright (C) 2005-2007 Benjamin Zores <ben@geexbox.org>
|
|
6 *
|
|
7 * This program is free software; you can redistribute it and/or modify
|
|
8 * it under the terms of the GNU General Public License as published by
|
|
9 * the Free Software Foundation; either version 2 of the License, or
|
|
10 * (at your option) any later version.
|
|
11 *
|
|
12 * This program is distributed in the hope that it will be useful,
|
|
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15 * GNU Library General Public License for more details.
|
|
16 *
|
|
17 * You should have received a copy of the GNU General Public License along
|
|
18 * with this program; if not, write to the Free Software Foundation,
|
|
19 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
20 */
|
|
21
|
|
22 #ifndef _SERVICES_H_
|
|
23 #define _SERVICES_H_
|
|
24
|
|
25 #include <upnp/upnp.h>
|
|
26 #include <upnp/upnptools.h>
|
|
27 #include "ushare.h"
|
|
28
|
|
29 struct service_action_t {
|
|
30 char *name;
|
|
31 bool (*function) (struct action_event_t *);
|
|
32 };
|
|
33
|
|
34 struct service_t {
|
|
35 char *id;
|
|
36 char *type;
|
|
37 struct service_action_t *actions;
|
|
38 };
|
|
39
|
|
40 #define SERVICE_CONTENT_TYPE "text/xml"
|
|
41
|
|
42 bool find_service_action (struct Upnp_Action_Request *request,
|
|
43 struct service_t **service,
|
|
44 struct service_action_t **action);
|
|
45
|
|
46 bool upnp_add_response (struct action_event_t *event,
|
|
47 char *key, const char *value);
|
|
48
|
|
49 char * upnp_get_string (struct Upnp_Action_Request *request, const char *key);
|
|
50
|
|
51 int upnp_get_ui4 (struct Upnp_Action_Request *request, const char *key);
|
|
52
|
|
53 #endif /* _SERVICES_H_ */
|