Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
triazo
/
kernel
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
3
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
fca15660
authored
Oct 04, 2015
by
malcolm
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Moved strlen to string.h
parent
f98f0cda
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
9 deletions
src/string.c
src/string.h
src/term.c
src/term.h
src/string.c
View file @
fca15660
...
@@ -22,3 +22,10 @@ void itoa(int n, char s[])
...
@@ -22,3 +22,10 @@ void itoa(int n, char s[])
s
[
i
]
=
'\0'
;
s
[
i
]
=
'\0'
;
//reverse(s);
//reverse(s);
}
}
size_t
strlen
(
const
char
*
str
)
{
size_t
ret
=
0
;
while
(
str
[
ret
]
!=
0
)
ret
++
;
return
ret
;
}
src/string.h
View file @
fca15660
...
@@ -4,5 +4,6 @@
...
@@ -4,5 +4,6 @@
void
*
memset
(
void
*
s
,
int
c
,
size_t
n
);
void
*
memset
(
void
*
s
,
int
c
,
size_t
n
);
void
itoa
(
int
n
,
char
s
[]);
void
itoa
(
int
n
,
char
s
[]);
size_t
strlen
(
const
char
*
str
);
#endif
#endif
src/term.c
View file @
fca15660
...
@@ -16,13 +16,6 @@ uint16_t make_vgaentry(char c, uint8_t color) {
...
@@ -16,13 +16,6 @@ uint16_t make_vgaentry(char c, uint8_t color) {
return
c16
|
color16
<<
8
;
return
c16
|
color16
<<
8
;
}
}
size_t
strlen
(
const
char
*
str
)
{
size_t
ret
=
0
;
while
(
str
[
ret
]
!=
0
)
ret
++
;
return
ret
;
}
static
const
size_t
VGA_WIDTH
=
80
;
static
const
size_t
VGA_WIDTH
=
80
;
static
const
size_t
VGA_HEIGHT
=
25
;
static
const
size_t
VGA_HEIGHT
=
25
;
...
...
src/term.h
View file @
fca15660
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
#include <stdint.h>
#include <stdint.h>
#include <stddef.h>
#include <stddef.h>
#include "string.h"
/* Hardware text mode color constants. */
/* Hardware text mode color constants. */
enum
vga_color
{
enum
vga_color
{
COLOR_BLACK
=
0
,
COLOR_BLACK
=
0
,
...
@@ -29,7 +29,6 @@ enum vga_color {
...
@@ -29,7 +29,6 @@ enum vga_color {
uint8_t
make_color
(
enum
vga_color
fg
,
enum
vga_color
bg
);
uint8_t
make_color
(
enum
vga_color
fg
,
enum
vga_color
bg
);
uint16_t
make_vgaentry
(
char
c
,
uint8_t
color
);
uint16_t
make_vgaentry
(
char
c
,
uint8_t
color
);
size_t
strlen
(
const
char
*
str
);
void
terminal_initialize
();
void
terminal_initialize
();
void
terminal_setcolor
(
uint8_t
color
);
void
terminal_setcolor
(
uint8_t
color
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment