1 /* $Id: dbgprint.c 24720 2006-11-11 16:07:35Z janderwald $
3 * PROJECT: ReactOS DbgPrint Utility
4 * LICENSE: GPL - See COPYING in the top level directory
5 * FILE: tools/dbgprint/dbgprint.c
6 * PURPOSE: outputs a text via DbgPrint API
7 * PROGRAMMERS: Johannes Anderwald (johannes.anderwald@student.tugraz.at)
8 * Christoph von Wittich (Christoph_vW@ReactOS.org)
16 int _tmain(int argc
, TCHAR
** argv
)
24 for(i
= 1; i
< argc
; i
++)
26 bufsize
+= _tcslen(argv
[i
]) + 1;
34 if (_tcsstr(argv
[1], "--winetest") && (argc
== 3))
44 /* get available tests */
45 pPipe
= _tpopen(argv
[2], "r");
48 while(fgets(psBuffer
, 128, pPipe
))
50 if (psBuffer
[0] == ' ')
54 strcat(cmd
, psBuffer
+4);
55 /* run the current test */
56 strcpy(test
, "\n\nRunning ");
58 OutputDebugStringA(test
);
59 pPipe2
= _popen(cmd
, "r");
62 while(fgets(psBuffer2
, 128, pPipe2
))
64 nlptr2
= strchr(psBuffer2
, '\n');
68 OutputDebugStringA(psBuffer2
);
77 else if (_tcsstr(argv
[1], "--process") && (argc
== 3))
82 pPipe
= _tpopen(argv
[2], "r");
85 while(fgets(psBuffer
, 128, pPipe
))
88 OutputDebugStringA(psBuffer
);
95 buf
= HeapAlloc(GetProcessHeap(), 0, (bufsize
+1) * sizeof(TCHAR
));
102 for(i
= 1; i
< argc
; i
++)
104 int length
= _tcslen(argv
[i
]);
105 _tcsncpy(&buf
[offset
], argv
[i
], length
);
109 buf
[offset
] = _T(' ');
113 buf
[offset
] = _T('\n');
114 buf
[offset
+1] = _T('\0');
119 OutputDebugString(buf
);
120 HeapFree(GetProcessHeap(), 0, buf
);