]> Joshua Wise's Git repositories - netwatch.git/blame - grubload/minilib.c
add console.h
[netwatch.git] / grubload / minilib.c
CommitLineData
9b8c947b
JW
1#include "console.h"
2
3void memcpy(unsigned char *a2, unsigned char *a1, int bytes)
4{
5 while (bytes--)
6 *(a2++) = *(a1++);
7}
8
9void memmove(unsigned char *dest, unsigned char *src, int bytes)
10{
11 if ((dest > src) && (dest <= (src + bytes)))
12 {
13 /* do it backwards! */
14 dest += bytes;
15 src += bytes;
16 while (bytes--)
17 *(--dest) = *(--src);
18 } else
19 while (bytes--)
20 *(dest++) = *(src++);
21}
22
23int strlen(char *c)
24{
25 int l = 0;
26 while (*(c++))
27 l++;
28 return l;
29}
30
31void puts(char *c)
32{
33 putbytes(c, strlen(c));
34}
35
36static char hexarr[] = "0123456789ABCDEF";
37void puthex(unsigned long l)
38{
39 int i;
40 for (i = 0; i < 8; i++)
41 {
42 putbyte(hexarr[l >> 28]);
43 l <<= 4;
44 }
45}
This page took 0.029017 seconds and 4 git commands to generate.