Example #1
0
void print_chip(const sensors_chip_name *name)
{
	const sensors_feature *feature;
	int i, label_size;

	label_size = get_label_size(name);

	i = 0;
	while ((feature = sensors_get_features(name, &i))) {
		switch (feature->type) {
		case SENSORS_FEATURE_TEMP:
			print_chip_temp(name, feature, label_size);
			break;
		case SENSORS_FEATURE_IN:
			print_chip_in(name, feature, label_size);
			break;
		case SENSORS_FEATURE_FAN:
			print_chip_fan(name, feature, label_size);
			break;
		case SENSORS_FEATURE_VID:
			print_chip_vid(name, feature, label_size);
			break;
		case SENSORS_FEATURE_BEEP_ENABLE:
			print_chip_beep_enable(name, feature, label_size);
			break;
		case SENSORS_FEATURE_POWER:
			print_chip_power(name, feature, label_size);
			break;
		case SENSORS_FEATURE_ENERGY:
			print_chip_energy(name, feature, label_size);
			break;
		case SENSORS_FEATURE_CURR:
			print_chip_curr(name, feature, label_size);
			break;
		case SENSORS_FEATURE_INTRUSION:
			print_chip_intrusion(name, feature, label_size);
			break;
		case SENSORS_FEATURE_HUMIDITY:
			print_chip_humidity(name, feature, label_size);
			break;
		default:
			continue;
		}
	}
}
Example #2
0
int		handle_coding_byte(int cursor, t_vm *vm, int op)
{
	int		i;
	char	*coding_byte;

	cursor += 1;
	coding_byte = ft_itoa_base(vm->memory[ft_loop_memory(cursor)], 2, 0);
	if (ft_strlen(coding_byte) < 8)
		coding_byte = ft_strjoin("0", coding_byte);
	i = 0;
	while (i < 6)
	{
		if (get_argument_type(coding_byte + i) == T_REG)
			cursor += 1;
		if (get_argument_type(coding_byte + i) == T_IND)
			cursor += 2;
		if (get_argument_type(coding_byte + i) == T_DIR)
			cursor += get_label_size(op);
		i = i + 2;
	}
	return (cursor);
}