1 /* rrsolve - Simple RR solver and librr client.
3 * Copyright © 2003 Carl Worth
5 * Permission to use, copy, modify, distribute, and sell this software
6 * and its documentation for any purpose is hereby granted without
7 * fee, provided that the above copyright notice appear in all copies
8 * and that both that copyright notice and this permission notice
9 * appear in supporting documentation, and that the name of Carl Worth
10 * not be used in advertising or publicity pertaining to distribution
11 * of the software without specific, written prior permission.
12 * Carl Worth makes no representations about the suitability of this
13 * software for any purpose. It is provided "as is" without express
14 * or implied warranty.
16 * CARL WORTH DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
17 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
18 * NO EVENT SHALL CARL WORTH BE LIABLE FOR ANY SPECIAL, INDIRECT OR
19 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
20 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
21 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
22 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
24 * Author: Carl Worth <carl@theworths.org>
34 typedef unsigned int rrs_state_t;
59 rrs_solution_init (rrs_solution_t *solution);
62 rrs_solution_fini (rrs_solution_t *solution);
65 rrs_solution_push (rrs_solution_t *solution,
66 rr_robot_t robot, rr_direction_t dir);
69 rrs_solution_pop (rrs_solution_t *solution,
70 rr_robot_t *robot, rr_direction_t *dir);
73 rrs_solution_prepend (rrs_solution_t *solution,
74 rr_robot_t robot, rr_direction_t dir);
79 rrs_state_buf_create (int initial_size);
82 rrs_state_buf_destroy (rrs_state_buf_t *buf);
85 rrs_state_buf_add (rrs_state_buf_t *buf, rrs_state_t state);
88 rrs_state_buf_add_sorted (rrs_state_buf_t *buf, rrs_state_t state);
91 rrs_state_buf_append (rrs_state_buf_t *buf, rrs_state_buf_t *other);
94 rrs_state_buf_remove (rrs_state_buf_t *buf, rrs_state_t state);
97 rrs_state_buf_contains (rrs_state_buf_t *buf, rrs_state_t state);