28 |
28 |
29 |
29 |
30 typedef struct { |
30 typedef struct { |
31 gchar *xmlns; |
31 gchar *xmlns; |
32 JingleAppFuncs *funcs; |
32 JingleAppFuncs *funcs; |
|
33 JingleTransMethod method; |
33 } AppHandlerEntry; |
34 } AppHandlerEntry; |
34 |
35 |
35 typedef struct { |
36 typedef struct { |
36 gchar *xmlns; |
37 gchar *xmlns; |
37 JingleTransportFuncs *funcs; |
38 JingleTransportFuncs *funcs; |
|
39 JingleTransType type; |
|
40 JingleTransMethod method; |
38 } TransportHandlerEntry; |
41 } TransportHandlerEntry; |
39 |
42 |
40 |
43 |
41 static AppHandlerEntry *jingle_find_app(const gchar *xmlns); |
44 static AppHandlerEntry *jingle_find_app(const gchar *xmlns); |
42 static TransportHandlerEntry *jingle_find_transport(const gchar *xmlns); |
45 static TransportHandlerEntry *jingle_find_transport(const gchar *xmlns); |
44 |
47 |
45 GSList *jingle_app_handlers = NULL; |
48 GSList *jingle_app_handlers = NULL; |
46 GSList *jingle_transport_handlers = NULL; |
49 GSList *jingle_transport_handlers = NULL; |
47 |
50 |
48 |
51 |
49 void jingle_register_app(const gchar *xmlns, JingleAppFuncs *funcs) |
52 void jingle_register_app(const gchar *xmlns, JingleAppFuncs *funcs, |
|
53 JingleTransMethod method) |
50 { |
54 { |
51 if (!g_str_has_prefix(xmlns, NS_JINGLE_APP_PREFIX)) return; |
55 if (!g_str_has_prefix(xmlns, NS_JINGLE_APP_PREFIX)) return; |
52 |
56 |
53 AppHandlerEntry *h = g_new(AppHandlerEntry, 1); |
57 AppHandlerEntry *h = g_new(AppHandlerEntry, 1); |
54 |
58 |
55 h->xmlns = g_strdup(xmlns); |
59 h->xmlns = g_strdup(xmlns); |
56 h->funcs = funcs; |
60 h->funcs = funcs; |
57 |
61 h->method = method; |
|
62 |
58 jingle_app_handlers = g_slist_append(jingle_app_handlers, h); |
63 jingle_app_handlers = g_slist_append(jingle_app_handlers, h); |
59 } |
64 } |
60 |
65 |
61 void jingle_register_transport(const gchar *xmlns, JingleTransportFuncs *funcs) |
66 void jingle_register_transport(const gchar *xmlns, JingleTransportFuncs *funcs, |
|
67 JingleTransType type, JingleTransMethod method) |
62 { |
68 { |
63 if (!g_str_has_prefix(xmlns, NS_JINGLE_TRANSPORT_PREFIX)) return; |
69 if (!g_str_has_prefix(xmlns, NS_JINGLE_TRANSPORT_PREFIX)) return; |
64 |
70 |
65 TransportHandlerEntry *h = g_new(TransportHandlerEntry, 1); |
71 TransportHandlerEntry *h = g_new(TransportHandlerEntry, 1); |
66 |
72 |
67 h->xmlns = g_strdup(xmlns); |
73 h->xmlns = g_strdup(xmlns); |
68 h->funcs = funcs; |
74 h->funcs = funcs; |
69 |
75 h->method = method; |
|
76 h->type = type; |
|
77 |
70 jingle_transport_handlers = g_slist_append(jingle_transport_handlers, h); |
78 jingle_transport_handlers = g_slist_append(jingle_transport_handlers, h); |
71 } |
79 } |
72 |
80 |
73 JingleAppFuncs *jingle_get_appfuncs(const gchar *xmlns) |
81 JingleAppFuncs *jingle_get_appfuncs(const gchar *xmlns) |
74 { |
82 { |