void ajax_config_transport_init(void);
int ajax_transport_build_list(http_connection_t *hc, tcp_queue_t *tq,
- struct th_transport_list *tlist,
+ struct th_transport_tree *tlist,
int ntransports);
const char *ajaxui_escape_apostrophe(const char *content);
tcp_queue_t *tq = &hr->hr_tq;
char buf[1000];
th_transport_t *t;
- struct th_transport_list head;
+ struct th_transport_tree tree;
int n = 0;
if(remain == NULL || (tdmi = dvb_mux_find_by_identifier(remain)) == NULL)
tdmi_displayname(tdmi, buf, sizeof(buf));
- LIST_INIT(&head);
+ RB_INIT(&tree);
LIST_FOREACH(t, &tdmi->tdmi_transports, tht_mux_link) {
if(transport_is_available(t)) {
- LIST_INSERT_SORTED(&head, t, tht_tmp_link, dvbsvccmp);
+ RB_INSERT_SORTED(&tree, t, tht_tmp_link, dvbsvccmp);
n++;
}
}
ajax_box_begin(tq, AJAX_BOX_SIDEBOX, NULL, NULL, buf);
- ajax_transport_build_list(hc, tq, &head, n);
+ ajax_transport_build_list(hc, tq, &tree, n);
ajax_box_end(tq, AJAX_BOX_SIDEBOX);
http_output_html(hc, hr);
th_dvb_mux_instance_t *tdmi;
tcp_queue_t *tq = &hr->hr_tq;
th_transport_t *t;
- struct th_transport_list head;
+ struct th_transport_tree tree;
int n = 0;
char buf[100];
snprintf(buf, sizeof(buf), "All services on %s\n", tda->tda_displayname);
- LIST_INIT(&head);
+ RB_INIT(&tree);
LIST_FOREACH(tdmi, &tda->tda_muxes, tdmi_adapter_link) {
LIST_FOREACH(t, &tdmi->tdmi_transports, tht_mux_link) {
if(transport_is_available(t)) {
- LIST_INSERT_SORTED(&head, t, tht_tmp_link, dvbsvccmp);
+ RB_INSERT_SORTED(&tree, t, tht_tmp_link, dvbsvccmp);
n++;
}
}
}
ajax_box_begin(tq, AJAX_BOX_SIDEBOX, NULL, NULL, buf);
- ajax_transport_build_list(hc, tq, &head, n);
+ ajax_transport_build_list(hc, tq, &tree, n);
ajax_box_end(tq, AJAX_BOX_SIDEBOX);
http_output_html(hc, hr);
*/
int
ajax_transport_build_list(http_connection_t *hc, tcp_queue_t *tq,
- struct th_transport_list *tlist, int numtransports)
+ struct th_transport_tree *tlist, int numtransports)
{
th_transport_t *t;
ajax_table_t ta;
/* Select all */
tcp_qprintf(tq, "select_all = function() {\r\n");
- LIST_FOREACH(t, tlist, tht_tmp_link) {
+ RB_FOREACH(t, tlist, tht_tmp_link) {
tcp_qprintf(tq,
"$('sel_%s').checked = true;\r\n",
t->tht_identifier);
/* Select none */
tcp_qprintf(tq, "select_none = function() {\r\n");
- LIST_FOREACH(t, tlist, tht_tmp_link) {
+ RB_FOREACH(t, tlist, tht_tmp_link) {
tcp_qprintf(tq,
"$('sel_%s').checked = false;\r\n",
t->tht_identifier);
/* Invert selection */
tcp_qprintf(tq, "select_invert = function() {\r\n");
- LIST_FOREACH(t, tlist, tht_tmp_link) {
+ RB_FOREACH(t, tlist, tht_tmp_link) {
tcp_qprintf(tq,
"$('sel_%s').checked = !$('sel_%s').checked;\r\n",
t->tht_identifier, t->tht_identifier);
/* Select TV transports */
tcp_qprintf(tq, "select_tv = function() {\r\n");
- LIST_FOREACH(t, tlist, tht_tmp_link) {
+ RB_FOREACH(t, tlist, tht_tmp_link) {
tcp_qprintf(tq,
"$('sel_%s').checked = %s;\r\n",
t->tht_identifier,
/* Select unscrambled TV transports */
tcp_qprintf(tq, "select_tv_nocrypt = function() {\r\n");
- LIST_FOREACH(t, tlist, tht_tmp_link) {
+ RB_FOREACH(t, tlist, tht_tmp_link) {
tcp_qprintf(tq,
"$('sel_%s').checked = %s;\r\n",
t->tht_identifier,
"var h = new Hash();\r\n"
);
- LIST_FOREACH(t, tlist, tht_tmp_link) {
+ RB_FOREACH(t, tlist, tht_tmp_link) {
tcp_qprintf(tq,
"if($('sel_%s').checked) {h.set('%s', 'selected') }\r\n",
t->tht_identifier, t->tht_identifier);
"", "Target channel", "", NULL},
(int[]){8,4,4,12,3,12,1});
- LIST_FOREACH(t, tlist, tht_tmp_link) {
+ RB_FOREACH(t, tlist, tht_tmp_link) {
ajax_table_row_start(&ta, t->tht_identifier);
ajax_table_cell(&ta, "status",
#include <libhts/avg.h>
#include <libhts/hts_strtab.h>
#include <libavcodec/avcodec.h>
+#include <libhts/redblack.h>
/*
* Commercial status
LIST_HEAD(pvr_rec_list, pvr_rec);
TAILQ_HEAD(ref_update_queue, ref_update);
LIST_HEAD(th_transport_list, th_transport);
+RB_HEAD(th_transport_tree, th_transport);
TAILQ_HEAD(th_transport_queue, th_transport);
LIST_HEAD(th_dvb_mux_list, th_dvb_mux);
LIST_HEAD(th_dvb_mux_instance_list, th_dvb_mux_instance);
LIST_ENTRY(th_transport) tht_mux_link;
- LIST_ENTRY(th_transport) tht_tmp_link;
+ RB_ENTRY(th_transport) tht_tmp_link;
LIST_ENTRY(th_transport) tht_active_link;