Commits

Anonymous committed 32e480b

Renamed the files to make them more meaningful.

Comments (0)

Files changed (5)

nurikabe-solver/Makefile

-MODULES = cell_mat.c
-HEADERS = cell_mat.h
+MODULES = verdict_mat.c
+HEADERS = verdict_mat.h
 
 CFLAGS = -g -Wall
 

nurikabe-solver/cell_mat.c

-#include "cell_mat.h"
-
-NK_SOLVE_ERROR_CODE
-nk_solve_verdict_matrix_create(
-        gint height,
-        gint width,
-        nk_solve_verdict_matrix_t * * result
-        )
-{
-    nk_solve_verdict_matrix_t * ret;
-
-    *result = NULL;
-
-    ret = g_new(nk_solve_verdict_matrix_t, 1);
-
-    if (! ret)
-    {
-        return NK_SOLVE_ERROR__ALLOC_FAILED;
-    }
-
-    ret->width = width;
-    ret->height = height;
-
-    ret->buf = g_malloc0((width*height)>>2);
-    if (! ret->buf)
-    {
-        g_free(ret);
-
-        return NK_SOLVE_ERROR__ALLOC_FAILED;
-    }
-
-    *result = ret;
-
-    return NK_SOLVE_ERROR__SUCCESS;
-}
-

nurikabe-solver/cell_mat.h

-#ifndef NK_SOLVE__VERDICT_MAT_H
-#define NK_SOLVE__VERDICT_MAT_H
-
-#include <glib.h>
-
-enum NK_SOLVE_VERDICT
-{
-    NK_SOLVE_VERDICT__UNKNOWN = 0,
-    NK_SOLVE_VERDICT__WHITE = 1,
-    NK_SOLVE_VERDICT__BLACK = 2,
-};
-
-typedef enum 
-{
-    NK_SOLVE_ERROR__SUCCESS = 0,
-    NK_SOLVE_ERROR__ALLOC_FAILED,
-    NK_SOLVE_ERROR__X_OUT_OF_BOUNDS,
-    NK_SOLVE_ERROR__Y_OUT_OF_BOUNDS
-} NK_SOLVE_ERROR_CODE;
-
-typedef enum NK_SOLVE_VERDICT nk_solve_verdict_t;
-
-typedef struct
-{
-    gint width;
-    gint height;
-    gchar * buf;
-} nk_solve_verdict_matrix_t;
-
-extern NK_SOLVE_ERROR_CODE
-nk_solve_verdict_matrix_create(
-        gint height,
-        gint width,
-        nk_solve_verdict_matrix_t * * result
-        );
-
-extern NK_SOLVE_ERROR_CODE
-nk_solve_verdict_matrix_set(
-    nk_solve_verdict_matrix_t * board,
-    gint y,
-    gint x,
-    nk_solve_verdict_t value
-    );
-
-extern NK_SOLVE_ERROR_CODE
-nk_solve_verdict_matrix_get(
-    nk_solve_verdict_matrix_t * board,
-    gint y,
-    gint x,
-    nk_solve_verdict_t * value
-    );
-
-extern NK_SOLVE_ERROR_CODE
-nk_solve_verdict_matrix_free(nk_solve_verdict_matrix_t * matrix);
-
-#endif /* #ifndef NK_SOLVE__VERDICT_MAT_H */
-

nurikabe-solver/verdict_mat.c

+#include "verdict_mat.h"
+
+NK_SOLVE_ERROR_CODE
+nk_solve_verdict_matrix_create(
+        gint height,
+        gint width,
+        nk_solve_verdict_matrix_t * * result
+        )
+{
+    nk_solve_verdict_matrix_t * ret;
+
+    *result = NULL;
+
+    ret = g_new(nk_solve_verdict_matrix_t, 1);
+
+    if (! ret)
+    {
+        return NK_SOLVE_ERROR__ALLOC_FAILED;
+    }
+
+    ret->width = width;
+    ret->height = height;
+
+    ret->buf = g_malloc0((width*height)>>2);
+    if (! ret->buf)
+    {
+        g_free(ret);
+
+        return NK_SOLVE_ERROR__ALLOC_FAILED;
+    }
+
+    *result = ret;
+
+    return NK_SOLVE_ERROR__SUCCESS;
+}
+

nurikabe-solver/verdict_mat.h

+#ifndef NK_SOLVE__VERDICT_MAT_H
+#define NK_SOLVE__VERDICT_MAT_H
+
+#include <glib.h>
+
+enum NK_SOLVE_VERDICT
+{
+    NK_SOLVE_VERDICT__UNKNOWN = 0,
+    NK_SOLVE_VERDICT__WHITE = 1,
+    NK_SOLVE_VERDICT__BLACK = 2,
+};
+
+typedef enum 
+{
+    NK_SOLVE_ERROR__SUCCESS = 0,
+    NK_SOLVE_ERROR__ALLOC_FAILED,
+    NK_SOLVE_ERROR__X_OUT_OF_BOUNDS,
+    NK_SOLVE_ERROR__Y_OUT_OF_BOUNDS
+} NK_SOLVE_ERROR_CODE;
+
+typedef enum NK_SOLVE_VERDICT nk_solve_verdict_t;
+
+typedef struct
+{
+    gint width;
+    gint height;
+    gchar * buf;
+} nk_solve_verdict_matrix_t;
+
+extern NK_SOLVE_ERROR_CODE
+nk_solve_verdict_matrix_create(
+        gint height,
+        gint width,
+        nk_solve_verdict_matrix_t * * result
+        );
+
+extern NK_SOLVE_ERROR_CODE
+nk_solve_verdict_matrix_set(
+    nk_solve_verdict_matrix_t * board,
+    gint y,
+    gint x,
+    nk_solve_verdict_t value
+    );
+
+extern NK_SOLVE_ERROR_CODE
+nk_solve_verdict_matrix_get(
+    nk_solve_verdict_matrix_t * board,
+    gint y,
+    gint x,
+    nk_solve_verdict_t * value
+    );
+
+extern NK_SOLVE_ERROR_CODE
+nk_solve_verdict_matrix_free(nk_solve_verdict_matrix_t * matrix);
+
+#endif /* #ifndef NK_SOLVE__VERDICT_MAT_H */
+