#ifndef __LIST_H
#define __LIST_H
-/* This file is from Linux Kernel (include/linux/list.h)
- * and modified by simply removing hardware prefetching of list items.
+/* This file is from Linux Kernel (include/linux/list.h)
+ * and modified by simply removing hardware prefetching of list items.
* Here by copyright, credits attributed to wherever they belong.
* Kulesh Shanmugasundaram (kulesh [squiggly] isis.poly.edu)
*/
} while (0)
/*
- * Insert a new entry between two known consecutive entries.
+ * Insert a new entry between two known consecutive entries.
*
* This is only for internal list manipulation where we know
* the prev/next entries already!
static inline void list_del_init(struct list_head *entry)
{
__list_del(entry->prev, entry->next);
- INIT_LIST_HEAD(entry);
+ INIT_LIST_HEAD(entry);
}
/**
#define list_for_each_prev(pos, head) \
for (pos = (head)->prev; pos != (head); \
pos = pos->prev)
-
+
/**
* list_for_each_safe - iterate over a list safe against removal of list entry
* @pos: the &struct list_head to use as a loop counter.
}
static bool is_valid_coordinates(int y, int x) {
-
+
if ((y > 0 && y < board_size + 1) && \
(x > 0 && x < board_size + 1)) {
return true;
*
* Filename: ui.c
*
- * Description: Routines to handle the user interface
+ * Description: Routines to handle the user interface
*
* Version: 1.0
* Created: 24/04/2017 16:41:15
/* y = 1: y -> 0 x = 1: 1 -> 1
* y > 1: y -> y + 3 x > 1: x -> x + 5 */
static int remap_y(int y) {
-
+
if (y == 1) {
return 2;
} else if (y > 1 && y <= board_size) {
}
int map_col_letter_to_index(char c) {
-
+
if (c == 'a' || c == 'A') {
return 1;
} else if (c == 'b' || c == 'B') {
/* return capital letters */
char map_col_index_to_letter(int index) {
-
+
if (index == 1) {
return 'A';
} else if (index == 2) {