close_input (); close_output (outfilename);
h_output (const char *infile, const char *define, int extend,	  const char *outfile){  xdrfunc *xdrfuncp;  definition *def;  const char *ifilename;  const char *outfilename;  long tell;  char *guard;  list *l;  open_input (infile, define);  outfilename = extend ? extendfile (infile, outfile) : outfile;  open_output (infile, outfilename);  add_warning ();  ifilename = (infile == NULL) ? "STDIN" : infile;  guard = generate_guard (outfilename ? outfilename : ifilename);  fprintf (fout, "#ifndef _%s\n#define _%s\n\n", guard,	   guard);  fprintf (fout, "#include <rpc/rpc.h>\n\n");  if (mtflag)    {      fprintf (fout, "#include <pthread.h>\n");    }  /* put the C++ support */  if (Cflag && !CCflag)    {      fprintf (fout, "\n#ifdef __cplusplus\n");      fprintf (fout, "extern \"C\" {\n");      fprintf (fout, "#endif\n\n");    }  tell = ftell (fout);  /* print data definitions */  while ((def = get_definition ()) != NULL)    {      print_datadef (def);    }  /* print function declarations.     Do this after data definitions because they might be used as     arguments for functions */  for (l = defined; l != NULL; l = l->next)    {      print_funcdef (l->val);    }  /* Now  print all xdr func declarations */  if (xdrfunc_head != NULL)    {      fprintf (fout, "\n/* the xdr functions */\n");      if (CCflag)	{	  fprintf (fout, "\n#ifdef __cplusplus\n");	  fprintf (fout, "extern \"C\" {\n");	  fprintf (fout, "#endif\n");	}      if (!Cflag)	{	  xdrfuncp = xdrfunc_head;	  while (xdrfuncp != NULL)	    {	      print_xdr_func_def (xdrfuncp->name,				  xdrfuncp->pointerp, 2);	      xdrfuncp = xdrfuncp->next;	    }	}      else	{	  int i;	  for (i = 1; i < 3; ++i)	    {	      if (i == 1)		fprintf (fout, "\n#if defined(__STDC__) || defined(__cplusplus)\n");	      else		fprintf (fout, "\n#else /* K&R C */\n");	      xdrfuncp = xdrfunc_head;	      while (xdrfuncp != NULL)		{		  print_xdr_func_def (xdrfuncp->name,				      xdrfuncp->pointerp, i);		  xdrfuncp = xdrfuncp->next;		}	    }	  fprintf (fout, "\n#endif /* K&R C */\n");	}    }  if (extend && tell == ftell (fout))    {      unlink (outfilename);    }  else if (tblflag)    {      fprintf (fout, rpcgen_table_dcl);    }  if (Cflag)    {      fprintf (fout, "\n#ifdef __cplusplus\n");      fprintf (fout, "}\n");      fprintf (fout, "#endif\n");    }  fprintf (fout, "\n#endif /* !_%s */\n", guard);}