drivers: Factor out std_gvar_array_*().
This commit is contained in:
parent
7bc3cfe6ff
commit
105df67463
|
@ -155,8 +155,7 @@ static int config_list(uint32_t key, GVariant **data,
|
|||
} else {
|
||||
switch (key) {
|
||||
case SR_CONF_DEVICE_OPTIONS:
|
||||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
|
||||
devopts_cg, ARRAY_SIZE(devopts_cg), sizeof(uint32_t));
|
||||
*data = std_gvar_array_u32(devopts_cg, ARRAY_SIZE(devopts_cg));
|
||||
break;
|
||||
case SR_CONF_CURRENT_LIMIT:
|
||||
*data = std_gvar_min_max_step(0.0, 6.0, 0.001);
|
||||
|
|
|
@ -243,9 +243,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
|
|||
break;
|
||||
#if ASIX_SIGMA_WITH_TRIGGER
|
||||
case SR_CONF_TRIGGER_MATCH:
|
||||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
|
||||
trigger_matches, ARRAY_SIZE(trigger_matches),
|
||||
sizeof(int32_t));
|
||||
*data = std_gvar_array_i32(trigger_matches, ARRAY_SIZE(trigger_matches));
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
|
|
|
@ -360,8 +360,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
|
|||
|
||||
switch (key) {
|
||||
case SR_CONF_DEVICE_OPTIONS:
|
||||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
|
||||
devopts_cg, ARRAY_SIZE(devopts_cg), sizeof(uint32_t));
|
||||
*data = std_gvar_array_u32(devopts_cg, ARRAY_SIZE(devopts_cg));
|
||||
break;
|
||||
case SR_CONF_VOLTAGE_TARGET:
|
||||
*data = std_gvar_min_max_step_array(devc->model->channels[channel].voltage);
|
||||
|
|
|
@ -240,8 +240,7 @@ static int config_list(uint32_t key, GVariant **data,
|
|||
if (bl_acme_probe_has_pws(cg))
|
||||
devopts_cg[num_devopts_cg++] = HAS_POWER_OFF;
|
||||
|
||||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
|
||||
devopts_cg, num_devopts_cg, sizeof(uint32_t));
|
||||
*data = std_gvar_array_u32(devopts_cg, num_devopts_cg);
|
||||
break;
|
||||
default:
|
||||
return SR_ERR_NA;
|
||||
|
|
|
@ -248,9 +248,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
|
|||
*data = std_gvar_samplerates_steps(samplerates, ARRAY_SIZE(samplerates));
|
||||
break;
|
||||
case SR_CONF_TRIGGER_MATCH:
|
||||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
|
||||
soft_trigger_matches, ARRAY_SIZE(soft_trigger_matches),
|
||||
sizeof(int32_t));
|
||||
*data = std_gvar_array_i32(soft_trigger_matches, ARRAY_SIZE(soft_trigger_matches));
|
||||
break;
|
||||
default:
|
||||
return SR_ERR_NA;
|
||||
|
|
|
@ -372,9 +372,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
|
|||
case SR_CONF_TRIGGER_MATCH:
|
||||
if (!devc->prof)
|
||||
return SR_ERR_BUG;
|
||||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
|
||||
trigger_matches, devc->prof->num_trigger_matches,
|
||||
sizeof(int32_t));
|
||||
*data = std_gvar_array_i32(trigger_matches, devc->prof->num_trigger_matches);
|
||||
break;
|
||||
default:
|
||||
return SR_ERR_NA;
|
||||
|
|
|
@ -372,18 +372,12 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
|
|||
switch (key) {
|
||||
case SR_CONF_DEVICE_OPTIONS:
|
||||
if (ch->type == SR_CHANNEL_LOGIC)
|
||||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
|
||||
devopts_cg_logic, ARRAY_SIZE(devopts_cg_logic),
|
||||
sizeof(uint32_t));
|
||||
*data = std_gvar_array_u32(devopts_cg_logic, ARRAY_SIZE(devopts_cg_logic));
|
||||
else if (ch->type == SR_CHANNEL_ANALOG) {
|
||||
if (strcmp(cg->name, "Analog") == 0)
|
||||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
|
||||
devopts_cg_analog_group, ARRAY_SIZE(devopts_cg_analog_group),
|
||||
sizeof(uint32_t));
|
||||
*data = std_gvar_array_u32(devopts_cg_analog_group, ARRAY_SIZE(devopts_cg_analog_group));
|
||||
else
|
||||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
|
||||
devopts_cg_analog_channel, ARRAY_SIZE(devopts_cg_analog_channel),
|
||||
sizeof(uint32_t));
|
||||
*data = std_gvar_array_u32(devopts_cg_analog_channel, ARRAY_SIZE(devopts_cg_analog_channel));
|
||||
}
|
||||
else
|
||||
return SR_ERR_BUG;
|
||||
|
|
|
@ -543,9 +543,7 @@ static int config_list(uint32_t key, GVariant **data,
|
|||
*data = std_gvar_samplerates(devc->samplerates, devc->num_samplerates);
|
||||
break;
|
||||
case SR_CONF_TRIGGER_MATCH:
|
||||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
|
||||
soft_trigger_matches, ARRAY_SIZE(soft_trigger_matches),
|
||||
sizeof(int32_t));
|
||||
*data = std_gvar_array_i32(soft_trigger_matches, ARRAY_SIZE(soft_trigger_matches));
|
||||
break;
|
||||
default:
|
||||
return SR_ERR_NA;
|
||||
|
|
|
@ -460,24 +460,18 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
|
|||
|
||||
switch (key) {
|
||||
case SR_CONF_SCAN_OPTIONS:
|
||||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
|
||||
scanopts, ARRAY_SIZE(scanopts), sizeof(uint32_t));
|
||||
*data = std_gvar_array_u32(scanopts, ARRAY_SIZE(scanopts));
|
||||
break;
|
||||
case SR_CONF_DEVICE_OPTIONS:
|
||||
if (cg_type == CG_NONE) {
|
||||
if (model)
|
||||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
|
||||
model->devopts, model->num_devopts, sizeof(uint32_t));
|
||||
*data = std_gvar_array_u32((const uint32_t *)model->devopts, model->num_devopts);
|
||||
else
|
||||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
|
||||
drvopts, ARRAY_SIZE(drvopts), sizeof(uint32_t));
|
||||
*data = std_gvar_array_u32(drvopts, ARRAY_SIZE(drvopts));
|
||||
} else if (cg_type == CG_ANALOG) {
|
||||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
|
||||
model->devopts_cg_analog, model->num_devopts_cg_analog,
|
||||
sizeof(uint32_t));
|
||||
*data = std_gvar_array_u32((const uint32_t *)model->devopts_cg_analog, model->num_devopts_cg_analog);
|
||||
} else {
|
||||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
|
||||
NULL, 0, sizeof(uint32_t));
|
||||
*data = std_gvar_array_u32(NULL, 0);
|
||||
}
|
||||
break;
|
||||
case SR_CONF_COUPLING:
|
||||
|
|
|
@ -476,8 +476,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
|
|||
} else {
|
||||
switch (key) {
|
||||
case SR_CONF_DEVICE_OPTIONS:
|
||||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
|
||||
devopts_cg, ARRAY_SIZE(devopts_cg), sizeof(uint32_t));
|
||||
*data = std_gvar_array_u32(devopts_cg, ARRAY_SIZE(devopts_cg));
|
||||
break;
|
||||
case SR_CONF_COUPLING:
|
||||
*data = g_variant_new_strv(devc->coupling_vals, devc->coupling_tab_size);
|
||||
|
|
|
@ -605,8 +605,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
|
|||
if (!sdi)
|
||||
return SR_ERR_ARG;
|
||||
devc = sdi->priv;
|
||||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT64,
|
||||
devc->profile->buffersizes, NUM_BUFFER_SIZES, sizeof(uint64_t));
|
||||
*data = std_gvar_array_u64(devc->profile->buffersizes, NUM_BUFFER_SIZES);
|
||||
break;
|
||||
case SR_CONF_TIMEBASE:
|
||||
*data = std_gvar_tuple_array(&timebases, ARRAY_SIZE(timebases));
|
||||
|
@ -625,8 +624,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
|
|||
} else {
|
||||
switch (key) {
|
||||
case SR_CONF_DEVICE_OPTIONS:
|
||||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
|
||||
devopts_cg, ARRAY_SIZE(devopts_cg), sizeof(uint32_t));
|
||||
*data = std_gvar_array_u32(devopts_cg, ARRAY_SIZE(devopts_cg));
|
||||
break;
|
||||
case SR_CONF_COUPLING:
|
||||
*data = g_variant_new_strv(coupling, ARRAY_SIZE(coupling));
|
||||
|
|
|
@ -592,8 +592,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
|
|||
case SR_CONF_DEVICE_OPTIONS:
|
||||
if (!cg)
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, NULL, drvopts, devopts);
|
||||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
|
||||
devopts_cg, ARRAY_SIZE(devopts_cg), sizeof(uint32_t));
|
||||
*data = std_gvar_array_u32(devopts_cg, ARRAY_SIZE(devopts_cg));
|
||||
break;
|
||||
case SR_CONF_SAMPLERATE:
|
||||
*data = std_gvar_samplerates(samplerates, ARRAY_SIZE(samplerates));
|
||||
|
@ -605,8 +604,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
|
|||
*data = g_variant_new_strv(trigger_slopes, ARRAY_SIZE(trigger_slopes));
|
||||
break;
|
||||
case SR_CONF_BUFFERSIZE:
|
||||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT64,
|
||||
buffersizes, ARRAY_SIZE(buffersizes), sizeof(uint64_t));
|
||||
*data = std_gvar_array_u64(buffersizes, ARRAY_SIZE(buffersizes));
|
||||
break;
|
||||
case SR_CONF_VDIV:
|
||||
*data = std_gvar_tuple_array(&vdivs, ARRAY_SIZE(vdivs));
|
||||
|
|
|
@ -309,9 +309,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
|
|||
*data = std_gvar_samplerates(sl2_samplerates, ARRAY_SIZE(sl2_samplerates));
|
||||
break;
|
||||
case SR_CONF_TRIGGER_MATCH:
|
||||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
|
||||
trigger_matches, ARRAY_SIZE(trigger_matches),
|
||||
sizeof(int32_t));
|
||||
*data = std_gvar_array_i32(trigger_matches, ARRAY_SIZE(trigger_matches));
|
||||
break;
|
||||
case SR_CONF_LIMIT_SAMPLES:
|
||||
grange[0] = g_variant_new_uint64(0);
|
||||
|
|
|
@ -413,9 +413,7 @@ static int config_list(uint32_t key, GVariant **data,
|
|||
*data = std_gvar_samplerates(samplerates, ARRAY_SIZE(samplerates));
|
||||
break;
|
||||
case SR_CONF_TRIGGER_MATCH:
|
||||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
|
||||
trigger_matches, ARRAY_SIZE(trigger_matches),
|
||||
sizeof(int32_t));
|
||||
*data = std_gvar_array_i32(trigger_matches, ARRAY_SIZE(trigger_matches));
|
||||
break;
|
||||
default:
|
||||
return SR_ERR_NA;
|
||||
|
|
|
@ -381,9 +381,7 @@ static int config_list(uint32_t key, GVariant **data,
|
|||
case SR_CONF_DEVICE_OPTIONS:
|
||||
if (!cg)
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, NULL, drvopts, devopts);
|
||||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
|
||||
devopts_cg_analog, ARRAY_SIZE(devopts_cg_analog),
|
||||
sizeof(uint32_t));
|
||||
*data = std_gvar_array_u32(devopts_cg_analog, ARRAY_SIZE(devopts_cg_analog));
|
||||
break;
|
||||
case SR_CONF_COUPLING:
|
||||
*data = g_variant_new_strv(*model->coupling_options,
|
||||
|
|
|
@ -368,8 +368,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
|
|||
} else {
|
||||
switch (key) {
|
||||
case SR_CONF_DEVICE_OPTIONS:
|
||||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
|
||||
devopts_cg, ARRAY_SIZE(devopts_cg), sizeof(uint32_t));
|
||||
*data = std_gvar_array_u32(devopts_cg, ARRAY_SIZE(devopts_cg));
|
||||
break;
|
||||
case SR_CONF_VOLTAGE_TARGET:
|
||||
*data = std_gvar_min_max_step(0.0, devc->model->max_voltage, 0.001);
|
||||
|
|
|
@ -682,11 +682,9 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
|
|||
switch (key) {
|
||||
case SR_CONF_DEVICE_OPTIONS:
|
||||
if ((ch_idx == 0) || (ch_idx == 1)) /* CH1, CH2 */
|
||||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
|
||||
devopts_cg_ch12, ARRAY_SIZE(devopts_cg_ch12), sizeof(uint32_t));
|
||||
*data = std_gvar_array_u32(devopts_cg_ch12, ARRAY_SIZE(devopts_cg_ch12));
|
||||
else /* Must be CH3 */
|
||||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
|
||||
devopts_cg_ch3, ARRAY_SIZE(devopts_cg_ch3), sizeof(uint32_t));
|
||||
*data = std_gvar_array_u32(devopts_cg_ch3, ARRAY_SIZE(devopts_cg_ch3));
|
||||
break;
|
||||
case SR_CONF_VOLTAGE_TARGET:
|
||||
*data = std_gvar_min_max_step_array(devc->model->channels[ch_idx].voltage);
|
||||
|
|
|
@ -334,9 +334,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
|
|||
*data = std_gvar_samplerates_steps(samplerates, ARRAY_SIZE(samplerates));
|
||||
break;
|
||||
case SR_CONF_TRIGGER_MATCH:
|
||||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
|
||||
trigger_matches, ARRAY_SIZE(trigger_matches),
|
||||
sizeof(int32_t));
|
||||
*data = std_gvar_array_i32(trigger_matches, ARRAY_SIZE(trigger_matches));
|
||||
break;
|
||||
case SR_CONF_PATTERN_MODE:
|
||||
*data = g_variant_new_strv(patterns, ARRAY_SIZE(patterns));
|
||||
|
|
|
@ -344,9 +344,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
|
|||
*data = std_gvar_samplerates_steps(samplerates, ARRAY_SIZE(samplerates));
|
||||
break;
|
||||
case SR_CONF_TRIGGER_MATCH:
|
||||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
|
||||
trigger_matches, ARRAY_SIZE(trigger_matches),
|
||||
sizeof(int32_t));
|
||||
*data = std_gvar_array_i32(trigger_matches, ARRAY_SIZE(trigger_matches));
|
||||
break;
|
||||
case SR_CONF_PATTERN_MODE:
|
||||
*data = g_variant_new_strv(patterns, ARRAY_SIZE(patterns));
|
||||
|
|
|
@ -851,14 +851,12 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
|
|||
if (!cg)
|
||||
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts, devopts);
|
||||
if (cg == devc->digital_group) {
|
||||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
|
||||
NULL, 0, sizeof(uint32_t));
|
||||
*data = std_gvar_array_u32(NULL, 0);
|
||||
return SR_OK;
|
||||
} else {
|
||||
for (i = 0; i < devc->model->analog_channels; i++) {
|
||||
if (cg == devc->analog_groups[i]) {
|
||||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
|
||||
devopts_cg_analog, ARRAY_SIZE(devopts_cg_analog), sizeof(uint32_t));
|
||||
*data = std_gvar_array_u32(devopts_cg_analog, ARRAY_SIZE(devopts_cg_analog));
|
||||
return SR_OK;
|
||||
}
|
||||
}
|
||||
|
@ -873,8 +871,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
|
|||
case SR_CONF_PROBE_FACTOR:
|
||||
if (!cg)
|
||||
return SR_ERR_CHANNEL_GROUP;
|
||||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT64,
|
||||
probe_factor, ARRAY_SIZE(probe_factor), sizeof(uint64_t));
|
||||
*data = std_gvar_array_u64(probe_factor, ARRAY_SIZE(probe_factor));
|
||||
break;
|
||||
case SR_CONF_VDIV:
|
||||
if (!devc)
|
||||
|
|
|
@ -524,9 +524,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
|
|||
*data = g_variant_builder_end(&gvb);
|
||||
break;
|
||||
case SR_CONF_TRIGGER_MATCH:
|
||||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
|
||||
soft_trigger_matches, ARRAY_SIZE(soft_trigger_matches),
|
||||
sizeof(int32_t));
|
||||
*data = std_gvar_array_i32(soft_trigger_matches, ARRAY_SIZE(soft_trigger_matches));
|
||||
break;
|
||||
default:
|
||||
return SR_ERR_NA;
|
||||
|
|
|
@ -562,9 +562,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
|
|||
|
||||
switch (key) {
|
||||
case SR_CONF_DEVICE_OPTIONS:
|
||||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
|
||||
devc->device->devopts_cg, devc->device->num_devopts_cg,
|
||||
sizeof(uint32_t));
|
||||
*data = std_gvar_array_u32(devc->device->devopts_cg, devc->device->num_devopts_cg);
|
||||
break;
|
||||
case SR_CONF_VOLTAGE_TARGET:
|
||||
*data = std_gvar_min_max_step_array(ch_spec->voltage);
|
||||
|
|
|
@ -621,9 +621,7 @@ static int config_list(uint32_t key, GVariant **data,
|
|||
*data = std_gvar_samplerates(devc->model->samplerates, devc->model->num_samplerates);
|
||||
break;
|
||||
case SR_CONF_TRIGGER_MATCH:
|
||||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
|
||||
trigger_matches, ARRAY_SIZE(trigger_matches),
|
||||
sizeof(trigger_matches[0]));
|
||||
*data = std_gvar_array_i32(trigger_matches, ARRAY_SIZE(trigger_matches));
|
||||
break;
|
||||
case SR_CONF_TRIGGER_SOURCE:
|
||||
*data = g_variant_new_strv(trigger_source_names,
|
||||
|
|
|
@ -488,16 +488,12 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
|
|||
|
||||
switch (key) {
|
||||
case SR_CONF_DEVICE_OPTIONS:
|
||||
if (cg_type == CG_ANALOG) {
|
||||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
|
||||
devopts_cg_analog, ARRAY_SIZE(devopts_cg_analog), sizeof(uint32_t));
|
||||
} else if (cg_type == CG_DIGITAL) {
|
||||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
|
||||
devopts_cg_digital, ARRAY_SIZE(devopts_cg_digital), sizeof(uint32_t));
|
||||
} else {
|
||||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
|
||||
NULL, 0, sizeof(uint32_t));
|
||||
}
|
||||
if (cg_type == CG_ANALOG)
|
||||
*data = std_gvar_array_u32(devopts_cg_analog, ARRAY_SIZE(devopts_cg_analog));
|
||||
else if (cg_type == CG_DIGITAL)
|
||||
*data = std_gvar_array_u32(devopts_cg_digital, ARRAY_SIZE(devopts_cg_digital));
|
||||
else
|
||||
*data = std_gvar_array_u32(NULL, 0);
|
||||
break;
|
||||
case SR_CONF_COUPLING:
|
||||
if (cg_type == CG_NONE)
|
||||
|
|
|
@ -409,9 +409,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
|
|||
}
|
||||
break;
|
||||
case SR_CONF_TRIGGER_MATCH:
|
||||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
|
||||
trigger_matches, ARRAY_SIZE(trigger_matches),
|
||||
sizeof(int32_t));
|
||||
*data = std_gvar_array_i32(trigger_matches, ARRAY_SIZE(trigger_matches));
|
||||
break;
|
||||
case SR_CONF_VOLTAGE_THRESHOLD:
|
||||
*data = std_gvar_min_max_step_thresholds(-6.0, 6.0, 0.1);
|
||||
|
|
|
@ -964,6 +964,9 @@ SR_PRIV GVariant *std_gvar_min_max_step(double min, double max, double step);
|
|||
SR_PRIV GVariant *std_gvar_min_max_step_array(const double a[3]);
|
||||
SR_PRIV GVariant *std_gvar_min_max_step_thresholds(const double dmin, const double dmax, const double dstep);
|
||||
|
||||
SR_PRIV GVariant *std_gvar_array_i32(const int32_t *a, unsigned int n);
|
||||
SR_PRIV GVariant *std_gvar_array_u32(const uint32_t *a, unsigned int n);
|
||||
SR_PRIV GVariant *std_gvar_array_u64(const uint64_t *a, unsigned int n);
|
||||
|
||||
/*--- resource.c ------------------------------------------------------------*/
|
||||
|
||||
|
|
18
src/std.c
18
src/std.c
|
@ -646,3 +646,21 @@ SR_PRIV GVariant *std_gvar_min_max_step_thresholds(const double min, const doubl
|
|||
|
||||
return g_variant_builder_end(&gvb);
|
||||
}
|
||||
|
||||
SR_PRIV GVariant *std_gvar_array_i32(const int32_t *a, unsigned int n)
|
||||
{
|
||||
return g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
|
||||
a, n, sizeof(int32_t));
|
||||
}
|
||||
|
||||
SR_PRIV GVariant *std_gvar_array_u32(const uint32_t *a, unsigned int n)
|
||||
{
|
||||
return g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
|
||||
a, n, sizeof(uint32_t));
|
||||
}
|
||||
|
||||
SR_PRIV GVariant *std_gvar_array_u64(const uint64_t *a, unsigned int n)
|
||||
{
|
||||
return g_variant_new_fixed_array(G_VARIANT_TYPE_UINT64,
|
||||
a, n, sizeof(uint64_t));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue