File: read.h

package info (click to toggle)
memtest86%2B 6.10-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,532 kB
  • sloc: ansic: 19,267; asm: 2,027; makefile: 367; sh: 134
file content (26 lines) | stat: -rw-r--r-- 753 bytes parent folder | download | duplicates (4)
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
// SPDX-License-Identifier: GPL-2.0
#ifndef READ_H
#define READ_H
/**
 * \file
 *
 * Provides a function to read a numeric value.
 *
 *//*
 * Copyright (C) 2020-2022 Martin Whitaker.
 */

#include <stdint.h>

/**
 * 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,
 * 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.
 */
uintptr_t read_value(int x, int y, int field_width, int shift);

#endif // READ_H