Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

CONIO Reference Manual: Tue Aug 3 02:07:03 2004

Download as pdf or txt
Download as pdf or txt
You are on page 1of 31

CONIO Reference Manual

2.0 Generated by Doxygen 1.3.8


Tue Aug 3 02:07:03 2004

Contents
1 2 CONIO Main Page CONIO Namespace Index 2.1 3 CONIO Namespace List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 3 3 5 5 7 7 9 9 13 13 14 15 15 23

CONIO Data Structure Index 3.1 CONIO Data Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

CONIO File Index 4.1 CONIO File List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

CONIO Namespace Documentation 5.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

CONIO Data Structure Documentation 6.1 6.2 char_info Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . text_info Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

CONIO File Documentation 7.1 7.2 conio2.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . constream File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Chapter 1

CONIO Main Page


Borland-style CONIO implementation for MinGW/Dev-C++. Homepage Send any improvements to this library to me, Ill do new release of this devpak. For the example of use, look at example in the Examples\conio\conio_test.c subdirectory of your Dev-C++ directory. Its simple: 1. Include conio2.h. 2. Link with libconio.a (add -lconio parameter to linker).

Functions dened already in MinGWs conio.h


conio2.h automatically includes conio.h. It also provides several #denes so you can use all these functions without underscores.
char* _cgets (char*); int _cprintf (const char*, ...); int _cputs (const char*); int _cscanf (char*, ...); int int int int int int int int int int _getch (void); _getche (void); _kbhit (void); _putch (int); _ungetch (int); getch (void); getche (void); kbhit (void); putch (int); ungetch (int);

Author: Hongli Lai <hongli@telekabel.nl> tkorrovi <tkorrovi@altavista.net> on 2002/02/26. Andrew Westcott <ajwestco@users.sourceforge.net> Michal Molhanec <michal@molhanec.net>

2 Version: 2.0

CONIO Main Page

Generated on Tue Aug 3 02:07:03 2004 for CONIO by Doxygen

Chapter 2

CONIO Namespace Index


2.1 CONIO Namespace List
9

Here is a list of all documented namespaces with brief descriptions: conio (This namespace contain all C++ specic things ) . . . . . . . . . . . . . . . . . . . . . .

CONIO Namespace Index

Generated on Tue Aug 3 02:07:03 2004 for CONIO by Doxygen

Chapter 3

CONIO Data Structure Index


3.1 CONIO Data Structures
13 14

Here are the data structures with brief descriptions: char_info (Structure used by gettext/puttext ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . text_info (Structure holding information about screen ) . . . . . . . . . . . . . . . . . . . . . .

CONIO Data Structure Index

Generated on Tue Aug 3 02:07:03 2004 for CONIO by Doxygen

Chapter 4

CONIO File Index


4.1 CONIO File List
15 23

Here is a list of all documented les with brief descriptions: conio2.h (A conio implementation for Mingw/Dev-C++ ) . . . . . . . . . . . . . . . . . . . . . constream (A constream implementation for Mingw/Dev-C++ ) . . . . . . . . . . . . . . . . . .

CONIO File Index

Generated on Tue Aug 3 02:07:03 2004 for CONIO by Doxygen

Chapter 5

CONIO Namespace Documentation


5.1
This namespace contain all C++ specic things.

Functions
_Setxy setxy (int x, int y)
setxy manipulator

_Setclr setclr (int color)


setclr manipulator

_Setbk setbk (int color)


setbk manipulator

_Setattr setattr (int _attr)


setattr manipulator

_Setcrsrtype setcrsrtype (int type)


setcrsrtype manipulator

std::ostream & clrscr (std::ostream &o)


clrscr manipulator

std::ostream & clreol (std::ostream &o)


clreol manipulator

std::ostream & highvideo (std::ostream &o)


highvideo manipulator

std::ostream & lowvideo (std::ostream &o)


lowvideo manipulator

std::ostream & normvideo (std::ostream &o)

10
normvideo manipulator

CONIO Namespace Documentation

std::ostream & delline (std::ostream &o)


delline manipulator

std::ostream & insline (std::ostream &o)


insline manipulator

5.1.1

Detailed Description

This namespace contain all C++ specic things.

5.1.2
5.1.2.1

Function Documentation
std::ostream& clreol (std::ostream & o) [inline]

clreol manipulator See also: clreol(void)

5.1.2.2

std::ostream& clrscr (std::ostream & o) [inline]

clrscr manipulator See also: clrscr(void)

5.1.2.3

std::ostream& delline (std::ostream & o) [inline]

delline manipulator See also: delline(void)

5.1.2.4

std::ostream& highvideo (std::ostream & o) [inline]

highvideo manipulator See also: highvideo(void)

Generated on Tue Aug 3 02:07:03 2004 for CONIO by Doxygen

5.1 5.1.2.5 std::ostream& insline (std::ostream & o) [inline]

11

insline manipulator See also: insline(void)

5.1.2.6

std::ostream& lowvideo (std::ostream & o) [inline]

lowvideo manipulator See also: lowvideo(void)

5.1.2.7

std::ostream& normvideo (std::ostream & o) [inline]

normvideo manipulator See also: normvideo(void)

5.1.2.8

_Setattr setattr (int _attr) [inline]

setattr manipulator See also: textattr

5.1.2.9

_Setbk setbk (int color) [inline]

setbk manipulator See also: textbackground

5.1.2.10

_Setclr setclr (int color) [inline]

setclr manipulator See also: textcolor

Generated on Tue Aug 3 02:07:03 2004 for CONIO by Doxygen

12 5.1.2.11 _Setcrsrtype setcrsrtype (int type) [inline]

CONIO Namespace Documentation

setcrsrtype manipulator See also: _setcursortype

5.1.2.12

_Setxy setxy (int x, int y) [inline]

setxy manipulator See also: gotoxy

Generated on Tue Aug 3 02:07:03 2004 for CONIO by Doxygen

Chapter 6

CONIO Data Structure Documentation


6.1 char_info Struct Reference

Structure used by gettext/puttext. #include <conio2.h>

Data Fields
char letter
character value

unsigned short attr


attribute value

6.1.1

Detailed Description

Structure used by gettext/puttext. See also: _conio_gettext puttext The documentation for this struct was generated from the following le: conio2.h

14

CONIO Data Structure Documentation

6.2

text_info Struct Reference

Structure holding information about screen. #include <conio2.h>

Data Fields
unsigned char curx
cursor coordinate x

unsigned char cury


cursor coordinate y

unsigned short attribute


current text attribute

unsigned short normattr


original value of text attribute after start of the application

unsigned char screenwidth


screen width

unsigned char screenheight


screen height

6.2.1

Detailed Description

Structure holding information about screen. See also: gettextinfo inittextinfo

6.2.2
6.2.2.1

Field Documentation
unsigned short text_info::normattr

original value of text attribute after start of the application If you dont called the inittextinfo on the beginning of the application, this always will be black background and light gray foreground The documentation for this struct was generated from the following le: conio2.h

Generated on Tue Aug 3 02:07:03 2004 for CONIO by Doxygen

Chapter 7

CONIO File Documentation


7.1 conio2.h File Reference

A conio implementation for Mingw/Dev-C++. #include <conio.h>

Data Structures
struct text_info
Structure holding information about screen.

struct char_info
Structure used by gettext/puttext.

Cursor types
Predened cursor types. #dene _NOCURSOR 0
no cursor

#dene _SOLIDCURSOR 100


cursor lling whole cell

#dene _NORMALCURSOR 20
cursor lling 20 percent of cell height

Denes
#dene gettext _conio_gettext
Dene alias for _conio_gettext.

16

CONIO File Documentation

Enumerations
enum COLORS { BLACK, BLUE, GREEN, CYAN, RED, MAGENTA, BROWN, LIGHTGRAY, DARKGRAY, LIGHTBLUE, LIGHTGREEN, LIGHTCYAN, LIGHTRED, LIGHTMAGENTA, YELLOW, WHITE }
Colors which you can use in your application.

Functions
void gettextinfo (struct text_info info)
Returns information of the screen.

void inittextinfo (void)


Call this if you need real value of normattr attribute in the text_info structure.

void clreol (void)


Clears rest of the line from cursor position to the end of line without moving the cursor.

void clrscr (void)


Clears whole screen.

void delline (void)


Delete the current line (line on which is cursor) and then moves all lines below one line up.

void insline (void)


Insert blank line at the cursor position.

void _conio_gettext (int left, int top, int right, int bottom, struct char_info buf)
Gets text from the screen.

void puttext (int left, int top, int right, int bottom, struct char_info buf)
Puts text back to the screen.

void movetext (int left, int top, int right, int bottom, int destleft, int desttop)
Copies text.

void gotoxy (int x, int y)


Moves cursor to the specied position.

void cputsxy (int x, int y, char str)


Puts string at the specied position.

void putchxy (int x, int y, char ch)


Puts char at the specied position.

void _setcursortype (int type)


Generated on Tue Aug 3 02:07:03 2004 for CONIO by Doxygen

7.1 conio2.h File Reference


Sets the cursor type.

17

void textattr (int _attr)


Sets attribute of text.

void normvideo (void)


Sets text attribute back to value it had after program start.

void textbackground (int color)


Sets text background color.

void textcolor (int color)


Sets text foreground color.

int wherex (void)


Reads the cursor X position.

int wherey (void)


Reads the cursor Y position.

char getpass (const char prompt, char str)


Reads password.

void highvideo (void)


Makes foreground colors light.

void lowvideo (void)


Makes foreground colors dark.

7.1.1

Detailed Description

A conio implementation for Mingw/Dev-C++. Written by: Hongli Lai <hongli@telekabel.nl> tkorrovi <tkorrovi@altavista.net> on 2002/02/26. Andrew Westcott <ajwestco@users.sourceforge.net> Michal Molhanec <michal@molhanec.net> Offered for use in the public domain without any warranty.

7.1.2
7.1.2.1

Dene Documentation
#dene gettext _conio_gettext

Dene alias for _conio_gettext. If you want to use gettext function from some other library (e.g. GNU gettext) you have to dene _CONIO_NO_GETTEXT_ so you wont get name conict.
Generated on Tue Aug 3 02:07:03 2004 for CONIO by Doxygen

18

CONIO File Documentation

7.1.3
7.1.3.1

Enumeration Type Documentation


enum COLORS

Colors which you can use in your application. Enumeration values: BLACK black color BLUE blue color GREEN green color CYAN cyan color RED red color MAGENTA magenta color BROWN brown color LIGHTGRAY light gray color DARKGRAY dark gray color LIGHTBLUE light blue color LIGHTGREEN light green color LIGHTCYAN light cyan color LIGHTRED light red color LIGHTMAGENTA light magenta color YELLOW yellow color WHITE white color

7.1.4
7.1.4.1

Function Documentation
void _conio_gettext (int left, int top, int right, int bottom, struct char_info buf)

Gets text from the screen. If you havent dened _CONIO_NO_GETTEXT_ prior to including conio2.h you can use this function also under the gettext name. See also: char_info puttext Parameters: left Left coordinate of the rectangle, inclusive, starting from 1. top Top coordinate of the rectangle, inclusive, starting from 1. right Right coordinate of the rectangle, inclusive, starting from 1. bottom Bottom coordinate of the rectangle, inclusive, starting from 1. buf You have to pass buffer of size (right - left + 1) (bottom - top + 1) sizeof(char_info).

Generated on Tue Aug 3 02:07:03 2004 for CONIO by Doxygen

7.1 conio2.h File Reference 7.1.4.2 void _setcursortype (int type)

19

Sets the cursor type. See also: cursortypes Parameters: type cursor type, under Win32 it is height of the cursor in percents

7.1.4.3

void cputsxy (int x, int y, char str)

Puts string at the specied position. Parameters: x horizontal position y vertical position str string

7.1.4.4

void delline (void)

Delete the current line (line on which is cursor) and then moves all lines below one line up. Lines below the line are moved one line up. 7.1.4.5 char getpass (const char prompt, char str)

Reads password. This function behaves like cgets. See also: cgets Parameters: prompt prompt which will be displayed to user str string for the password. str[0] have to contain length of the str - 3 Returns: &str[2], the password will be stored in str beginning at str[2], in str[1] will be length of the string without \0, at str[2 + str[1]] will be \0.

7.1.4.6

void gettextinfo (struct text_info info)

Returns information of the screen. See also: text_info

Generated on Tue Aug 3 02:07:03 2004 for CONIO by Doxygen

20 7.1.4.7 void gotoxy (int x, int y)

CONIO File Documentation

Moves cursor to the specied position. Parameters: x horizontal position y vertical position

7.1.4.8

void highvideo (void)

Makes foreground colors light. If the current foreground color is less than DARKGRAY adds 8 to the its value making dark colors light. See also: COLORS lowvideo

7.1.4.9

void inittextinfo (void)

Call this if you need real value of normattr attribute in the text_info structure. See also: text_info

7.1.4.10

void insline (void)

Insert blank line at the cursor position. Original content of the line and content of lines below moves one line down. The last line is deleted. 7.1.4.11 void lowvideo (void)

Makes foreground colors dark. If the current foreground color is higher than LIGHTGRAY substracts 8 from its value making light colors dark. See also: COLORS highvideo

7.1.4.12

void movetext (int left, int top, int right, int bottom, int destleft, int desttop)

Copies text. Parameters: left Left coordinate of the rectangle, inclusive, starting from 1.
Generated on Tue Aug 3 02:07:03 2004 for CONIO by Doxygen

7.1 conio2.h File Reference top Top coordinate of the rectangle, inclusive, starting from 1. right Right coordinate of the rectangle, inclusive, starting from 1. bottom Bottom coordinate of the rectangle, inclusive, starting from 1. destleft Left coordinate of the destination rectangle. desttop Top coordinate of the destination rectangle.

21

7.1.4.13

void normvideo (void)

Sets text attribute back to value it had after program start. It uses text_infos normattr value. See also: text_info

7.1.4.14

void putchxy (int x, int y, char ch)

Puts char at the specied position. Parameters: x horizontal position y vertical position ch char

7.1.4.15

void puttext (int left, int top, int right, int bottom, struct char_info buf)

Puts text back to the screen. See also: char_info _conio_gettext Parameters: left Left coordinate of the rectangle, inclusive, starting from 1. top Top coordinate of the rectangle, inclusive, starting from 1. right Right coordinate of the rectangle, inclusive, starting from 1. bottom Bottom coordinate of the rectangle, inclusive, starting from 1. buf You have to pass buffer of size (right - left + 1) (bottom - top + 1) sizeof(char_info).

7.1.4.16

void textattr (int _attr)

Sets attribute of text. Parameters: _attr new text attribute

Generated on Tue Aug 3 02:07:03 2004 for CONIO by Doxygen

22 7.1.4.17 void textbackground (int color)

CONIO File Documentation

Sets text background color. See also: COLORS Parameters: color new background color

7.1.4.18

void textcolor (int color)

Sets text foreground color. See also: COLORS Parameters: color new foreground color

7.1.4.19

int wherex (void)

Reads the cursor X position. Returns: cursor X position

7.1.4.20

int wherey (void)

Reads the cursor Y position. Returns: cursor Y position

Generated on Tue Aug 3 02:07:03 2004 for CONIO by Doxygen

7.2 constream File Reference

23

7.2

constream File Reference

A constream implementation for Mingw/Dev-C++. #include <iostream> #include "conio2.h"

Namespaces
namespace conio

Functions
_Setxy setxy (int x, int y)
setxy manipulator

_Setclr setclr (int color)


setclr manipulator

_Setbk setbk (int color)


setbk manipulator

_Setattr setattr (int _attr)


setattr manipulator

_Setcrsrtype setcrsrtype (int type)


setcrsrtype manipulator

std::ostream & clrscr (std::ostream &o)


clrscr manipulator

std::ostream & clreol (std::ostream &o)


clreol manipulator

std::ostream & highvideo (std::ostream &o)


highvideo manipulator

std::ostream & lowvideo (std::ostream &o)


lowvideo manipulator

std::ostream & normvideo (std::ostream &o)


normvideo manipulator

std::ostream & delline (std::ostream &o)


delline manipulator

std::ostream & insline (std::ostream &o)


insline manipulator

Generated on Tue Aug 3 02:07:03 2004 for CONIO by Doxygen

24

CONIO File Documentation

7.2.1

Detailed Description

A constream implementation for Mingw/Dev-C++. Warning: There is not implemented constream class, only manipulators for iostream, so use them on cin/cout. Author: Michal Molhanec <michal@molhanec.net> Offered for use in the public domain without any warranty.

7.2.2
7.2.2.1

Function Documentation
std::ostream& clreol (std::ostream & o) [inline]

clreol manipulator See also: clreol(void)

7.2.2.2

std::ostream& clrscr (std::ostream & o) [inline]

clrscr manipulator See also: clrscr(void)

7.2.2.3

std::ostream& delline (std::ostream & o) [inline]

delline manipulator See also: delline(void)

7.2.2.4

std::ostream& highvideo (std::ostream & o) [inline]

highvideo manipulator See also: highvideo(void)

7.2.2.5

std::ostream& insline (std::ostream & o) [inline]

insline manipulator See also: insline(void)

Generated on Tue Aug 3 02:07:03 2004 for CONIO by Doxygen

7.2 constream File Reference 7.2.2.6 std::ostream& lowvideo (std::ostream & o) [inline]

25

lowvideo manipulator See also: lowvideo(void)

7.2.2.7

std::ostream& normvideo (std::ostream & o) [inline]

normvideo manipulator See also: normvideo(void)

7.2.2.8

_Setattr setattr (int _attr) [inline]

setattr manipulator See also: textattr

7.2.2.9

_Setbk setbk (int color) [inline]

setbk manipulator See also: textbackground

7.2.2.10

_Setclr setclr (int color) [inline]

setclr manipulator See also: textcolor

7.2.2.11

_Setcrsrtype setcrsrtype (int type) [inline]

setcrsrtype manipulator See also: _setcursortype

7.2.2.12

_Setxy setxy (int x, int y) [inline]

setxy manipulator See also: gotoxy

Generated on Tue Aug 3 02:07:03 2004 for CONIO by Doxygen

Index
_conio_gettext conio2.h, 18 _setcursortype conio2.h, 18 BLACK conio2.h, 18 BLUE conio2.h, 18 BROWN conio2.h, 18 char_info, 13 clreol conio, 10 constream, 24 clrscr conio, 10 constream, 24 COLORS conio2.h, 18 conio, 9 clreol, 10 clrscr, 10 delline, 10 highvideo, 10 insline, 10 lowvideo, 11 normvideo, 11 setattr, 11 setbk, 11 setclr, 11 setcrsrtype, 11 setxy, 12 conio2.h, 15 _conio_gettext, 18 _setcursortype, 18 BLACK, 18 BLUE, 18 BROWN, 18 COLORS, 18 cputsxy, 19 CYAN, 18 DARKGRAY, 18 delline, 19 getpass, 19 gettext, 17 gettextinfo, 19 gotoxy, 19 GREEN, 18 highvideo, 20 inittextinfo, 20 insline, 20 LIGHTBLUE, 18 LIGHTCYAN, 18 LIGHTGRAY, 18 LIGHTGREEN, 18 LIGHTMAGENTA, 18 LIGHTRED, 18 lowvideo, 20 MAGENTA, 18 movetext, 20 normvideo, 21 putchxy, 21 puttext, 21 RED, 18 textattr, 21 textbackground, 21 textcolor, 22 wherex, 22 wherey, 22 WHITE, 18 YELLOW, 18 constream, 23 clreol, 24 clrscr, 24 delline, 24 highvideo, 24 insline, 24 lowvideo, 24 normvideo, 25 setattr, 25 setbk, 25 setclr, 25 setcrsrtype, 25 setxy, 25 cputsxy conio2.h, 19 CYAN conio2.h, 18

INDEX DARKGRAY conio2.h, 18 delline conio, 10 conio2.h, 19 constream, 24 getpass conio2.h, 19 gettext conio2.h, 17 gettextinfo conio2.h, 19 gotoxy conio2.h, 19 GREEN conio2.h, 18 highvideo conio, 10 conio2.h, 20 constream, 24 inittextinfo conio2.h, 20 insline conio, 10 conio2.h, 20 constream, 24 LIGHTBLUE conio2.h, 18 LIGHTCYAN conio2.h, 18 LIGHTGRAY conio2.h, 18 LIGHTGREEN conio2.h, 18 LIGHTMAGENTA conio2.h, 18 LIGHTRED conio2.h, 18 lowvideo conio, 11 conio2.h, 20 constream, 24 MAGENTA conio2.h, 18 movetext conio2.h, 20 normattr text_info, 14 normvideo
Generated on Tue Aug 3 02:07:03 2004 for CONIO by Doxygen

27 conio, 11 conio2.h, 21 constream, 25 putchxy conio2.h, 21 puttext conio2.h, 21 RED conio2.h, 18 setattr conio, 11 constream, 25 setbk conio, 11 constream, 25 setclr conio, 11 constream, 25 setcrsrtype conio, 11 constream, 25 setxy conio, 12 constream, 25 text_info, 14 normattr, 14 textattr conio2.h, 21 textbackground conio2.h, 21 textcolor conio2.h, 22 wherex conio2.h, 22 wherey conio2.h, 22 WHITE conio2.h, 18 YELLOW conio2.h, 18

You might also like