* Implement exit() builtin function
[oota-llvm.git] / tools / lli / RuntimeLib.lc
1 //===-- RuntimeLib.lc - LLVM Standard C Runtime Library -----------*- C -*-===//
2 // 
3 // This file contains definitions of C functions that are useful to get LLVM
4 // programs up and running.  This library of functions is automatically linked
5 // into programs loaded into LLI.
6 //
7 // This file is compiled by the LLVM port of GCC to get LLVM code.
8 //
9 //===----------------------------------------------------------------------===//
10
11 // Prototypes for functions exported by LLI directly.
12 void exit(int Code);
13 int putchar(int);
14
15 // The puts() function writes the string pointed to by s, followed by a 
16 // NEWLINE character, to the standard output stream stdout. On success the 
17 // number of characters written is returned; otherwise they return EOF.
18 //
19 int puts(const char *S) {
20   const char *Str = S;
21   while (*Str) putchar(*Str++);
22   putchar('\n');
23   return Str+1-S;
24 }
25