I'm trying to find a bug within u-boot and have downloaded the source, but I'm only a beginner in c code so am stuck with a question!
In a file called common.h there is a defined function called puts...
Code:
/* stdout */
void putc(const char c);
void puts(const char *s);
int printf(const char *fmt, ...)
__attribute__ ((format (__printf__, 1, 2)));
int vprintf(const char *fmt, va_list args);
The above header file is included in numerous c files... the one I'm interested in is cmd_i2c.c
In the file there is lots of code that uses puts to print various bits of data...
Code:
/*
* memaddr is the address where to store things in memory
*/
memaddr = (u_char *)simple_strtoul(argv[4], NULL, 16);
if (i2c_read(chip, devaddr, alen, memaddr, length) != 0) {
puts ("Error reading the chip.\n");
return 1;
}
return 0;
Where I'm stuck is I can't find where, or if, puts is actually implimented so my questions are.
Does the c language require a function that is defined in a header and used within the c code to be implimented?
If not, I guess I could code it within the cmd_i2c.c to call printf which should then allow me to see the output on the serial.
If it does have to be implimented then can someone help me find out where it is, or give me pointers on how to find its code.