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)
18 int _tmain(int argc
, TCHAR
** argv
)
26 for(i
= 1; i
< argc
; i
++)
28 bufsize
+= _tcslen(argv
[i
]) + 1;
36 if (_tcsstr(argv
[1], "--winetest") && (argc
== 3))
46 /* get available tests */
47 pPipe
= _tpopen(argv
[2], "r");
50 while(fgets(psBuffer
, 128, pPipe
))
52 if (psBuffer
[0] == ' ')
56 strcat(cmd
, psBuffer
+4);
57 /* run the current test */
58 strcpy(test
, "\n\nRunning ");
60 OutputDebugStringA(test
);
61 pPipe2
= _popen(cmd
, "r");
64 while(fgets(psBuffer2
, 128, pPipe2
))
66 nlptr2
= strchr(psBuffer2
, '\n');
70 OutputDebugStringA(psBuffer2
);
79 else if (_tcsstr(argv
[1], "--process") && (argc
== 3))
84 pPipe
= _tpopen(argv
[2], "r");
87 while(fgets(psBuffer
, 128, pPipe
))
90 OutputDebugStringA(psBuffer
);
97 buf
= HeapAlloc(GetProcessHeap(), 0, (bufsize
+1) * sizeof(TCHAR
));
104 for(i
= 1; i
< argc
; i
++)
106 int length
= _tcslen(argv
[i
]);
107 _tcsncpy(&buf
[offset
], argv
[i
], length
);
111 buf
[offset
] = _T(' ');
115 buf
[offset
] = _T('\n');
116 buf
[offset
+1] = _T('\0');
121 OutputDebugString(buf
);
122 HeapFree(GetProcessHeap(), 0, buf
);