+/* printILine - return the readable i-code for this ic */
+/* */
+/* iCodePrint wants a file stream so we need a pipe to fool it */
+/*-----------------------------------------------------------------*/
+static char verbalICode[1024];
+
+char *printILine (iCode *ic) {
+ int filedes[2];
+ FILE *pipeStream;
+ iCodeTable *icTab=getTableEntry(ic->op);
+ int res;
+
+#ifdef _WIN32
+ res = _pipe(filedes, 256, O_BINARY);
+#else
+ res = pipe(filedes);
+#endif
+ assert(res != -1); // forget it
+ if (res == -1)
+ return ""; // return empty line if pipe creation failed
+
+ // stuff the pipe with the readable icode
+ pipeStream=fdopen(filedes[1],"w");
+ icTab->iCodePrint(pipeStream, ic, icTab->printName);
+ // it really needs an extra push
+ fflush(pipeStream);
+ // now swallow it
+ pipeStream=fdopen(filedes[0],"r");
+ fgets(verbalICode, sizeof(verbalICode), pipeStream);
+ // clean up the mess, we'll return here for all icodes!!
+ assert(!close (filedes[0]));
+ assert(!close (filedes[1]));
+ // kill the trailing NL
+ verbalICode[strlen(verbalICode)-1]='\0';
+ // and throw it up
+ return verbalICode;
+}
+
+/*-----------------------------------------------------------------*/
+/* printCLine - return the c-code for this lineno */