]> Joshua Wise's Git repositories - netwatch.git/blobdiff - lib/minilib.c
Have a log console -- needs to be refactored
[netwatch.git] / lib / minilib.c
similarity index 79%
rename from grubload/minilib.c
rename to lib/minilib.c
index b9813d7992fae94635eafc6fdc02776de76084cc..f64f3b1d7bf96469a533af0b3bf8198d2a969ea0 100644 (file)
@@ -46,18 +46,35 @@ int strlen(char *c)
        return l;
 }
 
        return l;
 }
 
+void strcpy(unsigned char *a2, unsigned char *a1)
+{
+       do {
+               *(a2++) = *a1;
+       } while (*(a1++));
+}
+
 void puts(char *c)
 {
        putbytes(c, strlen(c));
 }
 
 static char hexarr[] = "0123456789ABCDEF";
 void puts(char *c)
 {
        putbytes(c, strlen(c));
 }
 
 static char hexarr[] = "0123456789ABCDEF";
-void puthex(unsigned long l)
+void tohex(unsigned char *s, unsigned long l)
 {
        int i;
        for (i = 0; i < 8; i++)
        {
 {
        int i;
        for (i = 0; i < 8; i++)
        {
-               putbyte(hexarr[l >> 28]);
+               s[i] = hexarr[l >> 28];
                l <<= 4;
        }
 }
                l <<= 4;
        }
 }
+
+void puthex(unsigned long l)
+{
+       unsigned char d[9];
+       d[8] = 0;
+       tohex(d, l);
+       puts(d);
+}
+
+
This page took 0.027096 seconds and 4 git commands to generate.