4.104.114.84.95
Last change
on this file since f82c98b was
f82c98b,
checked in by Joel Sherrill <joel.sherrill@…>, on 07/28/99 at 16:14:57
|
Missed adding file from Eric Valette <valette@…>.
This file is necessary because the bootloader is compiled with different
options than the basic C library.
|
-
Property mode set to
100644
|
File size:
1.1 KB
|
Line | |
---|
1 | /* lib.c |
---|
2 | * |
---|
3 | * This file contains the implementation of functions that are unresolved |
---|
4 | * in the bootloader. Unfortunately it shall not use any object code |
---|
5 | * from newlib or rtems because they are not compiled with the right option!!! |
---|
6 | * |
---|
7 | * You've been warned!!!. |
---|
8 | * |
---|
9 | * CopyRight (C) 1998, 1999 valette@crf.canon.fr |
---|
10 | * |
---|
11 | * The license and distribution terms for this file may be |
---|
12 | * found in found in the file LICENSE in this distribution or at |
---|
13 | * http://www.OARcorp.com/rtems/license.html. |
---|
14 | * |
---|
15 | * $Id$ |
---|
16 | */ |
---|
17 | |
---|
18 | |
---|
19 | void* memset(void *p, int c, unsigned int n) |
---|
20 | { |
---|
21 | char *q =p; |
---|
22 | for(; n>0; --n) *q++=c; |
---|
23 | return p; |
---|
24 | } |
---|
25 | |
---|
26 | void* memcpy(void *dst, const void * src, unsigned int n) |
---|
27 | { |
---|
28 | unsigned char *d=dst; |
---|
29 | const unsigned char *s=src; |
---|
30 | |
---|
31 | while(n-- > 0) *d++=*s++; |
---|
32 | return dst; |
---|
33 | } |
---|
34 | |
---|
35 | char* strcat(char * dest, const char * src) |
---|
36 | { |
---|
37 | char *tmp = dest; |
---|
38 | |
---|
39 | while (*dest) |
---|
40 | dest++; |
---|
41 | while ((*dest++ = *src++) != '\0') |
---|
42 | ; |
---|
43 | return tmp; |
---|
44 | } |
---|
45 | |
---|
46 | int strlen(const char* string) |
---|
47 | { |
---|
48 | register int i = 0; |
---|
49 | |
---|
50 | while (string[i] != '\0') |
---|
51 | ++i; |
---|
52 | return i; |
---|
53 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.