2020-05-24 15:30:55 -05:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
#ifndef READ_H
|
|
|
|
#define READ_H
|
2022-02-19 10:17:40 -06:00
|
|
|
/**
|
|
|
|
* \file
|
|
|
|
*
|
2020-05-24 15:30:55 -05:00
|
|
|
* Provides a function to read a numeric value.
|
|
|
|
*
|
2022-02-19 13:56:55 -06:00
|
|
|
*//*
|
2022-02-19 10:17:40 -06:00
|
|
|
* Copyright (C) 2020-2022 Martin Whitaker.
|
2020-05-24 15:30:55 -05:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2022-02-19 10:17:40 -06:00
|
|
|
/**
|
2020-05-24 15:30:55 -05:00
|
|
|
* Returns an unsigned numeric value entered on the keyboard. Echoes the
|
|
|
|
* input to the display field located at (row,col), limiting it to field_width
|
|
|
|
* characters. If the entered value is prefixed by "0x", assumes base 16,
|
2020-05-29 14:42:26 -05:00
|
|
|
* otherwise assumes base 10. If the value is suffixed by 'K', 'P', 'M',
|
|
|
|
* 'G', or 'T', the returned value will be scaled by 2^10, 2^12, 2^20,
|
|
|
|
* 2^30, or 2^40 accordingly. The returned value will also be scaled by
|
|
|
|
* 2^shift.
|
2020-05-24 15:30:55 -05:00
|
|
|
*/
|
2020-05-29 14:42:26 -05:00
|
|
|
uintptr_t read_value(int x, int y, int field_width, int shift);
|
2020-05-24 15:30:55 -05:00
|
|
|
|
|
|
|
#endif // READ_H
|