Initial import for store (USB experimental project for mass storage)

This commit is contained in:
David Gálvez
2010-10-31 10:01:37 +00:00
parent d5a1713089
commit ebdb8e0d71
44 changed files with 19689 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
/*
* File: ltoa.c
* Purpose: Function normally found in a standard C lib.
*
* Notes: This supports ASCII only!!!
*/
void ltoa(char *buf, long n, unsigned long base)
{
unsigned long un;
char *tmp, ch;
un = n;
if((base == 10) && (n < 0))
{
*buf++ = '-';
un = -n;
}
tmp = buf;
do
{
ch = un % base;
un = un / base;
if(ch <= 9)
ch += '0';
else
ch += 'a' - 10;
*tmp++ = ch;
}
while(un);
*tmp = '\0';
while(tmp > buf)
{
ch = *buf;
*buf++ = *--tmp;
*tmp = ch;
}
}