vga_getmodenumber3
Return a number for the given video mode
Usage
#include <vga.h>
int vga_getmodenumber(char *name);
Overview
The function parses *name and tries to find a videomode corresponding on it. *name is parsed case insensitive and should be either an integer string just giving a mode number or consist of a capital G followed by the amount of x pixels, followed by a lower case x, followed by the amount of y pixels, followed by a lower case x. Finally the number of different colors is appended. Here the shortcuts 32K,64K,16M, and 16M4 are used for 32768, 65536, and 16777216 are used. The last refers also to 16777216 which are store in 4 bytes (highest address byte unused) for easier screen access.
For unsupported values or the string "PROMPT" the value -1 is returned. Also a irritating error message is printed to stdout. This is used during parsing the SVGALIB_DEFAULT_MODE environment variable. Probably it should not be used for anything else.
Examples
vga_getmodenumber("G640x480x256") returns 10.
Releases
Unchanged in 5 releases since Debian 3.1 (Sarge).