CMake/Tests/SystemInformation/DumpInformation.cxx

40 lines
697 B
C++
Raw Normal View History

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