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))
43 /* get available tests */
44 pPipe
= _tpopen(argv
[2], "r");
47 while(fgets(psBuffer
, 128, pPipe
))
49 if (psBuffer
[0] == ' ')
53 strcat(cmd
, psBuffer
+4);
54 /* run the current test */
55 strcpy(test
, "\n\nRunning ");
57 OutputDebugStringA(test
);
58 pPipe2
= _popen(cmd
, "r");
61 while(fgets(psBuffer2
, 128, pPipe2
))
63 char *nlptr2
= strchr(psBuffer2
, '\n');
66 OutputDebugStringA(psBuffer2
);
75 else if (_tcsstr(argv
[1], "--process") && (argc
== 3))
80 pPipe
= _tpopen(argv
[2], "r");
83 while(fgets(psBuffer
, 128, pPipe
))
85 OutputDebugStringA(psBuffer
);
92 buf
= HeapAlloc(GetProcessHeap(), 0, (bufsize
+1) * sizeof(TCHAR
));
99 for(i
= 1; i
< argc
; i
++)
101 int length
= _tcslen(argv
[i
]);
102 _tcsncpy(&buf
[offset
], argv
[i
], length
);
106 buf
[offset
] = _T(' ');
110 buf
[offset
] = _T('\n');
111 buf
[offset
+1] = _T('\0');
115 OutputDebugString(buf
);
116 HeapFree(GetProcessHeap(), 0, buf
);