aboutsummaryrefslogtreecommitdiffstats
path: root/dvb-s/Intelsat-9-58.0W
blob: e8605a92131a5e799040dd322a16038ca1d31bc4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Intelsat 9 @ 58.0W
# freq pol sr fec

S 4122000 H 02222000 AUTO
S 4146000 H 06620000 AUTO
S 4157000 H 06620000 AUTO
S 4160000 V 03000000 AUTO
S 3960000 V 29270000 AUTO
S 3960000 H 29270000 AUTO
S 4080000 H 27684000 AUTO
S 3720000 H 19510000 AUTO
S 4131000 H 04444000 AUTO
S 4155000 H 06111000 AUTO
S 4173000 H 06620000 AUTO
S 3995000 H 05632000 AUTO
S 3986000 H 06111000 AUTO
S 4175000 H 04410000 AUTO
S 4107000 H 08850000 AUTO
S 3925000 H 06666000 AUTO
S 3905000 H 06620000 AUTO
S 3915000 H 06620000 AUTO
S 3925000 H 06620000 AUTO
S 4005000 H 06620000 AUTO
S 4015000 H 06620000 AUTO
S 3720000 V 27700000 AUTO
S 4166000 H 06200000 AUTO
S 3794000 H 03332000 AUTO
S 3807000 H 03428000 AUTO
S 3880000 V 27690000 AUTO
S 3800000 V 26470000 AUTO
S 3760000 V 27690000 AUTO
S 3996000 H 03330000 AUTO
S 3935000 H 05632000 AUTO
S 11852000 V 30000000 AUTO
S 11895000 V 20000000 AUTO
S 11913000 V 10000000 AUTO
S 4155000 V 03310000 AUTO
S 3934000 V 07000000 AUTO
S 3787000 H 07407000 AUTO
S 3924000 V 06620000 AUTO
S 3800000 H 04444000 AUTO
S 3911000 V 13330000 AUTO
S 4040000 H 16180000 AUTO
S 4080000 V 27690000 AUTO
S 4144000 V 02205000 AUTO
S 4151000 V 02890000 AUTO
S 4147000 V 02941000 AUTO
S 4170000 V 02941000 AUTO
S 3760000 H 28500000 AUTO
S 4120000 V 27500000 AUTO
S 11670000 V 16470000 AUTO
S 4125000 H 02941000 AUTO
S 4137000 H 02941000 AUTO
S 3880000 H 27690000 AUTO
S 4174000 V 02941000 AUTO
S 3840000 V 27690000 AUTO
S 3840000 H 27690000 AUTO
S 3815000 H 06250000 AUTO
t .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
void config_setting_copy_simple(config_setting_t * parent, const config_setting_t * src);
void config_setting_copy_elem(config_setting_t * parent, const config_setting_t * src);

void config_setting_copy_aggregate(config_setting_t * parent, const config_setting_t * src);
int config_setting_copy(config_setting_t * parent, const config_setting_t * src);

void config_setting_copy_simple(config_setting_t * parent, const config_setting_t * src)
{
    if(config_setting_is_aggregate(src))
    {
        config_setting_copy_aggregate(parent, src);
    }
    else 
    {
        config_setting_t * set;
        
        set = config_setting_add(parent, config_setting_name(src), config_setting_type(src));

        if(CONFIG_TYPE_INT == config_setting_type(src))
        {
            config_setting_set_int(set, config_setting_get_int(src));
            config_setting_set_format(set, src->format);
        }
        else if(CONFIG_TYPE_INT64 == config_setting_type(src))
        {
            config_setting_set_int64(set, config_setting_get_int64(src));
            config_setting_set_format(set, src->format);
        }
        else if(CONFIG_TYPE_FLOAT == config_setting_type(src))
            config_setting_set_float(set, config_setting_get_float(src));
        else if(CONFIG_TYPE_STRING == config_setting_type(src))
            config_setting_set_string(set, config_setting_get_string(src));
        else if(CONFIG_TYPE_BOOL == config_setting_type(src))
            config_setting_set_bool(set, config_setting_get_bool(src));
    }
}

void config_setting_copy_elem(config_setting_t * parent, const config_setting_t * src)
{
    config_setting_t * set;
    
    set = NULL;
    if(config_setting_is_aggregate(src))
        config_setting_copy_aggregate(parent, src);
    else if(CONFIG_TYPE_INT == config_setting_type(src))
    {
        set = config_setting_set_int_elem(parent, -1, config_setting_get_int(src));
        config_setting_set_format(set, src->format);
    }
    else if(CONFIG_TYPE_INT64 == config_setting_type(src))
    {
        set = config_setting_set_int64_elem(parent, -1, config_setting_get_int64(src));
        config_setting_set_format(set, src->format);   
    }
    else if(CONFIG_TYPE_FLOAT == config_setting_type(src))
        set = config_setting_set_float_elem(parent, -1, config_setting_get_float(src));
    else if(CONFIG_TYPE_STRING == config_setting_type(src))
        set = config_setting_set_string_elem(parent, -1, config_setting_get_string(src));
    else if(CONFIG_TYPE_BOOL == config_setting_type(src))
        set = config_setting_set_bool_elem(parent, -1, config_setting_get_bool(src));
}

void config_setting_copy_aggregate(config_setting_t * parent, const config_setting_t * src)
{
    config_setting_t * newAgg;
    int i, n;

    newAgg = config_setting_add(parent, config_setting_name(src), config_setting_type(src));
    
    n = config_setting_length(src);    
    for(i = 0; i < n; i++)
    {
        if(config_setting_is_group(src))
        {
            config_setting_copy_simple(newAgg, config_setting_get_elem(src, i));            
        }
        else
        {
            config_setting_copy_elem(newAgg, config_setting_get_elem(src, i));
        }        
    }
}

int config_setting_copy(config_setting_t * parent, const config_setting_t * src)
{
    if((!config_setting_is_group(parent)) &&
       (!config_setting_is_list(parent)))
        return CONFIG_FALSE;

    if(config_setting_is_aggregate(src))
    {
        config_setting_copy_aggregate(parent, src);
    }
    else
    {
        config_setting_copy_simple(parent, src);
    }
    
    return CONFIG_TRUE;
}


//Some sample code

//-----------------------------------------------------------------------------
int main(int argc, char *argv[]) 
//-----------------------------------------------------------------------------
{
    config_t cfgSrc;
    config_t cfgSrcCopy;
    config_t cfgDst;
    

    config_init(&cfgSrc);
    config_init(&cfgSrcCopy);
    config_init(&cfgDst);
    
    if(CONFIG_FALSE == config_read_file(&cfgSrc, "/data/menu/cfgSrc.cfg"))
    {
        fprintf(stderr, "Failed to open cfgSrc.cfg\n");
    }
    if(CONFIG_FALSE == config_read_file(&cfgDst, "/data/menu/cfgDst.cfg"))
    {
        fprintf(stderr, "Failed to open cfgDst.cfg\n");
    }    
    
    /*
    printf("Dump cfgSrc.cfg\n");
    DumpCfgSetting(config_root_setting(&cfgSrc));
    
    printf("Dump cfgDst.cfg\n");
    DumpCfgSetting(config_root_setting(&cfgDst));
    */

    config_setting_t * src;
    config_setting_t * dst;

    dst = config_lookup(&cfgDst, "grp1");

    if((0 != (dst = config_lookup(&cfgDst, "grp1"))) &&
       (0 != (src = config_lookup(&cfgSrc, "application.window"))))
       //(0 != (src = config_lookup(&cfgSrc, "list"))))
       
    {
        if(CONFIG_FALSE == config_setting_copy(dst, src))
        {
            printf("Failed to copy src to dst\n");
        }
    }

    config_setting_copy(config_root_setting(&cfgSrcCopy), config_root_setting(&cfgSrc));

    config_write_file(&cfgDst, "/data/menu/cfgDstMod.cfg");
    config_write_file(&cfgSrcCopy, "/data/menu/cfgSrcCpy.cfg");
    config_write_file(&cfgSrc, "/data/menu/cfgSrcOrig.cfg");

    config_destroy(&cfgSrc);
    config_destroy(&cfgDst);

    return 0;
}