aboutsummaryrefslogtreecommitdiffstats
path: root/monitor-get-edid.c
blob: 41e0e5d517e44c4c00ab5ba00afb36b4ceb4a64f (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
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <sys/mman.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <stdarg.h>
#include "get-edid.h"

int verbose = 0;

int main(int argc, char **argv)
{
  char edid[256];
  int i;

  for (i = 1; i < argc; i++)
    if (strcmp(argv[i], "-v") == 0) verbose = 1;
    else if (strcmp(argv[i], "-h") == 0 ||
	     strcmp(argv[i], "--help") == 0) {
      printf("usage: monitor-get-edid [-v]\n");
      exit(1);
    }

  int size = get_edid(edid);

  if (size) write(1, edid, size);

  return size ? 0 : 1;
}