1 //===-- ExternalFunctions.cpp - Implement External Functions --------------===//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains both code to deal with invoking "external" functions, but
11 // also contains code that implements "exported" external functions.
13 // External functions in the interpreter are implemented by
14 // using the system's dynamic loader to look up the address of the function
15 // we want to invoke. If a function is found, then one of the
16 // many lle_* wrapper functions in this file will translate its arguments from
17 // GenericValues to the types the function is actually expecting, before the
18 // function is called.
20 //===----------------------------------------------------------------------===//
22 #include "Interpreter.h"
23 #include "llvm/DerivedTypes.h"
24 #include "llvm/Module.h"
25 #include "llvm/System/DynamicLibrary.h"
26 #include "llvm/Target/TargetData.h"
34 typedef GenericValue (*ExFunc)(FunctionType *, const vector<GenericValue> &);
35 static std::map<const Function *, ExFunc> Functions;
36 static std::map<std::string, ExFunc> FuncNames;
38 static Interpreter *TheInterpreter;
40 static char getTypeID(const Type *Ty) {
41 switch (Ty->getTypeID()) {
42 case Type::VoidTyID: return 'V';
43 case Type::BoolTyID: return 'o';
44 case Type::UByteTyID: return 'B';
45 case Type::SByteTyID: return 'b';
46 case Type::UShortTyID: return 'S';
47 case Type::ShortTyID: return 's';
48 case Type::UIntTyID: return 'I';
49 case Type::IntTyID: return 'i';
50 case Type::ULongTyID: return 'L';
51 case Type::LongTyID: return 'l';
52 case Type::FloatTyID: return 'F';
53 case Type::DoubleTyID: return 'D';
54 case Type::PointerTyID: return 'P';
55 case Type::FunctionTyID: return 'M';
56 case Type::StructTyID: return 'T';
57 case Type::ArrayTyID: return 'A';
58 case Type::OpaqueTyID: return 'O';
63 static ExFunc lookupFunction(const Function *F) {
64 // Function not found, look it up... start by figuring out what the
65 // composite function name should be.
66 std::string ExtName = "lle_";
67 const FunctionType *FT = F->getFunctionType();
68 for (unsigned i = 0, e = FT->getNumContainedTypes(); i != e; ++i)
69 ExtName += getTypeID(FT->getContainedType(i));
70 ExtName += "_" + F->getName();
72 ExFunc FnPtr = FuncNames[ExtName];
75 (ExFunc)(intptr_t)sys::DynamicLibrary::SearchForAddressOfSymbol(ExtName);
77 FnPtr = FuncNames["lle_X_"+F->getName()];
78 if (FnPtr == 0) // Try calling a generic function... if it exists...
79 FnPtr = (ExFunc)(intptr_t)sys::DynamicLibrary::SearchForAddressOfSymbol(
80 ("lle_X_"+F->getName()).c_str());
82 Functions.insert(std::make_pair(F, FnPtr)); // Cache for later
86 GenericValue Interpreter::callExternalFunction(Function *F,
87 const std::vector<GenericValue> &ArgVals) {
88 TheInterpreter = this;
90 // Do a lookup to see if the function is in our cache... this should just be a
91 // deferred annotation!
92 std::map<const Function *, ExFunc>::iterator FI = Functions.find(F);
93 ExFunc Fn = (FI == Functions.end()) ? lookupFunction(F) : FI->second;
95 std::cout << "Tried to execute an unknown external function: "
96 << F->getType()->getDescription() << " " << F->getName() << "\n";
97 if (F->getName() == "__main")
98 return GenericValue();
102 // TODO: FIXME when types are not const!
103 GenericValue Result = Fn(const_cast<FunctionType*>(F->getFunctionType()),
109 //===----------------------------------------------------------------------===//
110 // Functions "exported" to the running application...
112 extern "C" { // Don't add C++ manglings to llvm mangling :)
114 // void putchar(sbyte)
115 GenericValue lle_Vb_putchar(FunctionType *M, const vector<GenericValue> &Args) {
116 std::cout << Args[0].SByteVal;
117 return GenericValue();
121 GenericValue lle_ii_putchar(FunctionType *M, const vector<GenericValue> &Args) {
122 std::cout << ((char)Args[0].IntVal) << std::flush;
126 // void putchar(ubyte)
127 GenericValue lle_VB_putchar(FunctionType *M, const vector<GenericValue> &Args) {
128 std::cout << Args[0].SByteVal << std::flush;
132 // void atexit(Function*)
133 GenericValue lle_X_atexit(FunctionType *M, const vector<GenericValue> &Args) {
134 assert(Args.size() == 1);
135 TheInterpreter->addAtExitHandler((Function*)GVTOP(Args[0]));
142 GenericValue lle_X_exit(FunctionType *M, const vector<GenericValue> &Args) {
143 TheInterpreter->exitCalled(Args[0]);
144 return GenericValue();
148 GenericValue lle_X_abort(FunctionType *M, const vector<GenericValue> &Args) {
150 return GenericValue();
153 // void *malloc(uint)
154 GenericValue lle_X_malloc(FunctionType *M, const vector<GenericValue> &Args) {
155 assert(Args.size() == 1 && "Malloc expects one argument!");
156 return PTOGV(malloc(Args[0].UIntVal));
159 // void *calloc(uint, uint)
160 GenericValue lle_X_calloc(FunctionType *M, const vector<GenericValue> &Args) {
161 assert(Args.size() == 2 && "calloc expects two arguments!");
162 return PTOGV(calloc(Args[0].UIntVal, Args[1].UIntVal));
166 GenericValue lle_X_free(FunctionType *M, const vector<GenericValue> &Args) {
167 assert(Args.size() == 1);
168 free(GVTOP(Args[0]));
169 return GenericValue();
173 GenericValue lle_X_atoi(FunctionType *M, const vector<GenericValue> &Args) {
174 assert(Args.size() == 1);
176 GV.IntVal = atoi((char*)GVTOP(Args[0]));
180 // double pow(double, double)
181 GenericValue lle_X_pow(FunctionType *M, const vector<GenericValue> &Args) {
182 assert(Args.size() == 2);
184 GV.DoubleVal = pow(Args[0].DoubleVal, Args[1].DoubleVal);
188 // double exp(double)
189 GenericValue lle_X_exp(FunctionType *M, const vector<GenericValue> &Args) {
190 assert(Args.size() == 1);
192 GV.DoubleVal = exp(Args[0].DoubleVal);
196 // double sqrt(double)
197 GenericValue lle_X_sqrt(FunctionType *M, const vector<GenericValue> &Args) {
198 assert(Args.size() == 1);
200 GV.DoubleVal = sqrt(Args[0].DoubleVal);
204 // double log(double)
205 GenericValue lle_X_log(FunctionType *M, const vector<GenericValue> &Args) {
206 assert(Args.size() == 1);
208 GV.DoubleVal = log(Args[0].DoubleVal);
212 // double floor(double)
213 GenericValue lle_X_floor(FunctionType *M, const vector<GenericValue> &Args) {
214 assert(Args.size() == 1);
216 GV.DoubleVal = floor(Args[0].DoubleVal);
223 GenericValue lle_X_drand48(FunctionType *M, const vector<GenericValue> &Args) {
224 assert(Args.size() == 0);
226 GV.DoubleVal = drand48();
231 GenericValue lle_X_lrand48(FunctionType *M, const vector<GenericValue> &Args) {
232 assert(Args.size() == 0);
234 GV.IntVal = lrand48();
238 // void srand48(long)
239 GenericValue lle_X_srand48(FunctionType *M, const vector<GenericValue> &Args) {
240 assert(Args.size() == 1);
241 srand48(Args[0].IntVal);
242 return GenericValue();
248 GenericValue lle_X_rand(FunctionType *M, const vector<GenericValue> &Args) {
249 assert(Args.size() == 0);
256 GenericValue lle_X_srand(FunctionType *M, const vector<GenericValue> &Args) {
257 assert(Args.size() == 1);
258 srand(Args[0].UIntVal);
259 return GenericValue();
262 // int puts(const char*)
263 GenericValue lle_X_puts(FunctionType *M, const vector<GenericValue> &Args) {
264 assert(Args.size() == 1);
266 GV.IntVal = puts((char*)GVTOP(Args[0]));
270 // int sprintf(sbyte *, sbyte *, ...) - a very rough implementation to make
272 GenericValue lle_X_sprintf(FunctionType *M, const vector<GenericValue> &Args) {
273 char *OutputBuffer = (char *)GVTOP(Args[0]);
274 const char *FmtStr = (const char *)GVTOP(Args[1]);
277 // printf should return # chars printed. This is completely incorrect, but
278 // close enough for now.
279 GenericValue GV; GV.IntVal = strlen(FmtStr);
282 case 0: return GV; // Null terminator...
283 default: // Normal nonspecial character
284 sprintf(OutputBuffer++, "%c", *FmtStr++);
286 case '\\': { // Handle escape codes
287 sprintf(OutputBuffer, "%c%c", *FmtStr, *(FmtStr+1));
288 FmtStr += 2; OutputBuffer += 2;
291 case '%': { // Handle format specifiers
292 char FmtBuf[100] = "", Buffer[1000] = "";
295 char Last = *FB++ = *FmtStr++;
296 unsigned HowLong = 0;
297 while (Last != 'c' && Last != 'd' && Last != 'i' && Last != 'u' &&
298 Last != 'o' && Last != 'x' && Last != 'X' && Last != 'e' &&
299 Last != 'E' && Last != 'g' && Last != 'G' && Last != 'f' &&
300 Last != 'p' && Last != 's' && Last != '%') {
301 if (Last == 'l' || Last == 'L') HowLong++; // Keep track of l's
302 Last = *FB++ = *FmtStr++;
308 sprintf(Buffer, FmtBuf); break;
310 sprintf(Buffer, FmtBuf, Args[ArgNo++].IntVal); break;
316 TheInterpreter->getModule().getPointerSize()==Module::Pointer64 &&
317 sizeof(long) < sizeof(int64_t)) {
318 // Make sure we use %lld with a 64 bit argument because we might be
319 // compiling LLI on a 32 bit compiler.
320 unsigned Size = strlen(FmtBuf);
321 FmtBuf[Size] = FmtBuf[Size-1];
323 FmtBuf[Size-1] = 'l';
325 sprintf(Buffer, FmtBuf, Args[ArgNo++].ULongVal);
327 sprintf(Buffer, FmtBuf, Args[ArgNo++].IntVal); break;
328 case 'e': case 'E': case 'g': case 'G': case 'f':
329 sprintf(Buffer, FmtBuf, Args[ArgNo++].DoubleVal); break;
331 sprintf(Buffer, FmtBuf, (void*)GVTOP(Args[ArgNo++])); break;
333 sprintf(Buffer, FmtBuf, (char*)GVTOP(Args[ArgNo++])); break;
334 default: std::cout << "<unknown printf code '" << *FmtStr << "'!>";
337 strcpy(OutputBuffer, Buffer);
338 OutputBuffer += strlen(Buffer);
345 // int printf(sbyte *, ...) - a very rough implementation to make output useful.
346 GenericValue lle_X_printf(FunctionType *M, const vector<GenericValue> &Args) {
348 vector<GenericValue> NewArgs;
349 NewArgs.push_back(PTOGV(Buffer));
350 NewArgs.insert(NewArgs.end(), Args.begin(), Args.end());
351 GenericValue GV = lle_X_sprintf(M, NewArgs);
356 static void ByteswapSCANFResults(const char *Fmt, void *Arg0, void *Arg1,
357 void *Arg2, void *Arg3, void *Arg4, void *Arg5,
358 void *Arg6, void *Arg7, void *Arg8) {
359 void *Args[] = { Arg0, Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, 0 };
361 // Loop over the format string, munging read values as appropriate (performs
362 // byteswaps as necessary).
366 // Read any flag characters that may be present...
367 bool Suppress = false;
370 bool LongLong = false; // long long or long double
374 case '*': Suppress = true; break;
375 case 'a': /*Allocate = true;*/ break; // We don't need to track this
376 case 'h': Half = true; break;
377 case 'l': Long = true; break;
379 case 'L': LongLong = true; break;
381 if (Fmt[-1] > '9' || Fmt[-1] < '0') // Ignore field width specs
387 // Read the conversion character
388 if (!Suppress && Fmt[-1] != '%') { // Nothing to do?
393 case 'i': case 'o': case 'u': case 'x': case 'X': case 'n': case 'p':
395 if (Long || LongLong) {
396 Size = 8; Ty = Type::ULongTy;
398 Size = 4; Ty = Type::UShortTy;
400 Size = 4; Ty = Type::UIntTy;
404 case 'e': case 'g': case 'E':
406 if (Long || LongLong) {
407 Size = 8; Ty = Type::DoubleTy;
409 Size = 4; Ty = Type::FloatTy;
413 case 's': case 'c': case '[': // No byteswap needed
423 void *Arg = Args[ArgNo++];
424 memcpy(&GV, Arg, Size);
425 TheInterpreter->StoreValueToMemory(GV, (GenericValue*)Arg, Ty);
432 // int sscanf(const char *format, ...);
433 GenericValue lle_X_sscanf(FunctionType *M, const vector<GenericValue> &args) {
434 assert(args.size() < 10 && "Only handle up to 10 args to sscanf right now!");
437 for (unsigned i = 0; i < args.size(); ++i)
438 Args[i] = (char*)GVTOP(args[i]);
441 GV.IntVal = sscanf(Args[0], Args[1], Args[2], Args[3], Args[4],
442 Args[5], Args[6], Args[7], Args[8], Args[9]);
443 ByteswapSCANFResults(Args[1], Args[2], Args[3], Args[4],
444 Args[5], Args[6], Args[7], Args[8], Args[9], 0);
448 // int scanf(const char *format, ...);
449 GenericValue lle_X_scanf(FunctionType *M, const vector<GenericValue> &args) {
450 assert(args.size() < 10 && "Only handle up to 10 args to scanf right now!");
453 for (unsigned i = 0; i < args.size(); ++i)
454 Args[i] = (char*)GVTOP(args[i]);
457 GV.IntVal = scanf(Args[0], Args[1], Args[2], Args[3], Args[4],
458 Args[5], Args[6], Args[7], Args[8], Args[9]);
459 ByteswapSCANFResults(Args[0], Args[1], Args[2], Args[3], Args[4],
460 Args[5], Args[6], Args[7], Args[8], Args[9]);
465 // int clock(void) - Profiling implementation
466 GenericValue lle_i_clock(FunctionType *M, const vector<GenericValue> &Args) {
467 extern unsigned int clock(void);
468 GenericValue GV; GV.IntVal = clock();
473 //===----------------------------------------------------------------------===//
474 // String Functions...
475 //===----------------------------------------------------------------------===//
477 // int strcmp(const char *S1, const char *S2);
478 GenericValue lle_X_strcmp(FunctionType *M, const vector<GenericValue> &Args) {
479 assert(Args.size() == 2);
481 Ret.IntVal = strcmp((char*)GVTOP(Args[0]), (char*)GVTOP(Args[1]));
485 // char *strcat(char *Dest, const char *src);
486 GenericValue lle_X_strcat(FunctionType *M, const vector<GenericValue> &Args) {
487 assert(Args.size() == 2);
488 return PTOGV(strcat((char*)GVTOP(Args[0]), (char*)GVTOP(Args[1])));
491 // char *strcpy(char *Dest, const char *src);
492 GenericValue lle_X_strcpy(FunctionType *M, const vector<GenericValue> &Args) {
493 assert(Args.size() == 2);
494 return PTOGV(strcpy((char*)GVTOP(Args[0]), (char*)GVTOP(Args[1])));
497 static GenericValue size_t_to_GV (size_t n) {
499 if (sizeof (size_t) == sizeof (uint64_t)) {
502 assert (sizeof (size_t) == sizeof (unsigned int));
508 static size_t GV_to_size_t (GenericValue GV) {
510 if (sizeof (size_t) == sizeof (uint64_t)) {
511 count = (size_t)GV.ULongVal;
513 assert (sizeof (size_t) == sizeof (unsigned int));
514 count = (size_t)GV.UIntVal;
519 // size_t strlen(const char *src);
520 GenericValue lle_X_strlen(FunctionType *M, const vector<GenericValue> &Args) {
521 assert(Args.size() == 1);
522 size_t strlenResult = strlen ((char *) GVTOP (Args[0]));
523 return size_t_to_GV (strlenResult);
526 // char *strdup(const char *src);
527 GenericValue lle_X_strdup(FunctionType *M, const vector<GenericValue> &Args) {
528 assert(Args.size() == 1);
529 return PTOGV(strdup((char*)GVTOP(Args[0])));
532 // char *__strdup(const char *src);
533 GenericValue lle_X___strdup(FunctionType *M, const vector<GenericValue> &Args) {
534 assert(Args.size() == 1);
535 return PTOGV(strdup((char*)GVTOP(Args[0])));
538 // void *memset(void *S, int C, size_t N)
539 GenericValue lle_X_memset(FunctionType *M, const vector<GenericValue> &Args) {
540 assert(Args.size() == 3);
541 size_t count = GV_to_size_t (Args[2]);
542 return PTOGV(memset(GVTOP(Args[0]), Args[1].IntVal, count));
545 // void *memcpy(void *Dest, void *src, size_t Size);
546 GenericValue lle_X_memcpy(FunctionType *M, const vector<GenericValue> &Args) {
547 assert(Args.size() == 3);
548 size_t count = GV_to_size_t (Args[2]);
549 return PTOGV(memcpy((char*)GVTOP(Args[0]), (char*)GVTOP(Args[1]), count));
552 //===----------------------------------------------------------------------===//
554 //===----------------------------------------------------------------------===//
556 // getFILE - Turn a pointer in the host address space into a legit pointer in
557 // the interpreter address space. This is an identity transformation.
558 #define getFILE(ptr) ((FILE*)ptr)
560 // FILE *fopen(const char *filename, const char *mode);
561 GenericValue lle_X_fopen(FunctionType *M, const vector<GenericValue> &Args) {
562 assert(Args.size() == 2);
563 return PTOGV(fopen((const char *)GVTOP(Args[0]),
564 (const char *)GVTOP(Args[1])));
567 // int fclose(FILE *F);
568 GenericValue lle_X_fclose(FunctionType *M, const vector<GenericValue> &Args) {
569 assert(Args.size() == 1);
571 GV.IntVal = fclose(getFILE(GVTOP(Args[0])));
575 // int feof(FILE *stream);
576 GenericValue lle_X_feof(FunctionType *M, const vector<GenericValue> &Args) {
577 assert(Args.size() == 1);
580 GV.IntVal = feof(getFILE(GVTOP(Args[0])));
584 // size_t fread(void *ptr, size_t size, size_t nitems, FILE *stream);
585 GenericValue lle_X_fread(FunctionType *M, const vector<GenericValue> &Args) {
586 assert(Args.size() == 4);
589 result = fread((void*)GVTOP(Args[0]), GV_to_size_t (Args[1]),
590 GV_to_size_t (Args[2]), getFILE(GVTOP(Args[3])));
591 return size_t_to_GV (result);
594 // size_t fwrite(const void *ptr, size_t size, size_t nitems, FILE *stream);
595 GenericValue lle_X_fwrite(FunctionType *M, const vector<GenericValue> &Args) {
596 assert(Args.size() == 4);
599 result = fwrite((void*)GVTOP(Args[0]), GV_to_size_t (Args[1]),
600 GV_to_size_t (Args[2]), getFILE(GVTOP(Args[3])));
601 return size_t_to_GV (result);
604 // char *fgets(char *s, int n, FILE *stream);
605 GenericValue lle_X_fgets(FunctionType *M, const vector<GenericValue> &Args) {
606 assert(Args.size() == 3);
607 return GVTOP(fgets((char*)GVTOP(Args[0]), Args[1].IntVal,
608 getFILE(GVTOP(Args[2]))));
611 // FILE *freopen(const char *path, const char *mode, FILE *stream);
612 GenericValue lle_X_freopen(FunctionType *M, const vector<GenericValue> &Args) {
613 assert(Args.size() == 3);
614 return PTOGV(freopen((char*)GVTOP(Args[0]), (char*)GVTOP(Args[1]),
615 getFILE(GVTOP(Args[2]))));
618 // int fflush(FILE *stream);
619 GenericValue lle_X_fflush(FunctionType *M, const vector<GenericValue> &Args) {
620 assert(Args.size() == 1);
622 GV.IntVal = fflush(getFILE(GVTOP(Args[0])));
626 // int getc(FILE *stream);
627 GenericValue lle_X_getc(FunctionType *M, const vector<GenericValue> &Args) {
628 assert(Args.size() == 1);
630 GV.IntVal = getc(getFILE(GVTOP(Args[0])));
634 // int _IO_getc(FILE *stream);
635 GenericValue lle_X__IO_getc(FunctionType *F, const vector<GenericValue> &Args) {
636 return lle_X_getc(F, Args);
639 // int fputc(int C, FILE *stream);
640 GenericValue lle_X_fputc(FunctionType *M, const vector<GenericValue> &Args) {
641 assert(Args.size() == 2);
643 GV.IntVal = fputc(Args[0].IntVal, getFILE(GVTOP(Args[1])));
647 // int ungetc(int C, FILE *stream);
648 GenericValue lle_X_ungetc(FunctionType *M, const vector<GenericValue> &Args) {
649 assert(Args.size() == 2);
651 GV.IntVal = ungetc(Args[0].IntVal, getFILE(GVTOP(Args[1])));
655 // int ferror (FILE *stream);
656 GenericValue lle_X_ferror(FunctionType *M, const vector<GenericValue> &Args) {
657 assert(Args.size() == 1);
659 GV.IntVal = ferror (getFILE(GVTOP(Args[0])));
663 // int fprintf(FILE *,sbyte *, ...) - a very rough implementation to make output
665 GenericValue lle_X_fprintf(FunctionType *M, const vector<GenericValue> &Args) {
666 assert(Args.size() >= 2);
668 vector<GenericValue> NewArgs;
669 NewArgs.push_back(PTOGV(Buffer));
670 NewArgs.insert(NewArgs.end(), Args.begin()+1, Args.end());
671 GenericValue GV = lle_X_sprintf(M, NewArgs);
673 fputs(Buffer, getFILE(GVTOP(Args[0])));
680 void Interpreter::initializeExternalFunctions() {
681 FuncNames["lle_Vb_putchar"] = lle_Vb_putchar;
682 FuncNames["lle_ii_putchar"] = lle_ii_putchar;
683 FuncNames["lle_VB_putchar"] = lle_VB_putchar;
684 FuncNames["lle_X_exit"] = lle_X_exit;
685 FuncNames["lle_X_abort"] = lle_X_abort;
686 FuncNames["lle_X_malloc"] = lle_X_malloc;
687 FuncNames["lle_X_calloc"] = lle_X_calloc;
688 FuncNames["lle_X_free"] = lle_X_free;
689 FuncNames["lle_X_atoi"] = lle_X_atoi;
690 FuncNames["lle_X_pow"] = lle_X_pow;
691 FuncNames["lle_X_exp"] = lle_X_exp;
692 FuncNames["lle_X_log"] = lle_X_log;
693 FuncNames["lle_X_floor"] = lle_X_floor;
694 FuncNames["lle_X_srand"] = lle_X_srand;
695 FuncNames["lle_X_rand"] = lle_X_rand;
697 FuncNames["lle_X_drand48"] = lle_X_drand48;
698 FuncNames["lle_X_srand48"] = lle_X_srand48;
699 FuncNames["lle_X_lrand48"] = lle_X_lrand48;
701 FuncNames["lle_X_sqrt"] = lle_X_sqrt;
702 FuncNames["lle_X_puts"] = lle_X_puts;
703 FuncNames["lle_X_printf"] = lle_X_printf;
704 FuncNames["lle_X_sprintf"] = lle_X_sprintf;
705 FuncNames["lle_X_sscanf"] = lle_X_sscanf;
706 FuncNames["lle_X_scanf"] = lle_X_scanf;
707 FuncNames["lle_i_clock"] = lle_i_clock;
709 FuncNames["lle_X_strcmp"] = lle_X_strcmp;
710 FuncNames["lle_X_strcat"] = lle_X_strcat;
711 FuncNames["lle_X_strcpy"] = lle_X_strcpy;
712 FuncNames["lle_X_strlen"] = lle_X_strlen;
713 FuncNames["lle_X___strdup"] = lle_X___strdup;
714 FuncNames["lle_X_memset"] = lle_X_memset;
715 FuncNames["lle_X_memcpy"] = lle_X_memcpy;
717 FuncNames["lle_X_fopen"] = lle_X_fopen;
718 FuncNames["lle_X_fclose"] = lle_X_fclose;
719 FuncNames["lle_X_feof"] = lle_X_feof;
720 FuncNames["lle_X_fread"] = lle_X_fread;
721 FuncNames["lle_X_fwrite"] = lle_X_fwrite;
722 FuncNames["lle_X_fgets"] = lle_X_fgets;
723 FuncNames["lle_X_fflush"] = lle_X_fflush;
724 FuncNames["lle_X_fgetc"] = lle_X_getc;
725 FuncNames["lle_X_getc"] = lle_X_getc;
726 FuncNames["lle_X__IO_getc"] = lle_X__IO_getc;
727 FuncNames["lle_X_fputc"] = lle_X_fputc;
728 FuncNames["lle_X_ungetc"] = lle_X_ungetc;
729 FuncNames["lle_X_fprintf"] = lle_X_fprintf;
730 FuncNames["lle_X_freopen"] = lle_X_freopen;