Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
944 B

  1. // Copyright (c) 1993-1999 Microsoft Corporation
  2. #include "y2.h"
  3. void
  4. cpycode( void )
  5. {
  6. /* copies code between \{ and \} */
  7. int c;
  8. c = unix_getc(finput);
  9. if( c == '\n' )
  10. {
  11. c = unix_getc(finput);
  12. lineno++;
  13. }
  14. writeline(ftable);
  15. while( c>=0 )
  16. {
  17. if( c=='\\' )
  18. if( (c=unix_getc(finput)) == '}' ) return;
  19. else putc('\\', ftable );
  20. if( c=='%' )
  21. if( (c=unix_getc(finput)) == '}' ) return;
  22. else putc('%', ftable );
  23. putc( c , ftable );
  24. if( c == '\n' ) ++lineno;
  25. c = unix_getc(finput);
  26. }
  27. error("eof before %%}" );
  28. }
  29. void writeline(FILE *fh) {
  30. char *psz = infile;
  31. fprintf( fh, "\n#line %d \"", lineno );
  32. psz = infile;
  33. while (*psz) {
  34. putc(*psz, fh);
  35. if (*psz == '\\') {
  36. putc('\\', fh);
  37. }
  38. psz++;
  39. }
  40. fprintf(fh, "\"\n");
  41. }