Compare commits
3 Commits
6fe18b3572
...
2cbe9c9492
Author | SHA1 | Date | |
---|---|---|---|
2cbe9c9492 | |||
a33a1c96fa | |||
792f8f1283 |
@ -9,7 +9,9 @@ int isdigit(int c);
|
|||||||
/*
|
/*
|
||||||
int isgraph(int c);
|
int isgraph(int c);
|
||||||
int islower(int c);
|
int islower(int c);
|
||||||
|
*/
|
||||||
int isprint(int c);
|
int isprint(int c);
|
||||||
|
/*
|
||||||
int ispunct(int c);
|
int ispunct(int c);
|
||||||
int isspace(int c);
|
int isspace(int c);
|
||||||
int isupper(int c);
|
int isupper(int c);
|
||||||
|
4
src/ctype/isprint.c
Normal file
4
src/ctype/isprint.c
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
int isprint(int c)
|
||||||
|
{
|
||||||
|
return (32 <= c && c < 127);
|
||||||
|
}
|
@ -1,5 +1,6 @@
|
|||||||
#include "terminal.h"
|
#include "terminal.h"
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
|
#include "ctype.h"
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
@ -50,6 +51,14 @@ void terminal_putentryat(char c, uint8_t color, size_t x, size_t y)
|
|||||||
|
|
||||||
int terminal_putchar(char c)
|
int terminal_putchar(char c)
|
||||||
{
|
{
|
||||||
|
if (c == '\r')
|
||||||
|
terminal_row = 0;
|
||||||
|
else if (c == '\n') {
|
||||||
|
terminal_column = 0;
|
||||||
|
terminal_row++;
|
||||||
|
}
|
||||||
|
if (!isprint(c))
|
||||||
|
return 1;
|
||||||
terminal_putentryat(c, terminal_color, terminal_column, terminal_row);
|
terminal_putentryat(c, terminal_color, terminal_column, terminal_row);
|
||||||
if (++terminal_column == VGA_WIDTH) {
|
if (++terminal_column == VGA_WIDTH) {
|
||||||
terminal_column = 0;
|
terminal_column = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user