Author: stepan Date: 2008-08-19 19:47:18 +0200 (Tue, 19 Aug 2008) New Revision: 3522
Modified: trunk/payloads/libpayload/include/libpayload.h trunk/payloads/libpayload/libc/Makefile.inc trunk/payloads/libpayload/libc/lib.c Log: * add readline() * add fatal()
Signed-off-by: Stefan Reinauer stepan@coresystems.de Signed-off-by: Patrick Georgi patrick.georgi@coresystems.de Acked-by: Jordan Crouse jordan.crouse@amd.com
Modified: trunk/payloads/libpayload/include/libpayload.h =================================================================== --- trunk/payloads/libpayload/include/libpayload.h 2008-08-19 17:46:02 UTC (rev 3521) +++ trunk/payloads/libpayload/include/libpayload.h 2008-08-19 17:47:18 UTC (rev 3522) @@ -298,5 +298,10 @@ /* i386/util.S */ #define abort() halt() void halt(void) __attribute__ ((noreturn)); +void fatal(const char* msg) __attribute__ ((noreturn));
+/* libc/readline.c */ +char * readline(const char * prompt); +int getline(char *buffer, int len) + #endif
Modified: trunk/payloads/libpayload/libc/Makefile.inc =================================================================== --- trunk/payloads/libpayload/libc/Makefile.inc 2008-08-19 17:46:02 UTC (rev 3521) +++ trunk/payloads/libpayload/libc/Makefile.inc 2008-08-19 17:47:18 UTC (rev 3522) @@ -31,3 +31,4 @@ TARGETS-$(CONFIG_LIBC) += libc/malloc.o libc/printf.o libc/console.o libc/string.o TARGETS-$(CONFIG_LIBC) += libc/memory.o libc/ctype.o libc/ipchecksum.o libc/lib.o TARGETS-$(CONFIG_LIBC) += libc/rand.o libc/time.o libc/lar.o libc/exec.o +TARGETS-$(CONFIG_LIBC) += libc/readline.o
Modified: trunk/payloads/libpayload/libc/lib.c =================================================================== --- trunk/payloads/libpayload/libc/lib.c 2008-08-19 17:46:02 UTC (rev 3521) +++ trunk/payloads/libpayload/libc/lib.c 2008-08-19 17:47:18 UTC (rev 3522) @@ -101,3 +101,15 @@ ('A' <= h && h <= 'F') ? (h - 'A' + 10) : \ ('a' <= h && h <= 'f') ? (h - 'a' + 10) : 0); } + +/** + * Enters HALT state, after printing msg + * + * @param msg message to print + */ +void fatal(const char *msg) +{ + printf("%s",msg); + halt(); +} +