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/Target/TargetData.h"
26 #include "llvm/Support/DynamicLinker.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];
74 FnPtr = (ExFunc)GetAddressOfSymbol(ExtName);
76 FnPtr = FuncNames["lle_X_"+F->getName()];
77 if (FnPtr == 0) // Try calling a generic function... if it exists...
78 FnPtr = (ExFunc)GetAddressOfSymbol(("lle_X_"+F->getName()).c_str());
80 Functions.insert(std::make_pair(F, FnPtr)); // Cache for later
84 GenericValue Interpreter::callExternalFunction(Function *M,
85 const std::vector<GenericValue> &ArgVals) {
86 TheInterpreter = this;
88 // Do a lookup to see if the function is in our cache... this should just be a
89 // deferred annotation!
90 std::map<const Function *, ExFunc>::iterator FI = Functions.find(M);
91 ExFunc Fn = (FI == Functions.end()) ? lookupFunction(M) : FI->second;
93 std::cout << "Tried to execute an unknown external function: "
94 << M->getType()->getDescription() << " " << M->getName() << "\n";
95 return GenericValue();
98 // TODO: FIXME when types are not const!
99 GenericValue Result = Fn(const_cast<FunctionType*>(M->getFunctionType()),
105 //===----------------------------------------------------------------------===//
106 // Functions "exported" to the running application...
108 extern "C" { // Don't add C++ manglings to llvm mangling :)
110 // void putchar(sbyte)
111 GenericValue lle_Vb_putchar(FunctionType *M, const vector<GenericValue> &Args) {
112 std::cout << Args[0].SByteVal;
113 return GenericValue();
117 GenericValue lle_ii_putchar(FunctionType *M, const vector<GenericValue> &Args) {
118 std::cout << ((char)Args[0].IntVal) << std::flush;
122 // void putchar(ubyte)
123 GenericValue lle_VB_putchar(FunctionType *M, const vector<GenericValue> &Args) {
124 std::cout << Args[0].SByteVal << std::flush;
128 // void atexit(Function*)
129 GenericValue lle_X_atexit(FunctionType *M, const vector<GenericValue> &Args) {
130 assert(Args.size() == 1);
131 TheInterpreter->addAtExitHandler((Function*)GVTOP(Args[0]));
138 GenericValue lle_X_exit(FunctionType *M, const vector<GenericValue> &Args) {
139 TheInterpreter->exitCalled(Args[0]);
140 return GenericValue();
144 GenericValue lle_X_abort(FunctionType *M, const vector<GenericValue> &Args) {
146 return GenericValue();
149 // void *malloc(uint)
150 GenericValue lle_X_malloc(FunctionType *M, const vector<GenericValue> &Args) {
151 assert(Args.size() == 1 && "Malloc expects one argument!");
152 return PTOGV(malloc(Args[0].UIntVal));
155 // void *calloc(uint, uint)
156 GenericValue lle_X_calloc(FunctionType *M, const vector<GenericValue> &Args) {
157 assert(Args.size() == 2 && "calloc expects two arguments!");
158 return PTOGV(calloc(Args[0].UIntVal, Args[1].UIntVal));
162 GenericValue lle_X_free(FunctionType *M, const vector<GenericValue> &Args) {
163 assert(Args.size() == 1);
164 free(GVTOP(Args[0]));
165 return GenericValue();
169 GenericValue lle_X_atoi(FunctionType *M, const vector<GenericValue> &Args) {
170 assert(Args.size() == 1);
172 GV.IntVal = atoi((char*)GVTOP(Args[0]));
176 // double pow(double, double)
177 GenericValue lle_X_pow(FunctionType *M, const vector<GenericValue> &Args) {
178 assert(Args.size() == 2);
180 GV.DoubleVal = pow(Args[0].DoubleVal, Args[1].DoubleVal);
184 // double exp(double)
185 GenericValue lle_X_exp(FunctionType *M, const vector<GenericValue> &Args) {
186 assert(Args.size() == 1);
188 GV.DoubleVal = exp(Args[0].DoubleVal);
192 // double sqrt(double)
193 GenericValue lle_X_sqrt(FunctionType *M, const vector<GenericValue> &Args) {
194 assert(Args.size() == 1);
196 GV.DoubleVal = sqrt(Args[0].DoubleVal);
200 // double log(double)
201 GenericValue lle_X_log(FunctionType *M, const vector<GenericValue> &Args) {
202 assert(Args.size() == 1);
204 GV.DoubleVal = log(Args[0].DoubleVal);
208 // double floor(double)
209 GenericValue lle_X_floor(FunctionType *M, const vector<GenericValue> &Args) {
210 assert(Args.size() == 1);
212 GV.DoubleVal = floor(Args[0].DoubleVal);
217 GenericValue lle_X_drand48(FunctionType *M, const vector<GenericValue> &Args) {
218 assert(Args.size() == 0);
220 GV.DoubleVal = drand48();
225 GenericValue lle_X_lrand48(FunctionType *M, const vector<GenericValue> &Args) {
226 assert(Args.size() == 0);
228 GV.IntVal = lrand48();
232 // void srand48(long)
233 GenericValue lle_X_srand48(FunctionType *M, const vector<GenericValue> &Args) {
234 assert(Args.size() == 1);
235 srand48(Args[0].IntVal);
236 return GenericValue();
240 GenericValue lle_X_srand(FunctionType *M, const vector<GenericValue> &Args) {
241 assert(Args.size() == 1);
242 srand(Args[0].UIntVal);
243 return GenericValue();
246 // int puts(const char*)
247 GenericValue lle_X_puts(FunctionType *M, const vector<GenericValue> &Args) {
248 assert(Args.size() == 1);
250 GV.IntVal = puts((char*)GVTOP(Args[0]));
254 // int sprintf(sbyte *, sbyte *, ...) - a very rough implementation to make
256 GenericValue lle_X_sprintf(FunctionType *M, const vector<GenericValue> &Args) {
257 char *OutputBuffer = (char *)GVTOP(Args[0]);
258 const char *FmtStr = (const char *)GVTOP(Args[1]);
261 // printf should return # chars printed. This is completely incorrect, but
262 // close enough for now.
263 GenericValue GV; GV.IntVal = strlen(FmtStr);
266 case 0: return GV; // Null terminator...
267 default: // Normal nonspecial character
268 sprintf(OutputBuffer++, "%c", *FmtStr++);
270 case '\\': { // Handle escape codes
271 sprintf(OutputBuffer, "%c%c", *FmtStr, *(FmtStr+1));
272 FmtStr += 2; OutputBuffer += 2;
275 case '%': { // Handle format specifiers
276 char FmtBuf[100] = "", Buffer[1000] = "";
279 char Last = *FB++ = *FmtStr++;
280 unsigned HowLong = 0;
281 while (Last != 'c' && Last != 'd' && Last != 'i' && Last != 'u' &&
282 Last != 'o' && Last != 'x' && Last != 'X' && Last != 'e' &&
283 Last != 'E' && Last != 'g' && Last != 'G' && Last != 'f' &&
284 Last != 'p' && Last != 's' && Last != '%') {
285 if (Last == 'l' || Last == 'L') HowLong++; // Keep track of l's
286 Last = *FB++ = *FmtStr++;
292 sprintf(Buffer, FmtBuf); break;
294 sprintf(Buffer, FmtBuf, Args[ArgNo++].IntVal); break;
300 TheInterpreter->getModule().getPointerSize()==Module::Pointer64 &&
301 sizeof(long) < sizeof(long long)) {
302 // Make sure we use %lld with a 64 bit argument because we might be
303 // compiling LLI on a 32 bit compiler.
304 unsigned Size = strlen(FmtBuf);
305 FmtBuf[Size] = FmtBuf[Size-1];
307 FmtBuf[Size-1] = 'l';
309 sprintf(Buffer, FmtBuf, Args[ArgNo++].ULongVal);
311 sprintf(Buffer, FmtBuf, Args[ArgNo++].IntVal); break;
312 case 'e': case 'E': case 'g': case 'G': case 'f':
313 sprintf(Buffer, FmtBuf, Args[ArgNo++].DoubleVal); break;
315 sprintf(Buffer, FmtBuf, (void*)GVTOP(Args[ArgNo++])); break;
317 sprintf(Buffer, FmtBuf, (char*)GVTOP(Args[ArgNo++])); break;
318 default: std::cout << "<unknown printf code '" << *FmtStr << "'!>";
321 strcpy(OutputBuffer, Buffer);
322 OutputBuffer += strlen(Buffer);
329 // int printf(sbyte *, ...) - a very rough implementation to make output useful.
330 GenericValue lle_X_printf(FunctionType *M, const vector<GenericValue> &Args) {
332 vector<GenericValue> NewArgs;
333 NewArgs.push_back(PTOGV(Buffer));
334 NewArgs.insert(NewArgs.end(), Args.begin(), Args.end());
335 GenericValue GV = lle_X_sprintf(M, NewArgs);
340 static void ByteswapSCANFResults(const char *Fmt, void *Arg0, void *Arg1,
341 void *Arg2, void *Arg3, void *Arg4, void *Arg5,
342 void *Arg6, void *Arg7, void *Arg8) {
343 void *Args[] = { Arg0, Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, 0 };
345 // Loop over the format string, munging read values as appropriate (performs
346 // byteswaps as necessary).
350 // Read any flag characters that may be present...
351 bool Suppress = false;
354 bool LongLong = false; // long long or long double
358 case '*': Suppress = true; break;
359 case 'a': /*Allocate = true;*/ break; // We don't need to track this
360 case 'h': Half = true; break;
361 case 'l': Long = true; break;
363 case 'L': LongLong = true; break;
365 if (Fmt[-1] > '9' || Fmt[-1] < '0') // Ignore field width specs
371 // Read the conversion character
372 if (!Suppress && Fmt[-1] != '%') { // Nothing to do?
377 case 'i': case 'o': case 'u': case 'x': case 'X': case 'n': case 'p':
379 if (Long || LongLong) {
380 Size = 8; Ty = Type::ULongTy;
382 Size = 4; Ty = Type::UShortTy;
384 Size = 4; Ty = Type::UIntTy;
388 case 'e': case 'g': case 'E':
390 if (Long || LongLong) {
391 Size = 8; Ty = Type::DoubleTy;
393 Size = 4; Ty = Type::FloatTy;
397 case 's': case 'c': case '[': // No byteswap needed
407 void *Arg = Args[ArgNo++];
408 memcpy(&GV, Arg, Size);
409 TheInterpreter->StoreValueToMemory(GV, (GenericValue*)Arg, Ty);
416 // int sscanf(const char *format, ...);
417 GenericValue lle_X_sscanf(FunctionType *M, const vector<GenericValue> &args) {
418 assert(args.size() < 10 && "Only handle up to 10 args to sscanf right now!");
421 for (unsigned i = 0; i < args.size(); ++i)
422 Args[i] = (char*)GVTOP(args[i]);
425 GV.IntVal = sscanf(Args[0], Args[1], Args[2], Args[3], Args[4],
426 Args[5], Args[6], Args[7], Args[8], Args[9]);
427 ByteswapSCANFResults(Args[1], Args[2], Args[3], Args[4],
428 Args[5], Args[6], Args[7], Args[8], Args[9], 0);
432 // int scanf(const char *format, ...);
433 GenericValue lle_X_scanf(FunctionType *M, const vector<GenericValue> &args) {
434 assert(args.size() < 10 && "Only handle up to 10 args to scanf right now!");
437 for (unsigned i = 0; i < args.size(); ++i)
438 Args[i] = (char*)GVTOP(args[i]);
441 GV.IntVal = scanf(Args[0], Args[1], Args[2], Args[3], Args[4],
442 Args[5], Args[6], Args[7], Args[8], Args[9]);
443 ByteswapSCANFResults(Args[0], Args[1], Args[2], Args[3], Args[4],
444 Args[5], Args[6], Args[7], Args[8], Args[9]);
449 // int clock(void) - Profiling implementation
450 GenericValue lle_i_clock(FunctionType *M, const vector<GenericValue> &Args) {
451 extern int clock(void);
452 GenericValue GV; GV.IntVal = clock();
457 //===----------------------------------------------------------------------===//
458 // String Functions...
459 //===----------------------------------------------------------------------===//
461 // int strcmp(const char *S1, const char *S2);
462 GenericValue lle_X_strcmp(FunctionType *M, const vector<GenericValue> &Args) {
463 assert(Args.size() == 2);
465 Ret.IntVal = strcmp((char*)GVTOP(Args[0]), (char*)GVTOP(Args[1]));
469 // char *strcat(char *Dest, const char *src);
470 GenericValue lle_X_strcat(FunctionType *M, const vector<GenericValue> &Args) {
471 assert(Args.size() == 2);
472 return PTOGV(strcat((char*)GVTOP(Args[0]), (char*)GVTOP(Args[1])));
475 // char *strcpy(char *Dest, const char *src);
476 GenericValue lle_X_strcpy(FunctionType *M, const vector<GenericValue> &Args) {
477 assert(Args.size() == 2);
478 return PTOGV(strcpy((char*)GVTOP(Args[0]), (char*)GVTOP(Args[1])));
481 static GenericValue size_t_to_GV (size_t n) {
483 if (sizeof (size_t) == sizeof (uint64_t)) {
486 assert (sizeof (size_t) == sizeof (unsigned int));
492 static size_t GV_to_size_t (GenericValue GV) {
494 if (sizeof (size_t) == sizeof (uint64_t)) {
497 assert (sizeof (size_t) == sizeof (unsigned int));
503 // size_t strlen(const char *src);
504 GenericValue lle_X_strlen(FunctionType *M, const vector<GenericValue> &Args) {
505 assert(Args.size() == 1);
506 size_t strlenResult = strlen ((char *) GVTOP (Args[0]));
507 return size_t_to_GV (strlenResult);
510 // char *strdup(const char *src);
511 GenericValue lle_X_strdup(FunctionType *M, const vector<GenericValue> &Args) {
512 assert(Args.size() == 1);
513 return PTOGV(strdup((char*)GVTOP(Args[0])));
516 // char *__strdup(const char *src);
517 GenericValue lle_X___strdup(FunctionType *M, const vector<GenericValue> &Args) {
518 assert(Args.size() == 1);
519 return PTOGV(strdup((char*)GVTOP(Args[0])));
522 // void *memset(void *S, int C, size_t N)
523 GenericValue lle_X_memset(FunctionType *M, const vector<GenericValue> &Args) {
524 assert(Args.size() == 3);
525 size_t count = GV_to_size_t (Args[2]);
526 return PTOGV(memset(GVTOP(Args[0]), Args[1].IntVal, count));
529 // void *memcpy(void *Dest, void *src, size_t Size);
530 GenericValue lle_X_memcpy(FunctionType *M, const vector<GenericValue> &Args) {
531 assert(Args.size() == 3);
532 size_t count = GV_to_size_t (Args[2]);
533 return PTOGV(memcpy((char*)GVTOP(Args[0]), (char*)GVTOP(Args[1]), count));
536 //===----------------------------------------------------------------------===//
538 //===----------------------------------------------------------------------===//
540 // getFILE - Turn a pointer in the host address space into a legit pointer in
541 // the interpreter address space. This is an identity transformation.
542 #define getFILE(ptr) ((FILE*)ptr)
544 // FILE *fopen(const char *filename, const char *mode);
545 GenericValue lle_X_fopen(FunctionType *M, const vector<GenericValue> &Args) {
546 assert(Args.size() == 2);
547 return PTOGV(fopen((const char *)GVTOP(Args[0]),
548 (const char *)GVTOP(Args[1])));
551 // int fclose(FILE *F);
552 GenericValue lle_X_fclose(FunctionType *M, const vector<GenericValue> &Args) {
553 assert(Args.size() == 1);
555 GV.IntVal = fclose(getFILE(GVTOP(Args[0])));
559 // int feof(FILE *stream);
560 GenericValue lle_X_feof(FunctionType *M, const vector<GenericValue> &Args) {
561 assert(Args.size() == 1);
564 GV.IntVal = feof(getFILE(GVTOP(Args[0])));
568 // size_t fread(void *ptr, size_t size, size_t nitems, FILE *stream);
569 GenericValue lle_X_fread(FunctionType *M, const vector<GenericValue> &Args) {
570 assert(Args.size() == 4);
573 result = fread((void*)GVTOP(Args[0]), GV_to_size_t (Args[1]),
574 GV_to_size_t (Args[2]), getFILE(GVTOP(Args[3])));
575 return size_t_to_GV (result);
578 // size_t fwrite(const void *ptr, size_t size, size_t nitems, FILE *stream);
579 GenericValue lle_X_fwrite(FunctionType *M, const vector<GenericValue> &Args) {
580 assert(Args.size() == 4);
583 result = fwrite((void*)GVTOP(Args[0]), GV_to_size_t (Args[1]),
584 GV_to_size_t (Args[2]), getFILE(GVTOP(Args[3])));
585 return size_t_to_GV (result);
588 // char *fgets(char *s, int n, FILE *stream);
589 GenericValue lle_X_fgets(FunctionType *M, const vector<GenericValue> &Args) {
590 assert(Args.size() == 3);
591 return GVTOP(fgets((char*)GVTOP(Args[0]), Args[1].IntVal,
592 getFILE(GVTOP(Args[2]))));
595 // FILE *freopen(const char *path, const char *mode, FILE *stream);
596 GenericValue lle_X_freopen(FunctionType *M, const vector<GenericValue> &Args) {
597 assert(Args.size() == 3);
598 return PTOGV(freopen((char*)GVTOP(Args[0]), (char*)GVTOP(Args[1]),
599 getFILE(GVTOP(Args[2]))));
602 // int fflush(FILE *stream);
603 GenericValue lle_X_fflush(FunctionType *M, const vector<GenericValue> &Args) {
604 assert(Args.size() == 1);
606 GV.IntVal = fflush(getFILE(GVTOP(Args[0])));
610 // int getc(FILE *stream);
611 GenericValue lle_X_getc(FunctionType *M, const vector<GenericValue> &Args) {
612 assert(Args.size() == 1);
614 GV.IntVal = getc(getFILE(GVTOP(Args[0])));
618 // int _IO_getc(FILE *stream);
619 GenericValue lle_X__IO_getc(FunctionType *F, const vector<GenericValue> &Args) {
620 return lle_X_getc(F, Args);
623 // int fputc(int C, FILE *stream);
624 GenericValue lle_X_fputc(FunctionType *M, const vector<GenericValue> &Args) {
625 assert(Args.size() == 2);
627 GV.IntVal = fputc(Args[0].IntVal, getFILE(GVTOP(Args[1])));
631 // int ungetc(int C, FILE *stream);
632 GenericValue lle_X_ungetc(FunctionType *M, const vector<GenericValue> &Args) {
633 assert(Args.size() == 2);
635 GV.IntVal = ungetc(Args[0].IntVal, getFILE(GVTOP(Args[1])));
639 // int ferror (FILE *stream);
640 GenericValue lle_X_ferror(FunctionType *M, const vector<GenericValue> &Args) {
641 assert(Args.size() == 1);
643 GV.IntVal = ferror (getFILE(GVTOP(Args[0])));
647 // int fprintf(FILE *,sbyte *, ...) - a very rough implementation to make output
649 GenericValue lle_X_fprintf(FunctionType *M, const vector<GenericValue> &Args) {
650 assert(Args.size() >= 2);
652 vector<GenericValue> NewArgs;
653 NewArgs.push_back(PTOGV(Buffer));
654 NewArgs.insert(NewArgs.end(), Args.begin()+1, Args.end());
655 GenericValue GV = lle_X_sprintf(M, NewArgs);
657 fputs(Buffer, getFILE(GVTOP(Args[0])));
664 void Interpreter::initializeExternalFunctions() {
665 FuncNames["lle_Vb_putchar"] = lle_Vb_putchar;
666 FuncNames["lle_ii_putchar"] = lle_ii_putchar;
667 FuncNames["lle_VB_putchar"] = lle_VB_putchar;
668 FuncNames["lle_X_exit"] = lle_X_exit;
669 FuncNames["lle_X_abort"] = lle_X_abort;
670 FuncNames["lle_X_malloc"] = lle_X_malloc;
671 FuncNames["lle_X_calloc"] = lle_X_calloc;
672 FuncNames["lle_X_free"] = lle_X_free;
673 FuncNames["lle_X_atoi"] = lle_X_atoi;
674 FuncNames["lle_X_pow"] = lle_X_pow;
675 FuncNames["lle_X_exp"] = lle_X_exp;
676 FuncNames["lle_X_log"] = lle_X_log;
677 FuncNames["lle_X_floor"] = lle_X_floor;
678 FuncNames["lle_X_srand"] = lle_X_srand;
679 FuncNames["lle_X_drand48"] = lle_X_drand48;
680 FuncNames["lle_X_srand48"] = lle_X_srand48;
681 FuncNames["lle_X_lrand48"] = lle_X_lrand48;
682 FuncNames["lle_X_sqrt"] = lle_X_sqrt;
683 FuncNames["lle_X_puts"] = lle_X_puts;
684 FuncNames["lle_X_printf"] = lle_X_printf;
685 FuncNames["lle_X_sprintf"] = lle_X_sprintf;
686 FuncNames["lle_X_sscanf"] = lle_X_sscanf;
687 FuncNames["lle_X_scanf"] = lle_X_scanf;
688 FuncNames["lle_i_clock"] = lle_i_clock;
690 FuncNames["lle_X_strcmp"] = lle_X_strcmp;
691 FuncNames["lle_X_strcat"] = lle_X_strcat;
692 FuncNames["lle_X_strcpy"] = lle_X_strcpy;
693 FuncNames["lle_X_strlen"] = lle_X_strlen;
694 FuncNames["lle_X___strdup"] = lle_X___strdup;
695 FuncNames["lle_X_memset"] = lle_X_memset;
696 FuncNames["lle_X_memcpy"] = lle_X_memcpy;
698 FuncNames["lle_X_fopen"] = lle_X_fopen;
699 FuncNames["lle_X_fclose"] = lle_X_fclose;
700 FuncNames["lle_X_feof"] = lle_X_feof;
701 FuncNames["lle_X_fread"] = lle_X_fread;
702 FuncNames["lle_X_fwrite"] = lle_X_fwrite;
703 FuncNames["lle_X_fgets"] = lle_X_fgets;
704 FuncNames["lle_X_fflush"] = lle_X_fflush;
705 FuncNames["lle_X_fgetc"] = lle_X_getc;
706 FuncNames["lle_X_getc"] = lle_X_getc;
707 FuncNames["lle_X__IO_getc"] = lle_X__IO_getc;
708 FuncNames["lle_X_fputc"] = lle_X_fputc;
709 FuncNames["lle_X_ungetc"] = lle_X_ungetc;
710 FuncNames["lle_X_fprintf"] = lle_X_fprintf;
711 FuncNames["lle_X_freopen"] = lle_X_freopen;