Language: C

#include <stdio.h>

int search(xs, ys, c) {

}

struct blkinfo_t {
  int c;
  int d;
  int x;
  int y;
};

int **board;
int **flag;

int xg, yg;

void createmaze(int n, struct blkinfo_t *blks) {
  int i;
  int curx;
  int cury;

  for(i = 0; i < n; i++) {
    curx = blks[n].x;
    cury = blks[n].y;

    if(d == 0) {
      board[cury][curx] = blks[n].c;
      board[cury][curx+1] = blks[n].c;
      board[cury][curx+2] = blks[n].c;
      board[cury][curx+3] = blks[n].c;
      board[cury+1][curx] = blks[n].c;
      board[cury+1][curx+1] = blks[n].c;
      board[cury+1][curx+2] = blks[n].c;
      board[cury+1][curx+3] = blks[n].c;
    }
    else {
      board[cury][curx] = blks[n].c;
      board[cury][curx+1] = blks[n].c;
      board[cury+1][curx] = blks[n].c;
      board[cury+1][curx+1] = blks[n].c;
      board[cury+2][curx] = blks[n].c;
      board[cury+2][curx+1] = blks[n].c;
      board[cury+3][curx] = blks[n].c;
      board[cury+3][curx+1] = blks[n].c;
    }
  }

  return;
}

int search(x, y, c) {
  int result[4] = {0, 0, 0, 0};

  if(flag[y][x] == 1)
    return -1;
  if(board[y][x] != c)
    return -1;
  if((x == xg) && (y == yg))
    return 1;

  flag[y][x] = 1;

  if(x+1 > w) {
    result[0] = search(x+1, y, c);
  }
  if(x-1 < 1) {
    result[1] = search(x-1, y, c);
  }
  if(y+1 > h) {
    result[2] = search(x, y+1, c);
  }
  if(y-1 < 1) {
    result[3] = search(x, y-1, c);
  }

  if((result[0] == 1) ||
     (result[1] == 1) ||
     (result[2] == 1) ||
     (result[3] == 1))
    return 1;
  else
    return -1;
}

int main() {
  int i;

  int w, h;
  int xs, ys;
  int n;

  struct blkinfo_t *blks;


  scanf("%d %d", w , h);
  scanf("%d %d", xs, ys);
  scanf("%d %d", xg, yg);
  scanf("%d", n);

  blks = calloc(n, sizeof(struct blkinfo_t));

  for(i = 0; i < n; i++) {
    scanf("%d %d %d %d", blks[n].c, blks[n].d, blks[n].x, blks[n].y);
  }

  board = calloc(w*h, sizeof(int));
  flag  = calloc(w*h, sizeof(int));

  if(search(xs, ys, c) == 1)
    printf("OK");
  else
    printf("NG");
  return 0;
}

Compiler output:
main.c: In function 'search':
main.c:3:5: error: type of 'xs' defaults to 'int' [-Wimplicit-int]
    3 | int search(xs, ys, c) {
      |     ^~~~~~
main.c:3:5: error: type of 'ys' defaults to 'int' [-Wimplicit-int]
main.c:3:5: error: type of 'c' defaults to 'int' [-Wimplicit-int]
main.c: In function 'createmaze':
main.c:28:8: error: 'd' undeclared (first use in this function)
   28 |     if(d == 0) {
      |        ^
main.c:28:8: note: each undeclared identifier is reported only once for each function it appears in
main.c: At top level:
main.c:53:5: error: redefinition of 'search'
   53 | int search(x, y, c) {
      |     ^~~~~~
main.c:3:5: note: previous definition of 'search' with type 'int()'
    3 | int search(xs, ys, c) {
      |     ^~~~~~
main.c: In function 'search':
main.c:53:5: error: type of 'x' defaults to 'int' [-Wimplicit-int]
   53 | int search(x, y, c) {
      |     ^~~~~~
main.c:53:5: error: type of 'y' defaults to 'int' [-Wimplicit-int]
main.c:53:5: error: type of 'c' defaults to 'int' [-Wimplicit-int]
main.c:65:12: error: 'w' undeclared (first use in this function)
   65 |   if(x+1 > w) {
      |            ^
main.c:71:12: error: 'h' undeclared (first use in this function)
   71 |   if(y+1 > h) {
      |            ^
main.c: In function 'main':
main.c:102:10: error: implicit declaration of function 'calloc' [-Wimplicit-function-declaration]
  102 |   blks = calloc(n, sizeof(struct blkinfo_t));
      |          ^~~~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'calloc'
    1 | #include <stdio.h>
  +++ |+#include <stdlib.h>
    2 | 
main.c:102:10: warning: incompatible implicit declaration of built-in function 'calloc' [-Wbuiltin-declaration-mismatch]
  102 |   blks = calloc(n, sizeof(struct blkinfo_t));
      |          ^~~~~~
main.c:102:10: note: include '<stdlib.h>' or provide a declaration of 'calloc'
main.c:111:21: error: 'c' undeclared (first use in this function)
  111 |   if(search(xs, ys, c) == 1)
      |                     ^