CMake/Tests/SystemInformation/DumpInformation.cxx

40 lines
697 B
C++
Raw Normal View History

2002-11-11 18:07:20 -05:00
#include <stdio.h>
#include "DumpInformation.h"
int main(int, char*[])
{
FILE* file = fopen(CMAKE_DUMP_FILE, "r");
if(!file)
{
2002-11-12 14:18:36 -05:00
printf("Error, could not open file %s\n", CMAKE_DUMP_FILE);
2002-11-11 18:07:20 -05:00
return -1;
}
2002-11-12 14:18:36 -05:00
printf("#Note less than will show up as { and greater than will be }\n");
2002-11-11 18:07:20 -05:00
while(!feof(file))
{
2002-11-12 09:33:00 -05:00
int ch = fgetc(file);
if(ch != EOF)
{
2002-11-12 14:18:36 -05:00
if(ch == '<')
{
printf("&lt;");
}
else if(ch == '>')
{
printf("&gt;");
}
else if(ch == '&')
{
printf("&amp;");
}
else
{
putc(ch, stdout);
}
2002-11-12 09:33:00 -05:00
}
2002-11-11 18:07:20 -05:00
}
2002-11-12 14:18:36 -05:00
printf("\n");
2002-11-11 18:07:20 -05:00
fclose(file);
return 0;
}