This is the doxygen documentation for gtkboard.
.#include "move.h"
#include "game.h"
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
Go to the source code of this file.
Functions | |
int | movcpy (byte *dest, byte *src) |
Makes the move src to the move dest. More... | |
gboolean | movcmp_literal (byte *move1, byte *move2) |
Compares two moves byte by byte. Literal not semantic comparison. Returns TRUE if the moves are equal. | |
byte* | movlist_next (byte *move) |
Returns the next move in a movlist. More... | |
void | move_apply (byte *board, byte *move) |
Applies the move to the board. | |
void | move_fwrite (byte *move, FILE *fout) |
Writes a move to the pipe in human friendly format. | |
void | move_fwrite_ack (byte *move, FILE *fout) |
Same as move_fwrite(), but precedes line with "ACK ". | |
void | move_fwrite_nak (char *str, FILE *fout) |
Writes "NAK " followed by arbitrary error message. | |
byte* | move_read (char *line) |
Parses a string into a move. | |
byte* | move_fread (FILE *fin) |
Reads a move from the pipe. | |
byte* | move_fread_ack (FILE *fin) |
Same as move_fread(), except it expects the stream to begin with "ACK ". Returns NULL otherwise. | |
char* | line_read (FILE *fin) |
Reads a line from the stream. | |
byte* | movdup (byte *move) |
Make a copy of the move. More... | |
byte* | mov_getinv (byte *board, byte *move) |
Returns the inverse of a move in the given board. More... | |
Variables | |
int | board_wid |
int | board_heit |
byte | linebuf [4096] |
|
Reads a line from the stream.
|
|
Returns the inverse of a move in the given board. The move format does not specify the old value of the squares. So it is not possible to go from the new Pos to the old Pos. To be able to do this we need to get the "inverse" of the move using the current board |
|
Compares two moves byte by byte. Literal not semantic comparison. Returns TRUE if the moves are equal.
|
|
Makes the move src to the move dest. Memory is assumed to have already been allocated for dest. |
|
Make a copy of the move. The new move is malloc()d and so must be free()d by the caller. |
|
Applies the move to the board.
|
|
Reads a move from the pipe.
|
|
Same as move_fread(), except it expects the stream to begin with "ACK ". Returns NULL otherwise.
|
|
Writes a move to the pipe in human friendly format.
|
|
Same as move_fwrite(), but precedes line with "ACK ".
|
|
Writes "NAK " followed by arbitrary error message.
|
|
Parses a string into a move.
|
|
Returns the next move in a movlist.
A movlist is also an array of |
|
|
|
|
|
|