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.

56 lines
973 B

  1. #include <windows.h>
  2. #include <winspool.h>
  3. //#include <winsplp.h>
  4. #include <stdio.h>
  5. #include <process.h>
  6. #include <string.h>
  7. #include "psshmem.h"
  8. #include "psprint.h"
  9. #define CHAR_COUNT 1000
  10. //int _cdecl main(int argc, char **argv)
  11. int __cdecl main( int argc, char **argv)
  12. {
  13. FILE *x_in;
  14. FILE *x_out;
  15. int x;
  16. int xx;
  17. int col=0;
  18. x_in = fopen( argv[1],"rb" );
  19. x_out = fopen( argv[2],"wb");
  20. x = fgetc( x_in);
  21. while (!feof(x_in)) {
  22. fputc(x, x_out);
  23. #ifdef BREAK_AT_SPACE
  24. if (col == 50) {
  25. col = -1;
  26. }
  27. if (col < 0 ) {
  28. if (x == 0x20) {
  29. fputc(0x0d,x_out);
  30. fputc(0x0a,x_out);
  31. col = 0;
  32. }
  33. }else{
  34. col++;
  35. }
  36. #endif
  37. xx = fgetc(x_in);
  38. if (x == 0x0d && xx != 0x0a && !feof(x_in)) {
  39. fputc( 0x0a, x_out);
  40. }
  41. x = xx;
  42. }
  43. fclose(x_in);
  44. fclose(x_out);
  45. }