OurOS 0.1
Operating System built by McGill Students
 
Loading...
Searching...
No Matches
console.h File Reference
#include <stdint.h>
#include "color.h"

Go to the source code of this file.

Functions

void credrawchar (uint32_t row, uint32_t col)
 Redraws a character.
 
void crefresh (void)
 Refreshes the console's screen.
 
void cclear (color_t color)
 Clears the console's screen.
 
void cclearchar (uint32_t row, uint32_t col, color_t color)
 Clears a cell.
 
void cclearcurchar (color_t color)
 Clears the cell at the cursor's position.
 
void cmovecursor (int32_t rows, int32_t cols)
 Moves the cursor by an offset.
 
void cprint (const char *str, color_t color)
 Prints a string to the console, without a newline.
 
void cprintln (const char *str, color_t color)
 Prints a string to the console followed by a newline.
 
void cputchar (char c, color_t color)
 Prints a character at the cursor's position in the given color.
 
void cputint (int i, color_t color)
 Writes an integer in base 10 at the cursor's position in the given color.
 
void crcursor (void)
 Resets the cursor's position.
 
void csetcursor (uint32_t row, uint32_t col)
 Sets the cursor's position.
 
void csetcol (int32_t col)
 Sets the cursor's column.
 
void csetrow (int32_t row)
 Sets the cursor's row.
 
uint32_t cgetcol (void)
 Gets the cursor's column.
 
uint32_t cgetrow (void)
 Gets the cursor's row.
 

Function Documentation

◆ cclear()

void cclear ( color_t  color)

Clears the console's screen.

Parameters
colorBackground color.

◆ cclearchar()

void cclearchar ( uint32_t  row,
uint32_t  col,
color_t  color 
)

Clears a cell.

Parameters
rowThe row.
colThe column.
colorBackground color.

◆ cclearcurchar()

void cclearcurchar ( color_t  color)

Clears the cell at the cursor's position.

Parameters
colorBackground color.

◆ cgetcol()

uint32_t cgetcol ( void  )

Gets the cursor's column.

Returns
Column.

◆ cgetrow()

uint32_t cgetrow ( void  )

Gets the cursor's row.

Returns
Row.

◆ cmovecursor()

void cmovecursor ( int32_t  rows,
int32_t  cols 
)

Moves the cursor by an offset.

Parameters
rowsNumber of rows.
colsNumber of columns.

◆ cprint()

void cprint ( const char *  str,
color_t  color 
)

Prints a string to the console, without a newline.

Parameters
strString to be printed. Must be null-terminated.
colorForeground color.

◆ cprintln()

void cprintln ( const char *  str,
color_t  color 
)

Prints a string to the console followed by a newline.

Parameters
strString to be printed. Must be null-terminated.
colorForeground color of the text.

◆ cputchar()

void cputchar ( char  c,
color_t  color 
)

Prints a character at the cursor's position in the given color.

Parameters
cCharacter to be written.
colorForeground color of the text.

◆ cputint()

void cputint ( int  i,
color_t  color 
)

Writes an integer in base 10 at the cursor's position in the given color.

Parameters
iInteger to be written.
colorForeground color of the text.

◆ crcursor()

void crcursor ( void  )

Resets the cursor's position.

◆ credrawchar()

void credrawchar ( uint32_t  row,
uint32_t  col 
)

Redraws a character.

Parameters
rowThe row.
colThe column.

◆ crefresh()

void crefresh ( void  )

Refreshes the console's screen.

◆ csetcol()

void csetcol ( int32_t  col)

Sets the cursor's column.

Parameters
colColumn

◆ csetcursor()

void csetcursor ( uint32_t  row,
uint32_t  col 
)

Sets the cursor's position.

Parameters
rowThe row.
colThe column.

◆ csetrow()

void csetrow ( int32_t  row)

Sets the cursor's row.

Parameters
rowRow.