920f0fbae18c2e27b802b1d68c5333ec71053d78
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))
42 /* get available tests */
43 pPipe
= _tpopen(argv
[2], "r");
46 while(fgets(psBuffer
, 128, pPipe
))
48 char *nlptr
= strchr(psBuffer
, '\n');
50 psBuffer
[*psBuffer
- *nlptr
- 1] = '\0';
51 if (psBuffer
[0] == ' ')
55 strcat(cmd
, psBuffer
+4);
56 /* run the current test */
57 pPipe2
= _tpopen(cmd
, "r");
60 while(fgets(psBuffer2
, 128, pPipe2
))
62 OutputDebugStringA(psBuffer2
);
71 else if (_tcsstr(argv
[1], "--process") && (argc
== 3))
76 pPipe
= _tpopen(argv
[2], "r");
79 while(fgets(psBuffer
, 128, pPipe
))
81 OutputDebugStringA(psBuffer
);
88 buf
= HeapAlloc(GetProcessHeap(), 0, (bufsize
+1) * sizeof(TCHAR
));
95 for(i
= 1; i
< argc
; i
++)
97 int length
= _tcslen(argv
[i
]);
98 _tcsncpy(&buf
[offset
], argv
[i
], length
);
102 buf
[offset
] = _T(' ');
106 buf
[offset
] = _T('\n');
107 buf
[offset
+1] = _T('\0');
111 OutputDebugString(buf
);
112 HeapFree(GetProcessHeap(), 0, buf
);