summaryrefslogtreecommitdiffstats
path: root/Tests/SystemInformation/DumpInformation.cxx
blob: a6d5b2af8fb2933345d9c4ee883a385b2ad90162 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <stdio.h>
#include "DumpInformation.h"

int main(int, char*[])
{
  FILE* file = fopen(CMAKE_DUMP_FILE, "r");
  if(!file)
    {
    printf("Error, could not open file %s\n", CMAKE_DUMP_FILE);
    return -1;
    }
  printf("#Note less than will show up as { and greater than will be }\n");
  while(!feof(file))
    {
    int ch = fgetc(file);
    if(ch != EOF)
      {
      if(ch == '<')
        {
        printf("&lt;");
        }
      else if(ch == '>')
        {
        printf("&gt;");
        }
      else if(ch == '&')
        {
        printf("&amp;");
        }
      else 
        {
        putc(ch, stdout);
        }
      }
    }
  printf("\n");
  fclose(file);
  return 0;
}