diff -Nru ricochet-0.6/array.sn ricochet-0.7/array.sn --- ricochet-0.6/array.sn 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/array.sn 2012-02-01 04:45:07.000000000 +0000 @@ -0,0 +1,68 @@ +/* + * $Id$ + * + * Copyright © 2003 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Keith Packard not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. Keith Packard makes no + * representations about the suitability of this software for any purpose. It + * is provided "as is" without express or implied warranty. + * + * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +namespace Array { + public bool contains (&poly[*] a, poly v) { + for (int i = 0; i < dim(a); i++) + if (a[i] == v) + return true; + return false; + } + + public poly append (&poly[*] a, poly v) { + if (contains(&a, v)) + return v; + a = (poly[dim(a)+1]) { [i] = i < dim(a) ? a[i] : v }; + return v; + } + + public poly push (&poly[*] a, poly v) { + a = (poly[dim(a)+1]) { [i] = i < dim(a) ? a[i] : v }; + return v; + } + + public exception empty (&poly[*] a); + + public poly pop (&poly[*] a) { + if (dim(a) == 0) + raise empty (a); + poly v = a[dim(a)-1]; + a = (poly[dim(a)-1]) { [i] = a[i] }; + return v; + } + + public void iterate (&poly[*] a, void (poly v) f) { + for (int i = 0; i < dim (a); i++) + f(a[i]); + } + + public void remove (&poly[*] a, poly v) { + if (!contains (&a, v)) + return; + bool found = false; + a = (poly[dim(a)-1]) { [i] = found ? a[i+1] : + a[i] == v ? (found=true, a[i+1]) : a[i] }; + } + +} diff -Nru ricochet-0.6/autogen.sh ricochet-0.7/autogen.sh --- ricochet-0.6/autogen.sh 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/autogen.sh 2012-03-20 04:18:49.000000000 +0000 @@ -0,0 +1,10 @@ +#! /bin/sh +# +# $Id$ +# +# runs autotools to create ./configure and friends +# +# configure depends on version.m4, but autoreconf does not realize this +rm configure +autoreconf -Wall -v --install || exit 1 +./configure --enable-maintainer-mode "$@" diff -Nru ricochet-0.6/client-board.sn ricochet-0.7/client-board.sn --- ricochet-0.6/client-board.sn 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/client-board.sn 2012-02-11 03:53:00.000000000 +0000 @@ -0,0 +1,27 @@ +/* + * Copyright © 2012 Keith Packard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +autoload Client; +autoload RR; + +extend namespace Client { + namespace Board { + Board parse(string text) { + string[] lines = String::split(text, "\n"); + } + } +} diff -Nru ricochet-0.6/client-draw.sn ricochet-0.7/client-draw.sn --- ricochet-0.6/client-draw.sn 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/client-draw.sn 2012-06-09 23:37:36.000000000 +0000 @@ -0,0 +1,225 @@ +/* + * Copyright © 2012 Keith Packard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +autoload Cairo; +autoload Client; +autoload Client::SVG; + +extend namespace Client { + + public namespace Draw { + + import Cairo; + import Cairo::Rsvg; + import RR; + + public typedef struct { + int xoff, yoff; + real xscale, yscale; + } transform_t; + + typedef struct { + Cairo::surface_t surface; + int width, height; + rsvg_t svg; + } sprite_t; + + sprite_t sprite_from_string(string xml) = (sprite_t) { + .svg = Cairo::Rsvg::new_from_string(xml), + .width = -1, + .height = -1 + }; + + sprite_t[2] cell = { sprite_from_string(Client::SVG::cell1), + sprite_from_string(Client::SVG::cell2) }; + + sprite_t[Color] robots = { + Color.Red => sprite_from_string(Client::SVG::robot_red), + Color.Blue => sprite_from_string(Client::SVG::robot_blue), + Color.Yellow => sprite_from_string(Client::SVG::robot_yellow), + Color.Green => sprite_from_string(Client::SVG::robot_green) }; + + sprite_t robot_shadow = sprite_from_string(Client::SVG::robot_shadow); + + sprite_t[Color][Shape] targets = { + Color.Red => { + Shape.Triangle => sprite_from_string(Client::SVG::target_red_triangle), + Shape.Square => sprite_from_string(Client::SVG::target_red_square), + Shape.Octagon => sprite_from_string(Client::SVG::target_red_octagon), + Shape.Circle => sprite_from_string(Client::SVG::target_red_circle), + }, + Color.Yellow => { + Shape.Triangle => sprite_from_string(Client::SVG::target_yellow_triangle), + Shape.Square => sprite_from_string(Client::SVG::target_yellow_square), + Shape.Octagon => sprite_from_string(Client::SVG::target_yellow_octagon), + Shape.Circle => sprite_from_string(Client::SVG::target_yellow_circle), + }, + Color.Green => { + Shape.Triangle => sprite_from_string(Client::SVG::target_green_triangle), + Shape.Square => sprite_from_string(Client::SVG::target_green_square), + Shape.Octagon => sprite_from_string(Client::SVG::target_green_octagon), + Shape.Circle => sprite_from_string(Client::SVG::target_green_circle), + }, + Color.Blue => { + Shape.Triangle => sprite_from_string(Client::SVG::target_blue_triangle), + Shape.Square => sprite_from_string(Client::SVG::target_blue_square), + Shape.Octagon => sprite_from_string(Client::SVG::target_blue_octagon), + Shape.Circle => sprite_from_string(Client::SVG::target_blue_circle), + }, + Color.Whirl => { + Shape.Whirl => sprite_from_string(Client::SVG::target_whirl), + }, + }; + + sprite_t wall = sprite_from_string(Client::SVG::wall); + + void draw_sprite(&sprite_t sprite, cairo_t cr) { + render(sprite.svg, cr); + } + + dimensions_t cell_dim = get_dimensions(cell[0].svg); + dimensions_t wall_dim = get_dimensions(wall.svg); + + public int cell_width = cell_dim.width; + public int cell_height = cell_dim.height; + + public int wall_thickness = wall_dim.height; + + void draw_cached_sprite(&sprite_t sprite, cairo_t cr, &transform_t t, real alpha) { + int width = ceil(cell_width * t.xscale); + int height = ceil(cell_width * t.yscale); + + save(cr); + if (width != sprite.width || height != sprite.height) { + if (!is_uninit(&sprite.surface)) + Cairo::Surface::destroy(sprite.surface); + sprite.width = width; + sprite.height = height; + if (width > 0 && height > 0) { + sprite.surface = Cairo::Surface::create_similar(Cairo::get_target(cr), + Cairo::content_t.COLOR_ALPHA, + width, height); + cairo_t scr = Cairo::create(sprite.surface); + scale(scr, t.xscale, t.yscale); + draw_sprite(&sprite, scr); + Cairo::destroy(scr); + } + } + if (sprite.width > 0 && sprite.height > 0) { + set_source_surface(cr, sprite.surface, 0, 0); + if (alpha != 1) + paint_with_alpha(cr, alpha); + else + paint(cr); + } + restore(cr); + } + + public void background (cairo_t cr, int x, int y, RR::Object object, &transform_t t) { + save(cr); + translate(cr, x * cell_width * t.xscale + t.xoff, y * cell_height * t.yscale + t.yoff); + + draw_cached_sprite(&cell[x+y & 1], cr, &t, 1); + restore(cr); + } + + public void walls(cairo_t cr, int x, int y, RR::Object object, &transform_t t) { + save(cr); + translate(cr, t.xoff, t.yoff); + scale(cr, t.xscale, t.yscale); + translate(cr, x * cell_width, y * cell_height); + /* + rectangle(cr, 0, 0, cell_width, cell_height); + clip(cr); + */ + + void draw_wall (bool doit, bool vertical, bool shift) { + if (!doit) return; + save(cr); + if (vertical) { + rotate(cr, pi/2); + if (shift) + translate(cr, 0, -cell_height); + } else if (shift) + translate(cr, 0, cell_height); + draw_sprite(&wall, cr); + restore(cr); + } + draw_wall (object.walls.left, true, false); + draw_wall (object.walls.above, false, false); + if (x == 15) + draw_wall (object.walls.right, true, true); + if (y == 15) + draw_wall (object.walls.below, false, true); + restore(cr); + } + + public void contents (cairo_t cr, int x, int y, RR::Object object, + RR::TargetOrNone active_target, + RR::RobotOrNone active_robot, + &transform_t t) { + save(cr); + translate(cr, x * cell_width * t.xscale + t.xoff, y * cell_height * t.yscale + t.yoff); + + union switch (object.target) { + case none: + break; + case target target: + real alpha = 1; + if (object.target != active_target) + alpha = 0.25; + draw_cached_sprite(&targets[target.color][target.shape], cr, &t, alpha); + break; + } + union switch(object.robot) { + case none: + break; + case robot r: + union switch (active_robot) { + case robot a: + if (a.color == r.color) { + save(cr); + scale(cr, t.xscale, t.yscale); + translate(cr, 5, 1); + scale(cr, 1.1, 1.1); + draw_sprite(&robot_shadow, cr); + restore(cr); + } + break; + default: + } + draw_cached_sprite(&robots[r.color], cr, &t, 1); + break; + } + restore(cr); + } + + public void target (cairo_t cr, real x, real y, TargetOrNone target, &transform_t t) { + save(cr); + translate(cr, x * cell_width * t.xscale + t.xoff, y * cell_height * t.yscale + t.yoff); + scale(cr, 2 * t.xscale, 2 *t.yscale); + union switch (target) { + case target t: + draw_sprite(&targets[t.color][t.shape], cr); + break; + default: + break; + } + restore(cr); + } + } +} diff -Nru ricochet-0.6/client-games.sn ricochet-0.7/client-games.sn --- ricochet-0.6/client-games.sn 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/client-games.sn 2012-05-21 21:04:32.000000000 +0000 @@ -0,0 +1,315 @@ +/* + * Copyright © 2012 Keith Packard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +autoload Client; +autoload Client::Link; +autoload Client::Util; +autoload Nichrome; +autoload Nichrome::Box; +autoload Nichrome::Label; +autoload Nichrome::Button; +autoload Nichrome::Solid; +autoload Nichrome::Textline; +autoload Sort; + +extend namespace Client { + public namespace Games { + import Nichrome; + import Util; + + public typedef games_t; + + typedef struct { + string name; + string[*] players; + } game_t; + + public string current_game; + + protected typedef void (string game, bool watch) callback_t; + + public typedef struct { + *nichrome_t ui; + *Box::box_t box; + *Box::box_t game_box; + *Label::label_t title; + *Button::button_t close; + *Textline::textline_t game_name; + Link::link_t link; + callback_t callback; + game_t[*] games; + } games_t; + + Mutex::mutex games_mutex = Mutex::new(); + bool games_running = false; + *games_t global_games; + thread global_games_thread; + + void stop(*games_t games) { + twixt(Mutex::acquire(games_mutex); Mutex::release(games_mutex)) { + games_running = false; + Nichrome::destroy(games->ui); + make_uninit(&global_games); + } + } + + int rows(*game_t game) { + return max(1, dim(game->players)) + 1; + } + + void find_game(*games_t games, string name, void (*game_t game, int row) doit) { + int row = 2; + for (int g = 0; g < dim(games->games); g++) { + if (games->games[g].name == name) + doit(&games->games[g], row); + row += rows (&games->games[g]); + } + } + + + void add_dispose_game(*games_t games, *game_t game, int row) { + void dispose_game(&widget_t w, bool state) { + static string name = game->name; + if (state) + Link::command(games->link, + "DISPOSE %s\n", name); + } + Box::add_widget(games->game_box, 1, row, Button::new(games->ui, "Dispose Game", + dispose_game), 0); + } + + void remove_user(*games_t games, string game, string name) { + find_game(games, game, void func (*game_t game, int row) { + int p; + for (p = 0; p < dim (game->players); p++) + if (game->players[p] == name) + break; + if (p == dim(game->players)) + return; + for (int q = p; q < dim(game->players) - 1; q++) + game->players[q] = game->players[q+1]; + setdim(game->players, dim(game->players) - 1); + int r = row + p; + if (dim (game->players) == 0) { + add_dispose_game(games, game, r); + } else { + Box::delete_row(games->game_box, r); + } + Nichrome::redraw(games->ui); + }); + } + + void add_user(*games_t games, string game, string name) { + find_game(games, game, void func (*game_t game, int row) { + int p; + for (p = 0; p < dim (game->players); p++) + if (game->players[p] > name) + break; + for (int q = dim(game->players); q > p; q--) + game->players[q] = game->players[q-1]; + int r = row + p; + game->players[p] = name; + *widget_t w = Util::new_left(games->ui, name); + if (dim (game->players) > 1) { + if (p == 0) { + Box::insert_row(games->game_box, r+1); + Box::add_widget(games->game_box, 1, r+1, + new_left(games->ui, game->players[1])); + Box::add_glue(games->game_box, 0, r+1, 1); + Box::add_glue(games->game_box, 2, r+1, 1); + Box::add_glue(games->game_box, 3, r+1, 1); + } else { + Box::insert_row(games->game_box, r); + Box::add_glue(games->game_box, 0, r, 1); + Box::add_glue(games->game_box, 2, r, 1); + Box::add_glue(games->game_box, 3, r, 1); + } + } + Box::add_widget(games->game_box, 1, r, w, 0); + Nichrome::redraw(games->ui); + }); + } + + Box::item_t separator(*nichrome_t ui) { + return Box::widget_span_item(Solid::new(ui, 1, 1), 100, 1, 1, 0); + } + + int add_game(*games_t games, string name) { + Link::message_t players = Link::command(games->link, "PLAYERS %s\n", name); + if (dim(players->reply) == 0 || players->reply[0] != "PLAYERS") + return -1; + int nplayers = (dim(players->reply) - 1) // 2; + + int g; + int r = 2; + for (g = 0; g < dim(games->games); g++) { + if (name < games->games[g].name) + break; + r += rows(&games->games[g]); + } + for (int h = dim(games->games); h > g; h--) { + games->games[h] = games->games[h-1]; + } + games->games[g] = (game_t) { + .name = name, + .players = (string[...]) {} + }; + Box::insert_row(games->game_box, r); + Box::add_widget(games->game_box, 0, r, new_left(games->ui, games->games[g].name), 0); + if (!is_uninit(¤t_game) && current_game == name) { + Box::add_widget(games->game_box, 2, r, Label::new(games->ui, ""), 0); + Box::add_widget(games->game_box, 3, r, Label::new(games->ui, ""), 0); + } else { + Box::add_widget(games->game_box, 2, r, Button::new(games->ui, "Join Game", + void func (&widget_t w, bool state) { + if (state) { + games->callback(name, false); + stop(games); + } + }), 0); + Box::add_widget(games->game_box, 3, r, Button::new(games->ui, "Watch Game", + void func (&widget_t w, bool state) { + if (state) { + games->callback(name, true); + stop(games); + } + }), 0); + } + add_dispose_game(games, &games->games[g], r); + r++; + Box::insert_row(games->game_box, r); + Box::add(games->game_box, 0, r, separator(games->ui)); + for (int p = 0; p < nplayers; p++) + add_user(games, name, players->reply[1+2*p]); + return g; + } + + void remove_game(*games_t games, string name) { + int row = 2; + for (int g = 0; g < dim(games->games); g++) { + int rows = Games::rows(&games->games[g]); + if (games->games[g].name == name) { + for (int h = g; h < dim(games->games) - 1; h++) + games->games[h] = games->games[h+1]; + setdim(games->games, dim(games->games) - 1); + for (int r = 0; r < rows; r++) + Box::delete_row(games->game_box, row); + break; + } + row += rows; + } + } + + void get_games(*games_t games) { + Link::message_t r = Link::command(games->link, "GAMES\n"); + games->games = (game_t[...]) {}; + if (dim(r->reply) == 0 || r->reply[0] != "GAMES") + return; + for (int i = 1; i < dim(r->reply); i++) + add_game(games, r->reply[i]); + } + + public *games_t new(Link::link_t link, callback_t callback) { + *games_t games = &(games_t) {}; + games->link = link; + games->ui = Nichrome::new("Ricochet Robots Games", 100, 100); + games->title = new_bold(games->ui, "Games", Label::justify_t.center); + games->close = Button::new(games->ui, "Close", + void func (&widget_t w, bool state) { + if (state) + stop(games); + }); + games->game_box = Box::new(Box::dir_t.horizontal, + Box::widget_item(new_bold(games->ui, "Game Name", Label::justify_t.left), 0), + Box::widget_item(new_bold(games->ui, "Players", Label::justify_t.left), 0), + Box::glue_item(1)); + + Box::add_row(games->game_box, 0, 1, separator(games->ui)); + int r = 2; + games->game_name = Textline::new(games->ui, 40); + Box::add_widget(games->game_box, 0, r, games->game_name, 0); + Box::add_widget(games->game_box, 1, r, Label::new(games->ui, ""), 0); + Box::add_widget(games->game_box, 2, r, Button::new(games->ui, "New Game", + void func (&widget_t w, bool state) { + if (state) { + callback(games->game_name->text, true); + stop(games); + } + }), 0); + Box::add_widget(games->game_box, 3, r, Label::new(games->ui, ""), 0); + get_games(games); + + games->box = Box::new(Box::dir_t.vertical, + Box::widget_item(games->title, 0), + Box::box_item(games->game_box), + Box::box_item(Box::new(Box::dir_t.horizontal, + Box::glue_item(1), + Box::widget_item(games->close, 0))), + Box::glue_item(1)); + games->link = link; + games->callback = callback; + set_box(games->ui, games->box); + set_key_focus(games->ui, games->game_name); + return games; + } + + public void run(*games_t games) { + main_loop(games->ui); + } + + public void handle_notice(Link::message_t notice) { + twixt(Mutex::acquire(games_mutex); Mutex::release(games_mutex)) { + if (!games_running) + return; + switch (notice->reply[1]) { + case "GAME": + add_game(global_games, notice->reply[2]); + Nichrome::redraw(global_games->ui); + break; + case "DISPOSE": + remove_game(global_games, notice->reply[2]); + Nichrome::redraw(global_games->ui); + break; + case "WATCH": + case "JOIN": + add_user(global_games, notice->reply[3], notice->reply[2]); + break; + case "PART": + printf ("Remove user %s from %s\n", notice->reply[3], notice->reply[2]); + remove_user(global_games, notice->reply[3], notice->reply[2]); + break; + } + } + } + + public void start(Link::link_t link, callback_t callback) { + twixt(Mutex::acquire(games_mutex); Mutex::release(games_mutex)) { + if (!games_running) { + games_running = true; + global_games = new(link, callback); + global_games_thread = fork run (global_games); + } + } + } + + public void wait() { + if (games_running) + Thread::join (global_games_thread); + } + } +} + diff -Nru ricochet-0.6/client-host.sn ricochet-0.7/client-host.sn --- ricochet-0.6/client-host.sn 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/client-host.sn 2012-05-30 22:42:28.000000000 +0000 @@ -0,0 +1,193 @@ +/* + * Copyright © 2012 Keith Packard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +autoload Client; +autoload Client::Window; +autoload Client::Link; +autoload Client::Update; +autoload Client::Userlist; +autoload Client::Messages; +autoload Client::Games; +autoload ParseArgs; +autoload RR; +autoload Cairo; +autoload Nichrome; +autoload Nichrome::Button; +autoload Nichrome::Box; +autoload Nichrome::Label; +autoload Nichrome::Toggle; +autoload Nichrome::Textline; +autoload Nichrome::RRboard; +autoload Nichrome::Solid; +autoload Mutex; +autoload Process; + +extend namespace Client { + public namespace Host { + import Nichrome; + import Util; + import Box; + + public string host; + public string name; + public string rrserve_path = "rrserve"; + + try { + name = Environ::get("USER"); + } catch invalid_argument(string message, int id, poly value) { + name = "user"; + } + + *Nichrome::nichrome_t ui; + *Label::label_t name_title; + *Label::label_t name_label; + *Textline::textline_t name_text; + *Label::label_t host_title; + *Label::label_t master_label; + *Label::label_t master; + *Button::button_t master_connect; + *Label::label_t remote_label; + *Textline::textline_t host_text; + *Button::button_t remote_connect; + *Label::label_t local_label; + *Button::button_t local; + *Button::button_t local_connect; + *Button::button_t cancel; + + bool ret; + + void stop (bool val) { + name = name_text->text; + ret = val; + Nichrome::destroy(ui); + } + + void do_ok(*widget_t w, bool state) { + if (state) { + host = host_text->text; + stop(true); + } + } + + void do_cancel(*widget_t w, bool state) { + if (state) { + if (is_uninit(&host)) + exit(0); + stop(false); + } + } + + bool key_callback(*Textline::textline_t widget, string key) { + switch (key) { + case "Return": do_ok(widget, true); return true; + default: + } + return false; + } + + string master_host = "rr.nickle.org"; + + void do_master(*Button::button_t w, bool state) { + if (state) { + host = master_host; + stop(true); + } + } + + void do_remote(*Button::button_t w, bool state) { + if (state) { + host = host_text->text; + stop(true); + } + } + + + void do_local(*Button::button_t w, bool state) { + if (state) { + host = "localhost"; + stop(true); + } + } + + void do_start_local(*Button::button_t w, bool state) { + if (state) { + Process::system(rrserve_path, "rrserve"); + } + } + + public bool select() { + ui = new("Connect to Ricochet Robots Server", 100, 100); + + name_title = new_bold(ui, "Choose a name", Label::justify_t.center); + + name_label = new_left(ui, "User name:"); + name_text = Textline::new(ui, 40); + if (!is_uninit(&name)) + Textline::set_text(name_text, name); + + host_title = new_bold(ui, "Select a server", Label::justify_t.center); + + master_label = new_left (ui, "Master server:"); + master = new_left(ui, master_host); + master_connect = Button::new(ui, "Connect", do_master); + + remote_label = new_left (ui, "Another server:"); + host_text = Textline::new(ui, 40); + host_text->callback = key_callback; + if (!is_uninit(&host)) + Textline::set_text(host_text, host); + remote_connect = Button::new(ui, "Connect", do_remote); + + local_label = new_left (ui, "Local server:"); + local = Button::new(ui, "Start", do_start_local); + local_connect = Button::new(ui, "Connect", do_local); + + cancel = Button::new(ui, "Cancel", do_cancel); + *Box::box_t box = Box::new_empty(); + int row = 0; + Box::add_row(box, 0, row++, + Box::widget_span_item(name_title, 4, 1, 1, 0)); + Box::add_row(box, 0, row++, + Box::widget_item(name_label, 0, 1), + Box::glue_item(1), + Box::widget_item(name_text, 1, 0)); + Box::add_row(box, 0, row++, + Box::widget_span_item(host_title, 4, 1, 1, 0)); + Box::add_row(box, 0, row++, + Box::widget_item(master_label, 0, 1), + Box::glue_item(1), + Box::widget_item(master, 1, 1), + Box::widget_item(master_connect, 1, 0)); + Box::add_row(box, 0, row++, + Box::widget_item(remote_label, 0, 1), + Box::glue_item(1), + Box::widget_item(host_text, 1, 1), + Box::widget_item(remote_connect, 1, 0)); + Box::add_row(box, 0, row++, + Box::widget_item(local_label, 0, 1), + Box::glue_item(1), + Box::widget_item(local, 1, 1), + Box::widget_item(local_connect, 1, 0)); + Box::add_row(box, 0, row++, + Box::widget_item(cancel, 1, 0)); + Nichrome::set_box(ui, box); + set_key_focus(ui, host_text); + Nichrome::main_loop(ui); + return ret; + } + } +} diff -Nru ricochet-0.6/client-link.sn ricochet-0.7/client-link.sn --- ricochet-0.6/client-link.sn 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/client-link.sn 2012-05-21 21:04:32.000000000 +0000 @@ -0,0 +1,145 @@ +/* + * Copyright © 2012 Keith Packard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +autoload RR; +autoload RR::Lex; +autoload RR::Send; +autoload Client; +autoload Client::Net; +autoload Mutex; +autoload List; + +extend namespace Client { + public namespace Link { + + public typedef List::list_t + struct { + string[*] reply; + } message_struct; + + public typedef *message_struct message_t; + + public exception link_error(string); + + typedef struct { + file f; + string host; + int port; + List::list_t replies; + semaphore replies_sem; + List::list_t notices; + semaphore notices_sem; + bool closing; + Mutex::mutex command_lock; + Mutex::mutex notice_lock; + Mutex::mutex reply_lock; + thread reader; + } link_struct; + + public typedef *link_struct link_t; + + public exception link_closing(); + + void read_replies(link_t l) { + try { + for (;;) { + message_t m = &(message_struct) { .reply = RR::Lex::recv(l->f) }; + if (dim(m->reply) == 0) + continue; + twixt (Mutex::acquire(l->reply_lock); Mutex::release(l->reply_lock)) { + if (m->reply[0] == "NOTICE") { + List::append(m, &l->notices); + Semaphore::signal(l->notices_sem); + } else { + List::append(m, &l->replies); + Semaphore::signal(l->replies_sem); + } + } + } + } catch Thread::signal(int sig) { + } catch File::io_eof(file f) { + l->closing = true; + } catch File::io_error(string reason, File::error_type error, file f) { + l->closing = true; + } + while (Semaphore::count(l->notices_sem) < 0) + Semaphore::signal(l->notices_sem); + while (Semaphore::count(l->replies_sem) < 0) + Semaphore::signal(l->replies_sem); + } + + public message_t command(link_t l, string format, poly args...) { + message_t reply; + twixt (Mutex::acquire(l->command_lock); Mutex::release(l->command_lock)) { + try { + RR::Send::send(l->f, format, args...); + File::flush(l->f); + } catch File::io_error(string reason, File::error_type error, file f) { + raise link_error(sprintf("I/O error on link: %s", reason)); + } + Semaphore::wait(l->replies_sem); + twixt(Mutex::acquire(l->reply_lock); Mutex::release(l->reply_lock)) { + if (l->closing) + raise link_closing(); + reply = List::first(&l->replies); + List::remove(reply); + } + } + return reply; + } + + public message_t notice(link_t l) { + message_t notice; + twixt (Mutex::acquire(l->notice_lock); Mutex::release(l->notice_lock)) { + Semaphore::wait(l->notices_sem); + twixt(Mutex::acquire(l->reply_lock); Mutex::release(l->reply_lock)) { + if (l->closing) + raise link_closing(); + notice = List::first(&l->notices); + List::remove(notice); + } + } + return notice; + } + + public link_t new (string host, int port) { + link_t l = &(link_struct) { + .host = host, + .port = port, + .closing = false, + .command_lock = Mutex::new(), + .notice_lock = Mutex::new(), + .reply_lock = Mutex::new(), + .replies_sem = Semaphore::new(), + .notices_sem = Semaphore::new(), + }; + + List::init(&l->replies); + List::init(&l->notices); + + l->f = Net::connect (l->host, l->port); + l->reader = fork read_replies(l); + return l; + } + + public void close(link_t l) { + l->closing = true; + Thread::send_signal(l->reader, 1); + Thread::join(l->reader); + File::close(l->f); + } + } +} diff -Nru ricochet-0.6/client-main.sn ricochet-0.7/client-main.sn --- ricochet-0.6/client-main.sn 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/client-main.sn 2012-06-13 04:53:09.000000000 +0000 @@ -0,0 +1,657 @@ +/* + * Copyright © 2012 Keith Packard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +autoload Client; +autoload Client::Window; +autoload Client::Link; +autoload Client::Update; +autoload Client::Userlist; +autoload Client::Messages; +autoload Client::Games; +autoload Client::Host; +autoload ParseArgs; +autoload RR; +autoload Cairo; +autoload Nichrome; +autoload Nichrome::Button; +autoload Nichrome::Box; +autoload Nichrome::Label; +autoload Nichrome::Toggle; +autoload Nichrome::Textline; +autoload Nichrome::RRboard; +autoload Nichrome::Solid; +autoload Nichrome::Message; +autoload Mutex; + +extend namespace Client { + + public namespace Main { + import Nichrome; + import RRboard; + import Box; + import RR; + import Userlist; + + int port = RR::Port; + + string font = Widget::default_font; + + Mutex::mutex board_lock = Mutex::new(); + + Link::link_t link; + bool watch = false; + + ParseArgs::argdesc argd = { + .args = { + { .var = { .arg_string = &Host::host }, + .abbr = 'h', + .name = "host", + .expr_name = "hostname", + .desc = "server hostname"}, + { .var = { .arg_int = &port }, + .abbr = 'p', + .name = "port", + .expr_name = "port", + .desc = "server port" }, + { .var = { .arg_string = &Host::name }, + .abbr = 'n', + .name = "name", + .expr_name = "username", + .desc = "user name" }, + { .var = { .arg_string = &Games::current_game }, + .abbr = 'g', + .name = "game", + .expr_name = "gamename", + .desc = "proposed game name" }, + { .var = { .arg_string = &font }, + .abbr = 'f', + .name = "font", + .expr_name = "font name", + .desc = "default font name" }, + { .var = { .arg_flag = &watch }, + .abbr = 'w', + .name = "watch", + .desc = "watch game" }, + }, + .unknown = &(int user_argind), + }; + + &nichrome_t ui; + &Label::label_t game_name; + &Label::label_t turn; + &Label::label_t state; + + /* New/Bid mode items */ + &Box::box_t bid_box; + &Button::button_t bid; + &Textline::textline_t bid_value; + &Button::button_t revoke; + &Button::button_t abandon; + &Button::button_t nobid; + + /* Show mode items */ + &Box::box_t show_box; + &Label::label_t moves; + &Button::button_t undo; + &Button::button_t reset; + &Button::button_t pass; + + /* Done mode items */ + &Box::box_t done_box; + &Button::button_t next_turn; + + &Button::button_t select_game; + &Button::button_t quit; + &rrboard_widget_t rrboard; + &userlist_t userlist; + RR::GameState current_state; + &Messages::messages_t messages; + &Nichrome::widget_t desired_focus; + + void update_board(string board) { + twixt (Mutex::acquire(board_lock); Mutex::release(board_lock)) + Update::update(&(rrboard.board), board); + } + + void update_robot(Color color, int x, int y) { + twixt (Mutex::acquire(board_lock); Mutex::release(board_lock)) + Update::update_robot(&(rrboard.board), color, x, y); + } + + void update_target(Color color, Shape shape) { + twixt (Mutex::acquire(board_lock); Mutex::release(board_lock)) + Update::update_target(&(rrboard.board), color, shape); + } + + int current_moves = 0; + + void update_moves(int new_moves) { + current_moves = new_moves; + Label::relabel(&moves, sprintf("Moves: %d", new_moves)); + } + + int current_turn = 0; + + void update_game(string new_game) { + Games::current_game = new_game; + Label::relabel(&game_name, sprintf("Game: %s", Games::current_game)); + } + + void update_turn(int new_turn) { + current_turn = new_turn; + Label::relabel(&turn, sprintf("Turn: %d", new_turn)); + } + + void clear_bid() { + Textline::set_text(&bid_value, ""); + } + + bool messages_active() { + if (is_uninit(&(&ui.key_focus))) + return false; + return &ui.key_focus == messages.input; + } + + void set_focus(&Nichrome::widget_t focus, bool force) { + &desired_focus = &focus; + if (!messages_active() || force) + Nichrome::set_key_focus(&ui, &focus); + } + + void update_state(string new_state) { + Label::relabel(&state, sprintf("State: %s", new_state)); + Nichrome::suspend_draw(&ui); + current_state = RR::game_state(new_state); + Box::set_active(&bid_box, false); + Box::set_active(&done_box, false); + Box::set_active(&show_box, false); + union switch (current_state){ + case NEW: + RRboard::hide_timer(&rrboard); + clear_bid(); + Userlist::clear_bid(&userlist); + Userlist::clear_modes(&userlist); + /* fall through ... */ + case BID: + set_focus(&bid_value, false); + Box::set_active(&bid_box, true); + Userlist::clear_showing(&userlist); + break; + case SHOW: + RRboard::stop_timer(&rrboard); + set_focus(&rrboard, false); + update_moves(0); + Box::set_active(&show_box, true); + break; + case DONE: + RRboard::hide_timer(&rrboard); + set_focus(&rrboard, false); + Box::set_active(&done_box, true); + Userlist::clear_showing(&userlist); + Userlist::clear_modes(&userlist); + break; + } + Nichrome::release_draw(&ui); + } + + void add_user(string name) { + Link::message_t u = Link::command(link, "USERINFO %s\n", name); + if (u->reply[0] == "ERROR") + return; + Userlist::add(&userlist, name, + RR::boolean(u->reply[2]), + string_to_integer(u->reply[3]), + string_to_integer(u->reply[4]), + string_to_integer(u->reply[5])); + } + + void handle_notice(thread main) { + for (;;) { + try { + Link::message_t notice = Link::notice(link); + } catch Link::link_closing() { + break; + } + switch (notice->reply[1]) { + + /* Global game notices */ + case "BOARD": + update_board(notice->reply[2]); + break; + case "GAMESTATE": + update_state (notice->reply[2]); + break; + case "TURN": + update_target(RR::color(notice->reply[2]), + RR::shape(notice->reply[3])); + update_turn(current_turn + 1); + break; + case "GAMEOVER": + /* start new game */ + clear_score(&userlist); + Userlist::update(&userlist); + update_turn(0); + break; + case "JOIN": + case "WATCH": + if (dim(notice->reply) > 3) + if (!is_uninit(&Games::current_game) && notice->reply[3] != Games::current_game) + break; + add_user(notice->reply[2]); + break; + case "PART": + if (dim(notice->reply) > 3) + if (!is_uninit(&Games::current_game) && notice->reply[3] != Games::current_game) + break; + Userlist::remove(&userlist, notice->reply[2]); + break; + case "MESSAGE": + Messages::add(&messages, notice->reply[2], + notice->reply[3]); + break; + + /* Bid notices */ + case "BID": + Userlist::bid(&userlist, notice->reply[2], + string_to_integer(notice->reply[3])); + break; + case "REVOKE": + Userlist::bid(&userlist, notice->reply[2], 0); + break; + case "TIMER": + RRboard::set_timer(&rrboard, + string_to_integer(notice->reply[2])); + break; + case "ABANDON": + Userlist::set_mode(&userlist, notice->reply[2], "abandon"); + break; + case "NOBID": + Userlist::set_mode(&userlist, notice->reply[2], "done"); + break; + + + /* Solving notices */ + case "ACTIVE": + Userlist::showing(&userlist, notice->reply[2], true); + break; + case "MOVE": + update_moves(string_to_integer(notice->reply[2])); + break; + case "UNDO": + update_moves(max(current_moves - 1, 0)); + break; + case "RESET": + update_moves(0); + break; + case "POSITION": + update_robot(RR::color(notice->reply[2]), + string_to_integer(notice->reply[3]), + string_to_integer(notice->reply[4])); + break; + case "SCORE": + Userlist::score(&userlist, notice->reply[2], + string_to_integer(notice->reply[3])); + break; + } + Nichrome::redraw(&ui); + Games::handle_notice(notice); + } + Thread::send_signal(main, 0); + } + + void move_callback(RR::Color color, RR::Direction dir) { + Link::command(link, "MOVE %C %D\n", color, dir); + } + + void do_undo() { + Link::command(link, "UNDO\n"); + } + + void do_bid() { + Link::command(link, "BID %s\n", bid_value.text); + Textline::set_text(&bid_value, ""); + } + + void do_revoke() { + Link::command(link, "REVOKE\n"); + } + + void do_abandon() { + Link::command(link, "ABANDON\n"); + } + + void do_no_bid() { + Link::command(link, "NOBID\n"); + } + + void do_pass() { + Link::command(link, "PASS\n"); + } + + void go_message() { + Messages::set_focus(&messages); + } + + void done_message() { + set_focus(&desired_focus, true); + } + + void do_turn () { + Link::command(link, "TURN\n"); + } + + void do_pass () { + Link::command(link, "PASS\n"); + } + + void do_reset() { + Link::command(link, "RESET\n"); + } + + void message_done(*Messages::messages_t m, string message) { + Link::command(link, "MESSAGE %s\n", message); + done_message(); + } + + bool global_key(&key_event_t key) { + if (key.type != key_type_t.press) + return false; + + if (messages_active()) + return false; + + switch (key.key) { + case "m": case "slash": go_message(); return true; + } + enum switch (current_state) { + case NEW: + case BID: + switch (key.key) { + case "b": case "Return": do_bid(); return true; + case "r": do_revoke(); return true; + case "a": do_abandon(); return true; + case "d": do_no_bid(); return true; + } + break; + case SHOW: + switch (key.key) { + case "p": case "P": + do_pass(); + return true; + case "BackSpace": case "u": case "U": + do_undo(); + return true; + } + break; + case DONE: + switch (key.key) { + case "Return": case "t": case "T": + do_turn(); return true; + } + break; + } + return false; + } + + public void do_quit() { + Link::close(link); + ui.running = false; + RRboard::stop_timer(&rrboard); + exit(0); + } + + public void do_join(string game, bool watch) { + Userlist::clear(&userlist); + + Games::current_game = game; + + Link::message_t r = Link::command(link, "%s %s\n", watch ? "WATCH" : "JOIN", game); + + if (r->reply[0] == "ERROR") { + if (r->reply[1] == "NOGAME") { + Link::message_t r = Link::command(link, "NEW %s\n", game); + if (r->reply[0] == "ERROR") { + printf ("Cannot create game %s: %s\n", game, r->reply[1]); + do_quit(); + } + } else { + printf ("Cannot join game %s: %s\n", game, r->reply[1]); + } + } + + update_game(game); + + Link::message_t r = Link::command(link, "PLAYERS %s\n", game); + + if (r->reply[0] == "ERROR") { + printf ("Cannot enumerate players: %s\n", r->reply[1]); + do_quit(); + } + + for (int i = 1; i < dim(r->reply); i += 2) + add_user(r->reply[i]); + + Link::message_t r = Link::command(link, "GAMEINFO %s\n", game); + + if (r->reply[0] == "ERROR") { + printf ("Cannot get game info for %s: %s\n", game, r->reply[1]); + do_quit(); + } + update_turn(string_to_integer(r->reply[1])); + + update_state(r->reply[4]); + + if (current_state == RR::GameState.SHOW) + Userlist::showing(&userlist, r->reply[7], true); + + Link::message_t r = Link::command(link, "SHOW\n"); + + if (r->reply[0] == "ERROR") { + printf ("Cannot show board: %s\n", r->reply[1]); + do_quit(); + } + + update_board(r->reply[1]); + } + + public void select_game_callback(string game, bool watch) { + do_join (game, watch); + Nichrome::redraw(&ui); + } + + public void do_select_game() { + Games::start(link, select_game_callback); + } + + public void do_select_host() { + if (!Host::select()) + exit(0); + } + + public void main () { + ParseArgs::parseargs(&argd, &argv); + + if (!is_uninit(&font)) + Widget::default_font = font; + + &ui = Nichrome::new("Ricochet Robots", board_width, board_height); + Nichrome::hide(&ui); + Nichrome::set_global_key(&ui, global_key); + &rrboard = RRboard::new(&ui, move_callback); + &userlist = Userlist::new(&ui); + &messages = Messages::new(&ui, 20, message_done, Host::name); + + &select_game = Button::new(&ui, "Switch Game", + void func (&widget_t w, bool state) { + if (state) + do_select_game(); + }); + + &quit = Button::new(&ui, "Quit", + void func (&widget_t w, bool state) { + do_quit(); + }); + + &game_name = Label::new(&ui, "game"); + + &turn = Label::new(&ui, "turn"); + + &state = Label::new(&ui, "state"); + + /* Bid mode items */ + &bid = Button::new(&ui, "Bid", + void func (&widget_t w, bool state) { + if (state) + do_bid(); + }); + + &bid_value = Textline::new(&ui, 6); + clear_bid(); + + &revoke = Button::new(&ui, "Revoke", + void func (&widget_t w, bool state) { + if (state) + do_revoke(); + }); + + &abandon = Button::new(&ui, "Abandon", + void func (&widget_t w, bool state) { + if (state) + do_abandon(); + }); + + &nobid = Button::new(&ui, "Done Bidding", + void func (&widget_t w, bool state) { + if (state) + do_no_bid(); + }); + + &bid_box = Box::new(Box::dir_t.horizontal, + Box::widget_item(&bid, 0), + Box::widget_item(&bid_value, 0), + Box::widget_item(&revoke, 0), + Box::widget_item(&abandon, 0), + Box::widget_item(&nobid, 0)); + + /* Show mode items */ + &moves = Label::new(&ui, "moves"); + + &undo = Button::new(&ui, "Undo Move", + void func (&widget_t w, bool state) { + if (state) + do_undo(); + }); + + &reset = Button::new(&ui, "Reset Robots", + void func (&widget_t w, bool state) { + if (state) + do_reset(); + }); + &pass = Button::new(&ui, "Pass", + void func (&widget_t w, bool state) { + if (state) + do_pass(); + }); + &show_box = Box::new(Box::dir_t.horizontal, + Box::widget_item(&moves, 0), + Box::widget_item(&undo, 0), + Box::widget_item(&reset, 0), + Box::widget_item(&pass, 0)); + + &next_turn = Button::new(&ui, "Turn", + void func (&widget_t w, bool state) { + if (state) + do_turn(); + }); + + &done_box = Box::new(Box::dir_t.horizontal, + Box::widget_item(&next_turn, 0)); + + &box_t top = Box::new (Box::dir_t.horizontal, + Box::widget_item(&game_name, 0), + Box::widget_item(&turn, 0), + Box::widget_item(&state, 0), + Box::box_item(&show_box), + Box::box_item(&bid_box), + Box::box_item(&done_box), + Box::glue_item(1), + Box::widget_item(&select_game, 0), + Box::widget_item(&quit, 0)); + &box_t rbox = Box::new (Box::dir_t.vertical, + Box::box_item(userlist.box), + Box::widget_item(Solid::new(&ui, 1, 1), + 1, 0), + Box::box_item(messages.vbox)); + &box_t hbox = Box::new (Box::dir_t.horizontal, + Box::widget_item(&rrboard, 1, 1, 1), + Box::box_item(&rbox)); + + &box_t vbox = Box::new (Box::dir_t.vertical, + Box::box_item(&top), + Box::box_item(&hbox)); + + set_box(&ui, &vbox); + + for (;;) { + if (is_uninit(&Host::host)) + do_select_host(); + + try { + for (;;) { + try { + link = Link::new(Host::host, port); + + Link::message_t r = Link::command(link, "helo %s\n", Host::name); + + if (r->reply[0] == "ERROR") + raise Link::link_error(sprintf("%s %s", r->reply[1], Host::name)); + break; + } catch Link::link_error(string reason) { + Nichrome::Message::new("Connection failed", + sprintf ("host \"%s\": %s", Host::host, reason)); + } + do_select_host(); + } + + thread me = Thread::current(); + fork handle_notice(me); + + Userlist::set_link(&userlist, link); + + if (is_uninit(&Games::current_game)) { + do_select_game(); + Games::wait(); + } + + if (is_uninit(&Games::current_game)) + do_quit(); + + Nichrome::show(&ui); + + main_loop(&ui); + } catch Thread::signal(int sig) { + if (sig != 0) + raise Thread::signal(sig); + make_uninit(&Host::host); + Userlist::clear_link(&userlist); + Nichrome::hide(&ui); + } + } + } + } +} + diff -Nru ricochet-0.6/client-messages.sn ricochet-0.7/client-messages.sn --- ricochet-0.6/client-messages.sn 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/client-messages.sn 2012-05-21 21:04:32.000000000 +0000 @@ -0,0 +1,92 @@ +/* + * Copyright © 2012 Keith Packard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +autoload Client; +autoload Nichrome; +autoload Nichrome::Box; +autoload Nichrome::Text; +autoload Nichrome::Textline; +autoload Nichrome::Label; +autoload Nichrome::Scrollbar; +autoload Nichrome::Solid; + +extend namespace Client { + public namespace Messages { + import Nichrome; + + public typedef messages_t; + + protected typedef void (*messages_t m, string text) callback_t; + + public typedef struct { + *nichrome_t ui; + *Box::box_t hbox; + *Box::box_t vbox; + *Text::text_t output; + *Scrollbar::scrollbar_t scrollbar; + *Label::label_t name; + *Textline::textline_t input; + callback_t done_callback; + } messages_t; + + protected void add (&messages_t m, string user, string message) { + Text::insert(m.output, String::length(m.output->text), + sprintf ("<%s> %s\n", user, message)); + while (Text::scroll_down(m.output)) + ; + } + + void send(&messages_t m) { + string s = m.input->text; + Textline::set_text(m.input, ""); + m.done_callback(&m, s); + } + + protected void set_focus(*messages_t m) { + Nichrome::set_key_focus(m->ui, m->input); + } + + protected *messages_t new(&nichrome_t ui, int lines, callback_t done_callback, string name) { + *messages_t m = &(messages_t) { + .ui = &ui, + .output = Text::new(&ui), + .name = Label::new(&ui, sprintf("%s: ", name)), + .input = Textline::new(&ui, 40), + .done_callback = done_callback + }; + bool key_callback(&Textline::textline_t widget, string key) { + switch (key) { + case "Return": send(m); break; + default: return false; + } + return true; + } + m->input->callback = key_callback; + m->scrollbar = Text::scrollbar(m->output); + m->hbox = Box::new(Box::dir_t.horizontal, + Box::widget_item(m->output, 1, 1), + Box::widget_item(m->scrollbar, 0, 1)); + m->vbox = Box::new(Box::dir_t.vertical, + Box::box_item(m->hbox), + Box::widget_item(Solid::new(&ui, 1, 1), 1, 0), + Box::box_item(Box::new(Box::dir_t.horizontal, + Box::widget_item(m->name, 0), + Box::widget_item(m->input, 1, 0)))); + return m; + } + } +} diff -Nru ricochet-0.6/client-net.sn ricochet-0.7/client-net.sn --- ricochet-0.6/client-net.sn 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/client-net.sn 2012-02-12 05:46:39.000000000 +0000 @@ -0,0 +1,29 @@ +/* + * Copyright © 2012 Keith Packard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +autoload Client; +autoload RR; + +extend namespace Client { + namespace Net { + public file connect (string host, int port) { + file f = Sockets::create(Sockets::SOCK_STREAM); + Sockets::connect(f, host, port); + return f; + } + } +} diff -Nru ricochet-0.6/client.sn ricochet-0.7/client.sn --- ricochet-0.6/client.sn 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/client.sn 2012-02-10 17:15:06.000000000 +0000 @@ -0,0 +1,19 @@ +/* + * Copyright © 2012 Keith Packard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +namespace Client { +} diff -Nru ricochet-0.6/client-update.sn ricochet-0.7/client-update.sn --- ricochet-0.6/client-update.sn 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/client-update.sn 2012-02-21 20:44:15.000000000 +0000 @@ -0,0 +1,136 @@ +/* + * Copyright © 2012 Keith Packard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +autoload Client; +autoload RR; +autoload Nichrome::RRboard; + +extend namespace Client { + public namespace Update { + + import Nichrome::RRboard; + import RR; + + public void update(&RR::Board board, string image) { + + string[*] lines = String::split(image, "\n"); + + int width = (String::length(lines[1]) - 1) / 4; + int height = (dim(lines) - 2) / 2; + + void update_hwall(int x, int y, bool above) { + if (y > 0) + board[x,y-1].walls.below = above; + if (y < height) + board[x,y].walls.above = above; + } + + void update_vwall(int x, int y, int c) { + bool left; + + switch (c) { + case '|': + left = true; + break; + case ' ': + left = false; + break; + } + if (x > 0) + board[x-1,y].walls.right = left; + if (x < width) + board[x,y].walls.left = left; + } + + void update_hwalls(int y, string line) { + for (int x = 0; x < width; x++) + update_hwall(x, y, line[x*4 + 2] == '='); + } + + void update_squares(int y, string line) { + int x; + for (x = 0; x < width; x++) { + update_vwall(x, y, line[x*4]); + string robot = String::substr(line,x*4+1,1); + if (robot == ".") + board[x,y].robot = RobotOrNone.none; + else { + Color c = color(robot); + Robot r = { .color = color(robot), + .active = Ctype::isupper(robot[0]) }; + board[x,y].robot = (RobotOrNone.robot) r; + } + string target = String::substr(line,x*4+2,2); + if (target[0] == '.') { + board[x,y].target = TargetOrNone.none; + } else { + Color c = color(String::substr(target,0,1)); + Shape s = shape(String::substr(target,1,1)); + Target t = { .color = c, + .shape = s, + .active = Ctype::isupper(target[0]) }; + board[x,y].target = (TargetOrNone.target) t; + } + } + update_vwall(x, y, line[x*4]); + } + + int x, y; + for (y = 0; y < height; y++) { + update_hwalls(y, lines[y*2 + 1]); + update_squares(y, lines[y*2 + 2]); + } + update_hwalls(y, lines[y*2 + 1]); + } + + public void update_robot(&RR::Board board, Color color, int new_x, int new_y) { + bool active = false; + for (int y = 0; y < RR::Height; y++) { + for (int x = 0; x < RR::Width; x++) { + union switch (board[x,y].robot) { + case robot r: + if (r.color == color) { + active = r.active; + board[x,y].robot = RobotOrNone.none; + } + break; + default: + break; + } + } + } + board[new_x, new_y].robot = (RobotOrNone.robot) (Robot) { .color = color, .active = active }; + } + + public void update_target(&RR::Board board, Color color, Shape shape) { + for (int y = 0; y < RR::Height; y++) { + for (int x = 0; x < RR::Width; x++) { + union switch (board[x,y].target) { + case target t: + if (t.color == color && t.shape == shape) + board[x,y].target.target.active = true; + else + board[x,y].target.target.active = false; + break; + default: + break; + } + } + } + } + } +} diff -Nru ricochet-0.6/client-userlist.sn ricochet-0.7/client-userlist.sn --- ricochet-0.6/client-userlist.sn 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/client-userlist.sn 2012-06-13 04:45:32.000000000 +0000 @@ -0,0 +1,345 @@ +/* + * Copyright © 2012 Keith Packard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +autoload Client; +autoload Client::Link; +autoload Nichrome; +autoload Nichrome::Box; +autoload Nichrome::Label; +autoload Nichrome::Solid; +autoload Mutex; + +extend namespace Client { + public namespace Userlist { + + import Nichrome; + + typedef struct { + string name; + *Label::label_t name_label; + bool playing; + int games; + *Label::label_t games_label; + int score; + *Label::label_t score_label; + int bid; + *Label::label_t bid_label; + string mode; + *Label::label_t mode_label; + } user_t; + + typedef union { + *user_t user; + void none; + } user_or_none_t; + + typedef struct { + *Label::label_t label; + int width; + } column_t; + + public typedef struct { + *nichrome_t ui; + *Box::box_t box; + column_t name; + column_t games; + column_t score; + column_t bid; + column_t mode; + (*user_t)[...] names; + user_or_none_t showing; + string font; + string bold_font; + string italic_font; + Link::link_t link; + Mutex::mutex lock; + } userlist_t; + + bool user_greater(*user_t a, *user_t b) = a->name > b->name; + + string games_string(int games) { + return sprintf("%d", games); + } + + string score_string(bool playing, int score) { + if (playing) + return sprintf("%d", score); + return ""; + } + + string bid_string(bool playing, int bid) { + if (playing) + return sprintf("%d", bid); + return ""; + } + + void forname(*userlist_t ul, string name, void (*user_t, int u) doit) { + twixt(Mutex::acquire(ul->lock); Mutex::release(ul->lock)) { + for (int u = 0; u < dim(ul->names); u++) + if (ul->names[u]->name == name) { + doit (ul->names[u], u); + break; + } + } + } + + void foreach(*userlist_t ul, void (*user_t, int u) doit) { + twixt(Mutex::acquire(ul->lock); Mutex::release(ul->lock)) { + for (int u = 0; u < dim(ul->names); u++) + doit (ul->names[u], u); + } + } + + public void score(*userlist_t ul, string name, int score) { + forname(ul, name, void func (*user_t user, int u) { + user->score = score; + Label::relabel(user->score_label, score_string(user->playing, user->score)); + }); + } + + void update_user(*userlist_t ul, *user_t user) { + Link::message_t r = Link::command(ul->link, "USERINFO %s\n", user->name); + if (r->reply[0] == "ERROR") + return; + user->playing = RR::boolean(r->reply[2]); + user->games = string_to_integer(r->reply[3]); + Label::relabel(user->games_label, games_string(user->games)); + user->score = string_to_integer(r->reply[4]); + Label::relabel(user->score_label, score_string(user->playing, user->score)); + user->bid = string_to_integer(r->reply[5]); + Label::relabel(user->bid_label, bid_string(user->playing, user->bid)); + } + + public void bid(*userlist_t ul, string name, int bid) { + forname(ul, name, void func (*user_t user, int u) { + user->bid = bid; + Label::relabel(user->bid_label, bid_string(user->playing, user->bid)); + }); + } + + public void clear_bid(*userlist_t ul) { + foreach(ul, void func (*user_t user, int u) { + user->bid = 0; + Label::relabel(user->bid_label, bid_string(user->playing, user->bid)); + }); + } + + public void clear_score(*userlist_t ul) { + foreach(ul, void func (*user_t user, int u) { + user->score = 0; + Label::relabel(user->score_label, score_string(user->playing, user->score)); + }); + } + + void set_font(*user_t user, string font) { + user->name_label->font = font; + user->games_label->font = font; + user->score_label->font = font; + user->bid_label->font = font; + user->mode_label->font = font; + } + + void set_showing (*userlist_t ul, *user_t user, bool showing) { + if (showing) { + if (ul->showing != (user_or_none_t.user) user) { + union switch (ul->showing) { + case user old: + set_font(old, ul->font); + break; + default: + } + ul->showing = (user_or_none_t.user) user; + set_font(user, ul->bold_font); + } + } else { + if (ul->showing == (user_or_none_t.user) user) { + ul->showing = user_or_none_t.none; + set_font(user, ul->font); + } + } + } + + public void showing(*userlist_t ul, string name, bool showing) { + forname(ul, name, void func (*user_t user, int u) { + set_showing (ul, user, showing); + }); + } + + public void clear_showing(*userlist_t ul) { + twixt(Mutex::acquire(ul->lock); Mutex::release(ul->lock)) { + union switch (ul->showing) { + case user u: + set_showing (ul, u, false); + break; + default: + } + } + } + + public void clear_modes(*userlist_t ul) { + foreach (ul, void func (*user_t user, int u) { + Label::relabel(user->mode_label, ""); + }); + } + + public void set_mode(*userlist_t ul, string name, string mode) { + forname (ul, name, void func (*user_t user, int u) { + user->mode = mode; + Label::relabel(user->mode_label, user->mode); + }); + } + + public void update(*userlist_t ul) { + foreach (ul, void func (*user_t user, int u) { + update_user(ul, user); + }); + } + + bool user_gt(*user_t a, *user_t b) { + if (!a->playing && b->playing) + return true; + if (a->playing && !b->playing) + return false; + return a->name > b->name; + } + + public void add(*userlist_t ul, string name, bool playing, int games, int score, int bid) { + twixt(Mutex::acquire(ul->lock); Mutex::release(ul->lock)) { + for (int u = 0; u < dim (ul->names); u++) + if (ul->names[u]->name == name) + return; + + *user_t user = &(user_t) { + .name = name, + .name_label = Label::new(ul->ui, name), + .playing = playing, + .games = games, + .games_label = Label::new(ul->ui, games_string(games)), + .score = score, + .score_label = Label::new(ul->ui, score_string(playing, score)), + .bid = bid, + .bid_label = Label::new(ul->ui, bid_string(playing, bid)), + .mode = "", + .mode_label = Label::new(ul->ui, ""), + }; + + string font = ul->font; + if (!playing) + font = ul->italic_font; + user->name_label->font = font; + user->name_label->justify = Label::justify_t.left; + user->games_label->font = font; + user->score_label->font = font; + user->bid_label->font = font; + user->mode_label->font = font; + + int u = 0; + for (; u < dim (ul->names); u++) + if (user_gt (ul->names[u], user)) + break; + + Box::suspend(ul->box); + Box::insert_row(ul->box, u+2); + Box::add_row(ul->box, 0, u+2, + Box::widget_item(user->name_label, 0, 0), + Box::widget_item(user->games_label, 0, 0), + Box::widget_item(user->score_label, 0, 0), + Box::widget_item(user->bid_label, 0, 0), + Box::widget_item(user->mode_label, 0, 0)); + Box::release(ul->box); + + for (int t = dim(ul->names); t > u; t--) + ul->names[t] = ul->names[t-1]; + + ul->names[u] = user; + } + } + + public void remove(*userlist_t ul, string name) { + forname(ul, name, void func (*user_t user, int u) { + Box::delete_row(ul->box, u + 2); + for (; u < dim(ul->names) - 1; u++) + ul->names[u] = ul->names[u+1]; + setdim(ul->names, dim(ul->names) - 1); + }); + } + + public void clear(*userlist_t ul) { + twixt(Mutex::acquire(ul->lock); Mutex::release(ul->lock)) { + Box::clear(ul->box, 0, 2, 0, dim(ul->names)); + setdim(ul->names, 0); + } + } + + protected void set_link(*userlist_t ul, Link::link_t link) { + ul->link = link; + } + + protected void clear_link(*userlist_t ul) { + make_uninit(&ul->link); + } + + protected void init (*userlist_t ul, + *nichrome_t ui) { + ul->ui = ui; + ul->font = Widget::default_font; + ul->bold_font = sprintf("%s:bold", Widget::default_font); + ul->italic_font = sprintf("%s:italic", Widget::default_font); + + ul->names = ((*user_t)[...]) {}; + ul->lock = Mutex::new(); + Cairo::cairo_t cr = Nichrome::cairo(ui); + Cairo::set_font(cr, ul->font); + Cairo::text_extents_t x = Cairo::text_extents(cr, "x"); + real x_width = x.x_advance; + void init_column(*column_t column, string label, int width) { + column->label = Label::new(ui, label); + column->label->font = ul->bold_font; + column->width = ceil(width * x_width); + } + init_column(&ul->name, "Player", 32); + ul->name.label->justify = Label::justify_t.left; + init_column(&ul->games, "Games", 3); + init_column(&ul->score, "Score", 2); + init_column(&ul->bid, "Bid", 3); + init_column(&ul->mode, "State", 12); + ul->box = Box::new(Box::dir_t.horizontal, + Box::widget_item(ul->name.label, 0), + Box::widget_item(ul->games.label, 0), + Box::widget_item(ul->score.label, 0), + Box::widget_item(ul->bid.label, 0), + Box::widget_item(ul->mode.label, 0)); + Box::add_row(ul->box, 0, 1, + Box::widget_span_item(Solid::new(ui, 1, 1), + 100, 1, 1, 0)); + Box::add_row(ul->box, 0, 2, + Box::glue_item(ul->name.width, 0, 0, 0), + Box::glue_item(ul->games.width, 0, 0, 0), + Box::glue_item(ul->score.width, 0, 0, 0), + Box::glue_item(ul->bid.width, 0, 0, 0), + Box::glue_item(ul->mode.width, 0, 0, 0)); + + ul->showing = user_or_none_t.none; + } + + public *userlist_t new (*nichrome_t ui) { + *userlist_t ul = &(userlist_t) {}; + init(ul, ui); + return ul; + } + } +} diff -Nru ricochet-0.6/client-util.sn ricochet-0.7/client-util.sn --- ricochet-0.6/client-util.sn 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/client-util.sn 2012-05-21 21:04:32.000000000 +0000 @@ -0,0 +1,35 @@ +/* + * Copyright © 2012 Keith Packard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +extend namespace Client { + public namespace Util { + import Nichrome; + + public *Label::label_t new_left(*nichrome_t ui, string label) { + *Label::label_t l = Label::new(ui, label); + l->justify = Label::justify_t.left; + return l; + } + + public *Label::label_t new_bold(*nichrome_t ui, string label, Label::justify_t justify) { + *Label::label_t l = Label::new(ui, label); + l->font = l->font + ":bold"; + l->justify = justify; + return l; + } + } +} diff -Nru ricochet-0.6/client-window.sn ricochet-0.7/client-window.sn --- ricochet-0.6/client-window.sn 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/client-window.sn 2012-02-10 22:00:49.000000000 +0000 @@ -0,0 +1,37 @@ +/* + * Copyright © 2012 Keith Packard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +autoload Cairo; +autoload Nichrome; +autoload Nichrome::Button; +autoload Nichrome::Box; +autoload Nichrome::Label; +autoload Nichrome::Toggle; +autoload Nichrome::RRboard; + +autoload RR; +autoload Client; +autoload Client::SVG; + +extend namespace Client { + public namespace Window { + import Nichrome; + + void play() { + } + } +} diff -Nru ricochet-0.6/configure.ac ricochet-0.7/configure.ac --- ricochet-0.6/configure.ac 2017-03-23 14:30:22.000000000 +0000 +++ ricochet-0.7/configure.ac 2017-04-30 15:28:06.000000000 +0000 @@ -16,7 +16,7 @@ AC_PREREQ([2.64]) -AC_INIT([server-main.5c],[0.6],[http://rr.nickle.org],[ricochet]) +AC_INIT([server-main.5c],[0.7],[http://rr.nickle.org],[ricochet]) AC_CONFIG_SRCDIR([server-main.5c]) AC_CONFIG_AUX_DIR(.) diff -Nru ricochet-0.6/debian/changelog ricochet-0.7/debian/changelog --- ricochet-0.6/debian/changelog 2017-03-23 14:30:22.000000000 +0000 +++ ricochet-0.7/debian/changelog 2017-04-30 15:28:25.000000000 +0000 @@ -1,3 +1,9 @@ +ricochet (0.7) unstable; urgency=medium + + * Add build dependency on cairo-5c >= 1.7. Closes: #861531. + + -- Keith Packard Sun, 30 Apr 2017 08:28:25 -0700 + ricochet (0.6) unstable; urgency=medium * Debian standard 3.9.8 diff -Nru ricochet-0.6/debian/control ricochet-0.7/debian/control --- ricochet-0.6/debian/control 2017-03-23 14:30:22.000000000 +0000 +++ ricochet-0.7/debian/control 2017-04-30 15:27:20.000000000 +0000 @@ -2,7 +2,7 @@ Section: games Priority: extra Maintainer: Keith Packard -Build-Depends: debhelper (>= 10), autotools-dev, nickle (>= 2.74) +Build-Depends: debhelper (>= 10), autotools-dev, nickle (>= 2.74), cairo-5c (>= 1.7) Standards-Version: 3.9.8 Homepage: http://rr.nickle.org diff -Nru ricochet-0.6/debian/ricochet.menu ricochet-0.7/debian/ricochet.menu --- ricochet-0.6/debian/ricochet.menu 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/debian/ricochet.menu 2014-02-10 08:11:14.000000000 +0000 @@ -0,0 +1,3 @@ +?package(ricochet):needs="X11" section="Games/Board"\ + title="Ricochet Robots" command="/usr/games/ricochet" + diff -Nru ricochet-0.6/debian/run-pdebuild.sh ricochet-0.7/debian/run-pdebuild.sh --- ricochet-0.6/debian/run-pdebuild.sh 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/debian/run-pdebuild.sh 2012-05-30 22:20:24.000000000 +0000 @@ -0,0 +1,11 @@ +#!/bin/sh +dest=`dirname $0` +case "$dest" in +/*) + ;; +*) + dest=`pwd`/$dest + ;; +esac + +pdebuild --debbuildopts -i --auto-debsign --buildresult $dest/../.. -- --basetgz /var/cache/pbuilder/base-i386.tgz diff -Nru ricochet-0.6/edit-test.5c ricochet-0.7/edit-test.5c --- ricochet-0.6/edit-test.5c 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/edit-test.5c 2012-03-19 18:43:09.000000000 +0000 @@ -0,0 +1,51 @@ +autoload Nichrome; +autoload Nichrome::Edit; +autoload Nichrome::Box; +autoload Nichrome::Scrollbar; + +import Nichrome; + +string text = ("Fourscore and seven years ago our fathers brought forth on\n" + + "this continent a new nation, conceived in liberty and\n" + + "dedicated to the proposition that all men are created equal.\n" + + "\n" + + "Now we are engaged in a great civil war, testing whether that\n" + + "nation or any nation so conceived and so dedicated can long\n" + + "endure. We are met on a great battlefield of that war. We\n" + + "have come to dedicate a portion of it as a final resting\n" + + "place for those who died here that the nation might live.\n" + + "This we may, in all propriety do. But in a larger sense, we\n" + + "cannot dedicate, we cannot consecrate, we cannot hallow this\n" + + "ground. The brave men, living and dead who struggled here\n" + + "have hallowed it far above our poor power to add or detract.\n" + + "The world will little note nor long remember what we say here,\n" + + "but it can never forget what they did here.\n" + + "\n" + + "It is rather for us the living, we here be dedicated to the\n" + + "great task remaining before us--that from these honored\n" + + "dead we take increased devotion to that cause for which they\n" + + "here gave the last full measure of devotion--that we here\n" + + "highly resolve that these dead shall not have died in vain, that\n" + + "this nation shall have a new birth of freedom, and that\n" + + "government of the people, by the people, for the people shall\n" + + "not perish from the earth.\n"); + + +public void main () { + &nichrome_t ui; + &Box::box_t box; + &Edit::edit_t edit; + &Scrollbar::scrollbar_t scrollbar; + + &ui = Nichrome::new("Edit test", 200, 200); + &edit = Edit::new(&ui); + &scrollbar = Edit::scrollbar(&edit); + Edit::insert(&edit, 0, text); + &box = Box::new(Box::dir_t.horizontal, + Box::widget_item(&edit, 1), + Box::widget_item(&scrollbar, 0)); + set_box(&ui, &box); + main_loop(&ui); +} + +main(); diff -Nru ricochet-0.6/edit-test.sn ricochet-0.7/edit-test.sn --- ricochet-0.6/edit-test.sn 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/edit-test.sn 2012-03-19 18:43:09.000000000 +0000 @@ -0,0 +1,51 @@ +autoload Nichrome; +autoload Nichrome::Edit; +autoload Nichrome::Box; +autoload Nichrome::Scrollbar; + +import Nichrome; + +string text = ("Fourscore and seven years ago our fathers brought forth on\n" + + "this continent a new nation, conceived in liberty and\n" + + "dedicated to the proposition that all men are created equal.\n" + + "\n" + + "Now we are engaged in a great civil war, testing whether that\n" + + "nation or any nation so conceived and so dedicated can long\n" + + "endure. We are met on a great battlefield of that war. We\n" + + "have come to dedicate a portion of it as a final resting\n" + + "place for those who died here that the nation might live.\n" + + "This we may, in all propriety do. But in a larger sense, we\n" + + "cannot dedicate, we cannot consecrate, we cannot hallow this\n" + + "ground. The brave men, living and dead who struggled here\n" + + "have hallowed it far above our poor power to add or detract.\n" + + "The world will little note nor long remember what we say here,\n" + + "but it can never forget what they did here.\n" + + "\n" + + "It is rather for us the living, we here be dedicated to the\n" + + "great task remaining before us--that from these honored\n" + + "dead we take increased devotion to that cause for which they\n" + + "here gave the last full measure of devotion--that we here\n" + + "highly resolve that these dead shall not have died in vain, that\n" + + "this nation shall have a new birth of freedom, and that\n" + + "government of the people, by the people, for the people shall\n" + + "not perish from the earth.\n"); + + +public void main () { + &nichrome_t ui; + &Box::box_t box; + &Edit::edit_t edit; + &Scrollbar::scrollbar_t scrollbar; + + &ui = Nichrome::new("Edit test", 200, 200); + &edit = Edit::new(&ui); + &scrollbar = Edit::scrollbar(&edit); + Edit::insert(&edit, 0, text); + &box = Box::new(Box::dir_t.horizontal, + Box::widget_item(&edit, 1), + Box::widget_item(&scrollbar, 0)); + set_box(&ui, &box); + main_loop(&ui); +} + +main(); diff -Nru ricochet-0.6/list.sn ricochet-0.7/list.sn --- ricochet-0.6/list.sn 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/list.sn 2012-02-12 05:27:36.000000000 +0000 @@ -0,0 +1,78 @@ +/* + * Copyright © 2012 Keith Packard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +namespace List { + public typedef list_t; + + public typedef struct { + *list_t prev; + *list_t next; + } list_t; + + public void init(*list_t l) { + l->next = l; + l->prev = l; + } + + void add(*list_t entry, *list_t prev, *list_t next) { + next->prev = entry; + entry->next = next; + entry->prev = prev; + prev->next = entry; + } + + void del(*list_t prev, *list_t next) { + next->prev = prev; + prev->next = next; + } + + public bool is_empty(*list_t head) { + return head->next == head; + } + + public *list_t first(*list_t head) { + assert(!is_empty(head), "empty list"); + return head->next; + } + + public *list_t last(*list_t head) { + assert(!is_empty(head), "empty list"); + return head->prev; + } + + public void insert(*list_t entry, *list_t head) { + add(entry, head, head->next); + } + + public void append(*list_t entry, *list_t head) { + add(entry, head->prev, head); + } + + public void remove(*list_t entry) { + del(entry->prev, entry->next); + init(entry); + } + + public iterate(*list_t head, bool (*list_t) f) { + *list_t next; + for (*list_t pos = head->next; pos != head; pos = next) { + next = pos->next; + if (!f(pos)) + break; + } + } +} diff -Nru ricochet-0.6/make-icon.sn ricochet-0.7/make-icon.sn --- ricochet-0.6/make-icon.sn 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/make-icon.sn 2014-02-09 20:35:19.000000000 +0000 @@ -0,0 +1,84 @@ +#!/usr/bin/env nickle + +autoimport ParseArgs; + +string ricochet_lib = String::dirname(argv[0]); +string target_file; + +argdesc argd = { + args = { + { + .var = (arg_var.arg_string) &ricochet_lib, + .name = "libdir", + .desc = "Directory containing Ricochet nickle files" + } + }, + posn_args = { + { + .var = (arg_var.arg_string) &target_file, + .name = "targetfile", + } + } +}; + +parseargs(&argd, &argv) + +Command::nickle_path = ricochet_lib + ":" + Command::nickle_path; + +autoload Cairo; + +autoload Client; +autoload Client::Svg; +autoload RR; +autoload Client::Draw; + +void main () +{ + Cairo::cairo_t cr; + + if (!is_uninit(&target_file)) + cr = Cairo::new_svg(target_file, 32, 32); + else + cr = Cairo::new(); + + RR::RobotOrNone robot = (RR::RobotOrNone) { + .robot = (RR::Robot) { + .color = RR::Color.Blue + } + }; + + RR::RobotOrNone robot_none = (RR::RobotOrNone) { + .none = ◊ + }; + + RR::TargetOrNone target = (RR::TargetOrNone) { + .target = (RR::Target) { + .color = RR::Color.Blue, + .shape = RR::Shape.Triangle, + .active = true + } + }; + + RR::Object object = (RR::Object) { + .target = target, + .robot = robot_none + }; + + Client::Draw::transform_t transform = (Client::Draw::transform_t) { + .xoff = 0, + .yoff = 0, + .xscale = 1, + .yscale = 1 + }; + + Client::Draw::background(cr, 0, 0, object, &transform); + + Client::Draw::contents(cr, 0, 0, object, target, robot, &transform); + + if (dim(argv) <= 1) + sleep(10000); + else + Cairo::destroy(cr); +} + +main(); diff -Nru ricochet-0.6/nichrome-message.sn ricochet-0.7/nichrome-message.sn --- ricochet-0.6/nichrome-message.sn 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/nichrome-message.sn 2012-05-21 21:04:32.000000000 +0000 @@ -0,0 +1,50 @@ +/* + * Copyright © 2012 Keith Packard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +autoload Nichrome; +autoload Nichrome::Button; +autoload Nichrome::Box; +autoload Nichrome::Label; +autoload Nichrome::Toggle; +autoload Nichrome::Textline; +autoload Nichrome::RRboard; +autoload Nichrome::Solid; + +extend namespace Nichrome { + public namespace Message { + public typedef struct { + *nichrome_t ui; + } message_t; + + protected message_t new (string title, string contents) { + *message_t message = &(message_t) {}; + message->ui = Nichrome::new(title, 100, 100); + + *Box::box_t box = Box::new(Box::dir_t.vertical, + Box::widget_item(Label::new(message->ui, contents), 1, 1), + Box::box_item(Box::new(Box::dir_t.horizontal, + Box::glue_item(1), + Box::widget_item(Button::new(message->ui, + "OK", + void func (*widget_t w, bool state) { + Nichrome::destroy(message->ui); + }), 0, 0)))); + Nichrome::set_box(message->ui, box); + main_loop(message->ui); + } + } +} diff -Nru ricochet-0.6/nichrome-rrboard.sn ricochet-0.7/nichrome-rrboard.sn --- ricochet-0.6/nichrome-rrboard.sn 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/nichrome-rrboard.sn 2012-06-09 23:35:15.000000000 +0000 @@ -0,0 +1,287 @@ +/* + * Copyright © 2012 Keith Packard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +autoload Nichrome; +autoload RR; +autoload Client; +autoload Client::Draw; +autoload Mutex; +autoload Nichrome::Timer; + +extend namespace Nichrome { + + public namespace RRboard { + + import Client; + import RR; + + public int border_width = ceil(Draw::wall_thickness / 2); + public int board_width = RR::Width * Draw::cell_width; + public int total_width = board_width + border_width * 2; + public int board_height = RR::Height * Draw::cell_height; + public int total_height = board_height + border_width * 2; + + public typedef widget_t + struct { + RR::Board board; + RR::RobotOrNone active_robot; + *Timer::timer_t timer; + void (RR::Color color, + RR::Direction direction) move_callback; + int button_x, button_y; + } rrboard_widget_t; + + real dimension(&rrboard_widget_t widget) = min (widget.geometry.width, widget.geometry.height); + + Draw::transform_t transform(&rrboard_widget_t widget) { + real dim = dimension(&widget); + real xscale = dim / total_width; + real yscale = dim / total_height; + return (Draw::transform_t) { + .xscale = xscale, + .yscale = yscale, + .xoff = (widget.geometry.width - dim) // 2 + ceil(border_width * xscale), + .yoff = (widget.geometry.height - dim) // 2 + ceil(border_width * yscale) + }; + } + + bool is_middle(int x, int y) { + if (x < RR::Width / 2 - 1) + return false; + if (x >= RR::Width / 2 + 1) + return false; + if (y < RR::Height / 2 - 1) + return false; + if (y >= RR::Height / 2 + 1) + return false; + return true; + } + + void draw (cairo_t cr, &rrboard_widget_t widget) { + Draw::transform_t t = transform(&widget); + RR::TargetOrNone active_target = RR::active_target(&widget.board); + + save(cr); + for (int y = 0; y < RR::Height; y++) + for (int x = 0; x < RR::Width; x++) + if (!is_middle(x, y)) + Draw::background(cr, x, y, widget.board[x,y], &t); + for (int y = 0; y < RR::Height; y++) + for (int x = 0; x < RR::Width; x++) { + Draw::walls(cr, x, y, widget.board[x,y], &t); + Draw::contents(cr, x, y, widget.board[x,y], + active_target, widget.active_robot, &t); + } + Draw::target(cr, RR::Width / 2 - 1, RR::Height / 2 - 1, + active_target, &t); + restore(cr); + } + + void outline (cairo_t cr, &rrboard_widget_t widget) { + rectangle(cr, 0, 0, widget.geometry.width, widget.geometry.height); + } + + void natural (cairo_t cr, &rrboard_widget_t widget) { + rectangle(cr, 0, 0, total_width, total_height); + } + + /* Override default widget configure function to also reposition + * the timer widget + */ + void configure (&rrboard_widget_t widget, rect_t geometry) { + Widget::configure(&widget, geometry); + + /* Configure timer to sit over the central + * region of the board + */ + real board_dim = dimension(&widget); + real timer_dim = board_dim * 2 / RR::Width; + real timer_pos = board_dim / RR::Width * 7; + widget.timer->configure (widget.timer, + (rect_t) { + .x = geometry.x + timer_pos, + .y = geometry.y + timer_pos, + .width = timer_dim, + .height = timer_dim + }); + } + + void set_active_robot(&rrboard_widget_t widget, RR::Robot robot) { + widget.active_robot = (RR::RobotOrNone.robot) robot; + Widget::redraw(&widget); + } + + void set_active (&rrboard_widget_t widget, string color) { + try { + set_active_robot(&widget, (RR::Robot) { .color = RR::color(color) }); + } catch RR::rr_error(RR::Error error) { + } + } + + void move_active (&rrboard_widget_t widget, string dir) { + try { + RR::Direction direction = RR::direction(dir); + union switch (widget.active_robot) { + case robot r: + widget.move_callback(r.color, direction); + break; + default: + } + } catch RR::rr_error(RR::Error error) { + } + } + + protected void key (&rrboard_widget_t widget, &key_event_t event) { + + if (event.type != key_type_t.press) + return; + + switch (event.key) { + case "r": case "R": + case "g": case "G": + case "b": case "B": + case "y": case "Y": + set_active (&widget, event.key); + break; + case " ": + set_active (&widget, "whirl"); + break; + case "Left": case "w": case "W": + move_active(&widget, "west"); + break; + case "Right": case "e": case "E": + move_active(&widget, "east"); + break; + case "Up": case "n": case "N": + move_active(&widget, "north"); + break; + case "Down": case "s": case "S": + move_active(&widget, "south"); + break; + } + } + + typedef struct { int x, y; } position_t; + + /* + * A bit expensive, but it's more reliable than trying to + * keep track of robot positions separately + */ + position_t find_robot (&rrboard_widget_t widget, RR::Robot robot) { + for (int y = 0; y < RR::Height; y++) + for (int x = 0; x < RR::Width; x++) { + union switch (widget.board[x,y].robot) { + case robot r: + if (r.color == robot.color) + return (position_t) { .x = x, .y = y }; + break; + default: + } + } + return (position_t) { .x = 0, .y = 0 }; + } + + protected void button (&rrboard_widget_t widget, &button_event_t event) { + + /* Convert button position to board location */ + Draw::transform_t t = transform(&widget); + int x = floor ((event.x - t.xoff) / t.xscale / Draw::cell_width); + int y = floor ((event.y - t.yoff) / t.yscale / Draw::cell_height); + + enum switch (event.type) { + case press: + RR::Object object = widget.board[x,y]; + + /* Clicking on a robot selects that robot + */ + union switch (object.robot) { + case robot r: + set_active_robot(&widget, r); + break; + default: + } + break; + case release: + + /* Releasing with an active robot moves the robot + * towards the point of release + */ + union switch (widget.active_robot) { + case robot r: + position_t robot_pos = find_robot(&widget, r); + int dx = x - robot_pos.x; + int dy = y - robot_pos.y; + + if (abs (dx) > abs (dy)) { + if (dx < 0) + move_active(&widget, "west"); + else if (dx > 0) + move_active(&widget, "east"); + } else { + if (dy < 0) + move_active(&widget, "north"); + else if (dy > 0) + move_active(&widget, "south"); + } + break; + default: + break; + } + break; + default: + } + } + + protected void set_timer (&rrboard_widget_t widget, real time) { + Timer::set_timer(widget.timer, time); + } + + protected void stop_timer (&rrboard_widget_t widget) { + Timer::stop_timer(widget.timer); + } + + protected void hide_timer (&rrboard_widget_t widget) { + Timer::stop_timer(widget.timer); + Timer::hide(widget.timer); + } + + protected void show_timer (&rrboard_widget_t widget) { + Timer::show(widget.timer); + } + + public *rrboard_widget_t new(&nichrome_t nichrome, + void(RR::Color color, RR::Direction dir) move_callback){ + &rrboard_widget_t widget = &(rrboard_widget_t) {}; + + widget.timer = Timer::new(&nichrome); /* make sure timer is above rrboard */ + Widget::init(&nichrome, &widget); + widget.draw = draw; + widget.outline = outline; + widget.natural = natural; + widget.configure = configure; + widget.key = key; + widget.button = button; + widget.active_robot = RobotOrNone.none; + widget.move_callback = move_callback; + widget.board = (RR::Board) { { { .robot = RobotOrNone.none, + .target = TargetOrNone.none, + .walls = { .left = false, .right = false, + .above = false, .below = false } + } ... } ... }; + return &widget; + } + } +} diff -Nru ricochet-0.6/nichrome-timer.sn ricochet-0.7/nichrome-timer.sn --- ricochet-0.6/nichrome-timer.sn 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/nichrome-timer.sn 2012-06-09 23:35:08.000000000 +0000 @@ -0,0 +1,135 @@ +/* + * Copyright © 2012 Keith Packard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +autoload Nichrome; +autoload Mutex; + +extend namespace Nichrome { + public namespace Timer { + + public typedef widget_t + struct { + Mutex::mutex lock; + bool running; + bool visible; + int end; + thread timer; + } timer_t; + + void draw (cairo_t cr, &timer_t widget) { + if (!widget.visible) + return; + real left; + if (widget.running) { + left = (widget.end - millis()) / 1000; + + if (left < 0) + left = 0; + if (left > 60) + left = 60; + } else + left = 0; + real filled = 60 - left; + save (cr); + scale (cr, widget.geometry.width / 2, widget.geometry.height / 2); + move_to (cr, 1, 1); + arc (cr, + 1, 1, /* center */ + 0.9, /* radius */ + - π / 2, /* start angle */ + 2 * π * (filled) / 60.0 - π/2); /* end angle */ + close_path (cr); + set_source_rgba (cr, 0.0, 0.0, 0.0, 0.5); + fill (cr); + restore (cr); + } + + void run_timer (&timer_t widget) { + twixt(Mutex::acquire(widget.lock); Mutex::release(widget.lock)) { + try { + while ((int now = millis()) <= widget.end) { + int delay = (widget.end - now) % 100; + if (delay == 0) + delay = 100; + twixt(Mutex::release(widget.lock); Mutex::acquire(widget.lock)) { + sleep(delay); + Widget::redraw(&widget); + } + } + } catch Thread::signal (int sig) { + } + widget.running = false; + } + } + + void start_timer (&timer_t widget) { + twixt(Mutex::acquire(widget.lock); Mutex::release(widget.lock)) { + } + } + + protected void set_timer (&timer_t widget, real time) { + twixt(Mutex::acquire(widget.lock); Mutex::release(widget.lock)) { + widget.visible = true; + widget.end = millis() + floor (time * 1000 + 0.5); + if (!widget.running) { + widget.running = true; + widget.timer = fork run_timer(&widget); + } + } + } + + protected void stop_timer (&timer_t widget) { + widget.end = millis(); + twixt(Mutex::acquire(widget.lock); Mutex::release(widget.lock)) { + if (widget.running) + Thread::send_signal(widget.timer, 0); + } + } + + protected void hide(&timer_t widget) { + widget.visible = false; + } + + protected void show(&timer_t widget) { + widget.visible = true; + } + + void outline (cairo_t cr, &timer_t widget) { + rectangle(cr, 0, 0, 0, 0); + } + + void natural (cairo_t cr, &timer_t widget) { + rectangle(cr, 0, 0, 100, 100); + } + + protected void init(*nichrome_t nichrome, &timer_t widget) { + Widget::init(nichrome, &widget); + widget.draw = draw; + widget.outline = outline; + widget.natural = natural; + widget.lock = Mutex::new(); + widget.running = false; + widget.visible = false; + } + + protected *timer_t new(*nichrome_t nichrome) { + &timer_t widget = &(timer_t) {}; + + init(nichrome, &widget); + return &widget; + } + } +} diff -Nru ricochet-0.6/README.txt ricochet-0.7/README.txt --- ricochet-0.6/README.txt 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/README.txt 2012-05-12 20:37:16.000000000 +0000 @@ -0,0 +1 @@ +Multi-user networked ricochet robots game Binary files /tmp/tmpL8vcWc/U0QVVGNxr2/ricochet-0.6/ricochet_0.5_all.deb and /tmp/tmpL8vcWc/YSucLLNXtc/ricochet-0.7/ricochet_0.5_all.deb differ diff -Nru ricochet-0.6/ricochet_0.5_amd64.build ricochet-0.7/ricochet_0.5_amd64.build --- ricochet-0.6/ricochet_0.5_amd64.build 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/ricochet_0.5_amd64.build 2017-03-23 14:29:39.000000000 +0000 @@ -0,0 +1,116 @@ + dpkg-buildpackage -rfakeroot -us -uc -j5 +dpkg-buildpackage: info: source package ricochet +dpkg-buildpackage: info: source version 0.5 +dpkg-buildpackage: info: source distribution unstable +dpkg-buildpackage: info: source changed by Keith Packard + dpkg-source --before-build ricochet-0.6 +dpkg-buildpackage: info: host architecture amd64 + fakeroot debian/rules clean +dh clean --with autotools-dev + dh_testdir + dh_auto_clean + dh_autoreconf_clean + dh_autotools-dev_restoreconfig + dh_clean + dpkg-source -b ricochet-0.6 +dpkg-source: info: using source format '3.0 (native)' +dpkg-source: info: building ricochet in ricochet_0.5.tar.xz +dpkg-source: info: building ricochet in ricochet_0.5.dsc + debian/rules build +dh build --with autotools-dev + dh_testdir + dh_update_autotools_config + dh_autoreconf + dh_autotools-dev_updateconfig + debian/rules override_dh_auto_configure +make[1]: Entering directory '/local/src/ricochet/ricochet-0.6' +dh_auto_configure -- --bindir=/usr/games --enable-gameman + ./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=\${prefix}/include --mandir=\${prefix}/share/man --infodir=\${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=\${prefix}/lib/x86_64-linux-gnu --libexecdir=\${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode --disable-dependency-tracking --bindir=/usr/games --enable-gameman +configure: WARNING: unrecognized options: --disable-dependency-tracking +checking for a BSD-compatible install... /usr/bin/install -c +checking whether build environment is sane... yes +checking for a thread-safe mkdir -p... /bin/mkdir -p +checking for gawk... gawk +checking whether make sets $(MAKE)... yes +checking whether make supports nested variables... yes +checking whether to enable maintainer-specific portions of Makefiles... no +checking that generated files are newer than configure... done +configure: creating ./config.status +config.status: creating Makefile +config.status: creating ricochet.man +config.status: creating rrserve.man +config.status: creating ricochet.spec +configure: WARNING: unrecognized options: --disable-dependency-tracking +make[1]: Leaving directory '/local/src/ricochet/ricochet-0.6' + dh_auto_build + make -j5 +make[1]: Entering directory '/local/src/ricochet/ricochet-0.6' +sed -e 's#%ricochetlibdir%#/usr/share/ricochet#' -e 's#%ricochetbindir%#/usr/games#' ./ricochet.in > ricochet && chmod +x ricochet +sed -e 's#%ricochetlibdir%#/usr/share/ricochet#' ./rrserve.in > rrserve && chmod +x rrserve +sed -e 's#%bindir%#/usr/games#' ./ricochet.desktop.in > ricochet.desktop +rm -f client-svg.5c +nickle ./svg/bin2cstring.5c ./svg/cell1.svg ./svg/cell2.svg ./svg/robot_blue.svg ./svg/robot_green.svg ./svg/robot_red.svg ./svg/robot_yellow.svg ./svg/target_blue_circle.svg ./svg/target_blue_octagon.svg ./svg/target_blue_square.svg ./svg/target_blue_triangle.svg ./svg/target_green_circle.svg ./svg/target_green_octagon.svg ./svg/target_green_square.svg ./svg/target_green_triangle.svg ./svg/target_red_circle.svg ./svg/target_red_octagon.svg ./svg/target_red_square.svg ./svg/target_red_triangle.svg ./svg/target_whirl.svg ./svg/target_yellow_circle.svg ./svg/target_yellow_octagon.svg ./svg/target_yellow_square.svg ./svg/target_yellow_triangle.svg ./svg/wall.svg ./svg/robot_shadow.svg > client-svg.5c +nickle ./make-icon.5c --libdir ".":"." ricochet-icon.svg +make[1]: Leaving directory '/local/src/ricochet/ricochet-0.6' + dh_auto_test + create-stamp debian/debhelper-build-stamp + fakeroot debian/rules binary +dh binary --with autotools-dev + dh_testroot + dh_prep + dh_auto_install + make -j5 install DESTDIR=/local/src/ricochet/ricochet-0.6/debian/ricochet AM_UPDATE_INFO_DIR=no +make[1]: Entering directory '/local/src/ricochet/ricochet-0.6' +make[2]: Entering directory '/local/src/ricochet/ricochet-0.6' + /bin/mkdir -p '/local/src/ricochet/ricochet-0.6/debian/ricochet/usr/games' + /bin/mkdir -p '/local/src/ricochet/ricochet-0.6/debian/ricochet/usr/share/applications' + /bin/mkdir -p '/local/src/ricochet/ricochet-0.6/debian/ricochet/usr/share/icons/hicolor/scalable/apps' + /bin/mkdir -p '/local/src/ricochet/ricochet-0.6/debian/ricochet/usr/share/man/man6' + /bin/mkdir -p '/local/src/ricochet/ricochet-0.6/debian/ricochet/usr/share/ricochet' + /usr/bin/install -c ricochet rrserve '/local/src/ricochet/ricochet-0.6/debian/ricochet/usr/games' + /usr/bin/install -c -m 644 ricochet-icon.svg '/local/src/ricochet/ricochet-0.6/debian/ricochet/usr/share/icons/hicolor/scalable/apps' + /usr/bin/install -c -m 644 ricochet.desktop '/local/src/ricochet/ricochet-0.6/debian/ricochet/usr/share/applications' + /usr/bin/install -c -m 644 'ricochet.man' '/local/src/ricochet/ricochet-0.6/debian/ricochet/usr/share/man/man6/ricochet.6' + /usr/bin/install -c -m 644 array.5c list.5c shuffle.5c timer.5c rr.5c rr-lex.5c rr-send.5c client.5c client-board.5c client-draw.5c client-games.5c client-host.5c client-link.5c client-main.5c client-messages.5c client-net.5c client-update.5c client-userlist.5c client-util.5c client-window.5c nichrome-message.5c nichrome-rrboard.5c nichrome-timer.5c server.5c server-boards.5c server-clients.5c server-dispatch.5c server-games.5c server-main.5c server-net.5c server-readreq.5c server-show.5c client-svg.5c '/local/src/ricochet/ricochet-0.6/debian/ricochet/usr/share/ricochet' + /usr/bin/install -c -m 644 'rrserve.man' '/local/src/ricochet/ricochet-0.6/debian/ricochet/usr/share/man/man6/rrserve.6' +make[2]: Leaving directory '/local/src/ricochet/ricochet-0.6' +make[1]: Leaving directory '/local/src/ricochet/ricochet-0.6' + dh_installdocs + dh_installchangelogs + dh_installman + dh_icons + dh_perl + dh_link + dh_strip_nondeterminism + dh_compress + dh_fixperms + dh_installdeb + dh_gencontrol + dh_md5sums + dh_builddeb +dpkg-deb: building package 'ricochet' in '../ricochet_0.5_all.deb'. + dpkg-genbuildinfo + dpkg-genchanges >../ricochet_0.5_amd64.changes +dpkg-genchanges: info: including full source code in upload + dpkg-source --after-build ricochet-0.6 +dpkg-buildpackage: info: full upload; Debian-native package (full source is included) +Now running lintian... +W: ricochet source: timewarp-standards-version (2015-06-09 < 2016-04-06) +Finished running lintian. +Now signing changes and any dsc files... + signfile dsc ricochet_0.5.dsc C383B778255613DFDB409D91DB221A6900000011 +gpg: Note: old default options file '/home/keithp/.gnupg/options' ignored +gpg: Note: old default options file '/home/keithp/.gnupg/options' ignored + + fixup_buildinfo ricochet_0.5.dsc ricochet_0.5_amd64.buildinfo + signfile buildinfo ricochet_0.5_amd64.buildinfo C383B778255613DFDB409D91DB221A6900000011 +gpg: Note: old default options file '/home/keithp/.gnupg/options' ignored +gpg: Note: old default options file '/home/keithp/.gnupg/options' ignored + + fixup_changes dsc ricochet_0.5.dsc ricochet_0.5_amd64.changes + fixup_changes buildinfo ricochet_0.5_amd64.buildinfo ricochet_0.5_amd64.changes + signfile changes ricochet_0.5_amd64.changes C383B778255613DFDB409D91DB221A6900000011 +gpg: Note: old default options file '/home/keithp/.gnupg/options' ignored +gpg: Note: old default options file '/home/keithp/.gnupg/options' ignored + +Successfully signed dsc, buildinfo, changes files diff -Nru ricochet-0.6/ricochet_0.5_amd64.buildinfo ricochet-0.7/ricochet_0.5_amd64.buildinfo --- ricochet-0.6/ricochet_0.5_amd64.buildinfo 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/ricochet_0.5_amd64.buildinfo 2017-03-23 14:29:39.000000000 +0000 @@ -0,0 +1,207 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA256 + +Format: 1.0 +Source: ricochet +Binary: ricochet +Architecture: all source +Version: 0.5 +Checksums-Md5: + c45d738fafc0db175574cddc8618aaa6 1447 ricochet_0.5.dsc + f802896d864100688afe5d7d32d17ea9 46616 ricochet_0.5_all.deb +Checksums-Sha1: + 06d4ffefbb15bdffbab8ca7a85d17ccde7731cf9 1447 ricochet_0.5.dsc + 52e46808ddac22a5fe7009ae700894bf5d781c3b 46616 ricochet_0.5_all.deb +Checksums-Sha256: + 033adaf41eea8984d631ff8e8e6cd9aca6713513f41689d9d69b45b79a198ee2 1447 ricochet_0.5.dsc + 007cb387185282e5f3e3bba9133664f50fc4fee36e6149019c9b3b2e7f2c278b 46616 ricochet_0.5_all.deb +Build-Origin: Debian +Build-Architecture: amd64 +Build-Date: Thu, 23 Mar 2017 15:29:37 +0100 +Installed-Build-Depends: + autoconf (= 2.69-10), + automake (= 1:1.15-6), + automake1.10 (= 1:1.10.3-3.1), + automake1.11 (= 1:1.11.6-4), + autopoint (= 0.19.8.1-2), + autotools-dev (= 20161112.1), + base-files (= 9.8), + base-passwd (= 3.5.43), + bash (= 4.4-4+b1), + binutils (= 2.28-2), + bsdmainutils (= 9.0.12), + bsdutils (= 1:2.29.2-1), + build-essential (= 12.3), + bzip2 (= 1.0.6-8.1), + coreutils (= 8.26-3), + cpp (= 4:6.3.0-2), + cpp-4.8 (= 4.8.5-4), + cpp-4.9 (= 4.9.4-2), + cpp-5 (= 5.4.1-8), + cpp-6 (= 6.3.0-10), + dash (= 0.5.8-2.4), + debconf (= 1.5.60), + debhelper (= 10.2.5), + debianutils (= 4.8.1), + dh-autoreconf (= 13), + dh-strip-nondeterminism (= 0.032-1), + diffutils (= 1:3.5-3), + dpkg (= 1.18.23), + dpkg-dev (= 1.18.23), + e2fslibs (= 1.43.4-2), + e2fsprogs (= 1.43.4-2), + file (= 1:5.29-3), + findutils (= 4.6.0+git+20161106-2), + g++ (= 4:6.3.0-2), + g++-6 (= 6.3.0-10), + gawk (= 1:4.1.4+dfsg-1), + gcc (= 4:6.3.0-2), + gcc-4.8 (= 4.8.5-4), + gcc-4.8-base (= 4.8.5-4), + gcc-4.9 (= 4.9.4-2), + gcc-4.9-base (= 4.9.4-2), + gcc-5 (= 5.4.1-8), + gcc-5-base (= 5.4.1-8), + gcc-6 (= 6.3.0-10), + gcc-6-base (= 6.3.0-10), + gettext (= 0.19.8.1-2), + gettext-base (= 0.19.8.1-2), + grep (= 2.27-2), + groff-base (= 1.22.3-9), + gzip (= 1.6-5+b1), + hostname (= 3.18+b1), + init-system-helpers (= 1.47), + install-info (= 6.3.0.dfsg.1-1+b2), + intltool-debian (= 0.35.0+20060710.4), + libacl1 (= 2.2.52-3+b1), + libarchive-zip-perl (= 1.59-1), + libasan0 (= 4.8.5-4), + libasan1 (= 4.9.4-2), + libasan2 (= 5.4.1-8), + libasan3 (= 6.3.0-10), + libatomic1 (= 6.3.0-10), + libattr1 (= 1:2.4.47-2+b2), + libaudit-common (= 1:2.6.7-1), + libaudit1 (= 1:2.6.7-1), + libblkid1 (= 2.29.2-1), + libbsd0 (= 0.8.3-1), + libbz2-1.0 (= 1.0.6-8.1), + libc-bin (= 2.24-9), + libc-dev-bin (= 2.24-9), + libc6 (= 2.24-9), + libc6-dev (= 2.24-9), + libcap-ng0 (= 0.7.7-3+b1), + libcc1-0 (= 6.3.0-10), + libcilkrts5 (= 6.3.0-10), + libcloog-isl4 (= 0.18.4-1+b1), + libcomerr2 (= 1.43.4-2), + libcroco3 (= 0.6.11-2), + libdb5.3 (= 5.3.28-12+b1), + libdebconfclient0 (= 0.226), + libdpkg-perl (= 1.18.23), + libfdisk1 (= 2.29.2-1), + libffi6 (= 3.2.1-6), + libfile-stripnondeterminism-perl (= 0.032-1), + libgcc-4.8-dev (= 4.8.5-4), + libgcc-4.9-dev (= 4.9.4-2), + libgcc-5-dev (= 5.4.1-8), + libgcc-6-dev (= 6.3.0-10), + libgcc1 (= 1:6.3.0-10), + libgcrypt20 (= 1.7.6-1), + libgdbm3 (= 1.8.3-14), + libglib2.0-0 (= 2.50.3-2), + libgmp10 (= 2:6.1.2+dfsg-1), + libgomp1 (= 6.3.0-10), + libgpg-error0 (= 1.26-2), + libicu57 (= 57.1-5), + libisl15 (= 0.18-1), + libitm1 (= 6.3.0-10), + liblsan0 (= 6.3.0-10), + liblz4-1 (= 0.0~r131-2+b1), + liblzma5 (= 5.2.2-1.2+b1), + libmagic-mgc (= 1:5.29-3), + libmagic1 (= 1:5.29-3), + libmount1 (= 2.29.2-1), + libmpc3 (= 1.0.3-1+b2), + libmpfr4 (= 3.1.5-1), + libmpx0 (= 5.4.1-8), + libmpx2 (= 6.3.0-10), + libncurses5 (= 6.0+20161126-1), + libncursesw5 (= 6.0+20161126-1), + libpam-modules (= 1.1.8-3.5), + libpam-modules-bin (= 1.1.8-3.5), + libpam-runtime (= 1.1.8-3.5), + libpam0g (= 1.1.8-3.5), + libpcre3 (= 2:8.39-3), + libperl5.24 (= 5.24.1-2), + libpipeline1 (= 1.4.1-2), + libquadmath0 (= 6.3.0-10), + libreadline7 (= 7.0-2), + libselinux1 (= 2.6-3), + libsemanage-common (= 2.6-2), + libsemanage1 (= 2.6-2), + libsepol1 (= 2.6-2), + libsigsegv2 (= 2.10-5), + libsmartcols1 (= 2.29.2-1), + libss2 (= 1.43.4-2), + libstdc++-6-dev (= 6.3.0-10), + libstdc++6 (= 6.3.0-10), + libsystemd0 (= 232-21), + libtimedate-perl (= 2.3000-2), + libtinfo5 (= 6.0+20161126-1), + libtool (= 2.4.6-2), + libtsan0 (= 6.3.0-10), + libubsan0 (= 6.3.0-10), + libudev1 (= 232-21), + libunistring0 (= 0.9.6+really0.9.3-0.1), + libustr-1.0-1 (= 1.0.4-6), + libuuid1 (= 2.29.2-1), + libxml2 (= 2.9.4+dfsg1-2.2), + linux-libc-dev (= 4.9.16-1), + login (= 1:4.4-4), + m4 (= 1.4.18-1), + make (= 4.1-9.1), + man-db (= 2.7.6.1-2), + mawk (= 1.3.3-17+b3), + mount (= 2.29.2-1), + multiarch-support (= 2.24-9), + ncurses-base (= 6.0+20161126-1), + ncurses-bin (= 6.0+20161126-1), + nickle (= 2.79-2), + passwd (= 1:4.4-4), + patch (= 2.7.5-1+b2), + perl (= 5.24.1-2), + perl-base (= 5.24.1-2), + perl-modules-5.24 (= 5.24.1-2), + po-debconf (= 1.0.20), + readline-common (= 7.0-2), + sed (= 4.4-1), + sensible-utils (= 0.0.9), + sysvinit-utils (= 2.88dsf-59.9), + tar (= 1.29b-1.1), + util-linux (= 2.29.2-1), + xz-utils (= 5.2.2-1.2+b1), + zlib1g (= 1:1.2.8.dfsg-5) +Environment: + DEB_BUILD_OPTIONS="parallel=5" + LANG="en_US.utf8" + LC_CTYPE="en_US.UTF-8" + MAKEFLAGS=" -j5" + SOURCE_DATE_EPOCH="1433851254" + +-----BEGIN PGP SIGNATURE----- + +iQIzBAEBCAAdFiEEw4O3eCVWE9/bQJ2R2yIaaQAAABEFAljT29MACgkQ2yIaaQAA +ABHYww//QNN4R5uNZ8fws1FmFvVy33Gl3rXcHaCbtTsTdCgkCk2tBIxEkDb5UzHy +S4z29lbEn9Hbou2kaDYK8Zf3bPUW/LGZZl0jeJWmoPC4lUdhJ4SsREtC+Bta/4Jv +cGfsbMcu2VAOABrE7yRMuPXTMPJqEoOAZFN95cWUOcD2ShSgtSua14cJIG1I07hi +ZcwTFx8VjxU0IJBnWZ0VFn2VWNxiEkhrHlxq559td8jaqsocUKRcYIlKfl2RktJy +DJXs9cUytVLr3APn/xAxH4HRfkZzUoaBnh4rWjImIrQbGCLsDtpZVNXDagXF5pB+ +vID7U02Xbn+8KooUw6o6w+kXcDtXwSZzbGMMd6vEg3aQnADYCSO6sMcu0y7iQwqq +k+Ur1hMe/I2tzjypnROE5XsFv6H8xsA90+HBvK3SHoDESPpRWDJYEHjKc1c+s7aF +a9tnly2GqyhKRWMrcO3yTQyO1FoP3Ftnu6BMzLeElJZ4QNWgs9oz9x3WkhAp+R0g +Sc2jMlw6Ie8d7rIp56HuWKIXOXmYcs4B9/laUwnonZjUbdG+DELIBEOb/dUuwZdE +o0icI124pHxc9F+Yo4HRQHelePychfUD8/AEb+47gDLGrbqoU6XtZ7mVRTzn+rvk +75dwLtYEwZcTvHiAJ7NUIXPxrvtU+2XcsriU3ymmFsFn3SdcOrc= +=KUyt +-----END PGP SIGNATURE----- diff -Nru ricochet-0.6/ricochet_0.5_amd64.changes ricochet-0.7/ricochet_0.5_amd64.changes --- ricochet-0.6/ricochet_0.5_amd64.changes 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/ricochet_0.5_amd64.changes 2017-03-23 14:29:39.000000000 +0000 @@ -0,0 +1,54 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA256 + +Format: 1.8 +Date: Tue, 09 Jun 2015 06:00:54 -0600 +Source: ricochet +Binary: ricochet +Architecture: source all +Version: 0.5 +Distribution: unstable +Urgency: medium +Maintainer: Keith Packard +Changed-By: Keith Packard +Description: + ricochet - multi-user networked version of the Ricochet Robots game +Closes: 787675 +Changes: + ricochet (0.5) unstable; urgency=medium + . + * Make build reproducible by setting BUILD_DATE from changelog. + Closes: #787675. + * Release version 0.5. +Checksums-Sha1: + 06d4ffefbb15bdffbab8ca7a85d17ccde7731cf9 1447 ricochet_0.5.dsc + 623fff875d99df9ecd207254b396ae011d0406cf 95420 ricochet_0.5.tar.xz + 52e46808ddac22a5fe7009ae700894bf5d781c3b 46616 ricochet_0.5_all.deb + 00efad303e677c1618fcca8b00f8efd741ca758b 5904 ricochet_0.5_amd64.buildinfo +Checksums-Sha256: + 033adaf41eea8984d631ff8e8e6cd9aca6713513f41689d9d69b45b79a198ee2 1447 ricochet_0.5.dsc + 62f4dfd897bacb049199ec2c7041dfb2527243abd1efbc2b3548fa1ce695e41c 95420 ricochet_0.5.tar.xz + 007cb387185282e5f3e3bba9133664f50fc4fee36e6149019c9b3b2e7f2c278b 46616 ricochet_0.5_all.deb + 6dac5e7abc9c76484d5738db8a7ac061dd92eb948f9dc285673289c56c343344 5904 ricochet_0.5_amd64.buildinfo +Files: + c45d738fafc0db175574cddc8618aaa6 1447 games extra ricochet_0.5.dsc + 992b330f083c63dd8707ec9ebf6f554f 95420 games extra ricochet_0.5.tar.xz + f802896d864100688afe5d7d32d17ea9 46616 games extra ricochet_0.5_all.deb + 49cee21d7386cfc95e1a26365859007f 5904 games extra ricochet_0.5_amd64.buildinfo + +-----BEGIN PGP SIGNATURE----- + +iQIzBAEBCAAdFiEEw4O3eCVWE9/bQJ2R2yIaaQAAABEFAljT29MACgkQ2yIaaQAA +ABGROxAAkZatrLf0/FF2mREhKDbQrhazTR8y0R6OUK+pWy0RsBZLYzEHR/07tgri +8H1wjW8rOjRUQpFmBs1JhYplMA4ool7nbptnXx5c/soOCuG8crdlKiH9vMq/U7Gq +nhWn3rpvjSBVlpJUFm31WafqyY/xkbz9ahQMf+WreDfBdi0KsFB26/Ok4R6596a9 +Wjxv5bcF/FM/S6SY7s+5idJ4Iu4N8H6ft0IIZl5A6a2lGI7LveQSlytNm2FsQIhv +cmL4MZ2WVIH2lpu4a/rzak10iJeQ+Y1+Fst2YbH5IBmODrhhXuqFwWvpKiz2oPUm +SCOJM5dmQa2C/+qzvqHY8HCT7PPpeFzfaKGpaBBsVt7YIzBprIa9WcxpSxa9kKhi +SYZLyTontrM13OJl1U4yY7uqeanvYkTc3Mi6A4f7HtHFUg4+x4nYxtwoQd8/XeKv +hhbn7znv470eoHS1++mpoBjoTxYqF3+O5vs6RMhHX1iT1f7cfbqLpA96j8roWib5 +NvgzNSyGszhWjrDM6KvEm039rRSUbR3v3DGZsZ0x0WBkshNB5plZLbbFqznCjmbd +rF13dnN81x0NJoQGJOO8hd6uOfVzo3X7qov8NlINCHZYdtzlNBplidh1YnK3r9DF +yMzusvFje46rPHanvJBYLH8uNLrsktsXLidMuzSpcYjS1FtCO+U= +=11jM +-----END PGP SIGNATURE----- diff -Nru ricochet-0.6/ricochet_0.5.dsc ricochet-0.7/ricochet_0.5.dsc --- ricochet-0.6/ricochet_0.5.dsc 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/ricochet_0.5.dsc 2017-03-23 14:29:39.000000000 +0000 @@ -0,0 +1,37 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA256 + +Format: 3.0 (native) +Source: ricochet +Binary: ricochet +Architecture: all +Version: 0.5 +Maintainer: Keith Packard +Homepage: http://rr.nickle.org +Standards-Version: 3.9.8 +Build-Depends: debhelper (>= 10), autotools-dev, nickle (>= 2.74) +Package-List: + ricochet deb games extra arch=all +Checksums-Sha1: + 623fff875d99df9ecd207254b396ae011d0406cf 95420 ricochet_0.5.tar.xz +Checksums-Sha256: + 62f4dfd897bacb049199ec2c7041dfb2527243abd1efbc2b3548fa1ce695e41c 95420 ricochet_0.5.tar.xz +Files: + 992b330f083c63dd8707ec9ebf6f554f 95420 ricochet_0.5.tar.xz + +-----BEGIN PGP SIGNATURE----- + +iQIzBAEBCAAdFiEEw4O3eCVWE9/bQJ2R2yIaaQAAABEFAljT29IACgkQ2yIaaQAA +ABFwtRAAnaeru6DsCPdjAnbtq0tWL598MQnuO9VMkjNdsahaxW5qJFfUZ6if+EHJ +Bpalm4UqK3mncBpkAdBtKQtAtcchzxaHdW2R2hOKIMAn+swUq4D0HBcDttzEfOVd +cQjiTu0TlYgtdPbd8Bk6eyIaeg+aCaYDh68Rluj+akKV8klQVZC0cmmzJm08891w +ACPz6oBAmLX8Fd2YRW/MV72gWVJlZ9Toj+0GgTHJgjGq/CNncJImFyftPdW3I3fp +HvPEpCUhZ35BLp3xF7l9ByLw748T5XC/TNzfWrAkp0SgTiPh1/SY1r8IcsUzNoqP +HWOgmzwptX/2tE03dnX6OXXqP8jwX5FnZAZ6rJMVKoxOQAE1UynfkPdZoFhJI5DS +ejEYcybt3JA9PReLwAMisKuUNhZVfev8d1NNfKubbREIYVUcmcuodjuiRtx/5nyb +TfRyN/ONRgkXYpTII5Aclv83ryyxKu+5ianatDHL80zwNAwT4STzBtpp+ovnRkFQ +bBe/Q+AWXgvD3w1GY6PjOSD5iBYiFRxL1VGNy4/Qde/bMVjC4d63IMk12Ij4Ri14 +iKUxVLMRCsXLr2Rqa3KWF27PXt8iMzTR0b3CjgPcLo3ZQZkdRRGS0RL4wR4GnqRE +5NoxODz/d9iE7R0ivyrhVwbUconrDaV7ejFnWEwbOVSdus4DBHY= +=yPDG +-----END PGP SIGNATURE----- Binary files /tmp/tmpL8vcWc/U0QVVGNxr2/ricochet-0.6/ricochet_0.5.orig.tar.gz and /tmp/tmpL8vcWc/YSucLLNXtc/ricochet-0.7/ricochet_0.5.orig.tar.gz differ Binary files /tmp/tmpL8vcWc/U0QVVGNxr2/ricochet-0.6/ricochet-0.5.tar.gz and /tmp/tmpL8vcWc/YSucLLNXtc/ricochet-0.7/ricochet-0.5.tar.gz differ Binary files /tmp/tmpL8vcWc/U0QVVGNxr2/ricochet-0.6/ricochet_0.5.tar.xz and /tmp/tmpL8vcWc/YSucLLNXtc/ricochet-0.7/ricochet_0.5.tar.xz differ diff -Nru ricochet-0.6/ricochet-0.6/aclocal.m4 ricochet-0.7/ricochet-0.6/aclocal.m4 --- ricochet-0.6/ricochet-0.6/aclocal.m4 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/ricochet-0.6/aclocal.m4 2017-03-23 14:30:22.000000000 +0000 @@ -0,0 +1,809 @@ +# generated automatically by aclocal 1.15 -*- Autoconf -*- + +# Copyright (C) 1996-2014 Free Software Foundation, Inc. + +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) + +# Copyright (C) 2002-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.15' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.15], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.15])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to +# '$srcdir', '$srcdir/..', or '$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is '.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ([2.52])dnl + m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.65])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[AC_DIAGNOSE([obsolete], + [$0: two- and three-arguments forms are deprecated.]) +m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if( + m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl +]) +AC_REQUIRE([AM_SILENT_RULES])dnl +dnl The testsuite driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This +dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi +dnl The trailing newline in this macro's definition is deliberate, for +dnl backward compatibility and to allow trailing 'dnl'-style comments +dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. +]) + +dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST([install_sh])]) + +# Copyright (C) 2003-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- +# From Jim Meyering + +# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MAINTAINER_MODE([DEFAULT-MODE]) +# ---------------------------------- +# Control maintainer-specific portions of Makefiles. +# Default is to disable them, unless 'enable' is passed literally. +# For symmetry, 'disable' may be passed as well. Anyway, the user +# can override the default with the --enable/--disable switch. +AC_DEFUN([AM_MAINTAINER_MODE], +[m4_case(m4_default([$1], [disable]), + [enable], [m4_define([am_maintainer_other], [disable])], + [disable], [m4_define([am_maintainer_other], [enable])], + [m4_define([am_maintainer_other], [enable]) + m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) +AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode's default is 'disable' unless 'enable' is passed + AC_ARG_ENABLE([maintainer-mode], + [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], + am_maintainer_other[ make rules and dependencies not useful + (and sometimes confusing) to the casual installer])], + [USE_MAINTAINER_MODE=$enableval], + [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST([MAINT])dnl +] +) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it is modern enough. +# If it is, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + AC_MSG_WARN(['missing' script is too old or missing]) +fi +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# -------------------- +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) + +# _AM_SET_OPTIONS(OPTIONS) +# ------------------------ +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken + alias in your environment]) + fi + if test "$[2]" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT([yes]) +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) + +# Copyright (C) 2009-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SILENT_RULES([DEFAULT]) +# -------------------------- +# Enable less verbose build rules; with the default set to DEFAULT +# ("yes" being less verbose, "no" or empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_ARG_ENABLE([silent-rules], [dnl +AS_HELP_STRING( + [--enable-silent-rules], + [less verbose build output (undo: "make V=1")]) +AS_HELP_STRING( + [--disable-silent-rules], + [verbose build output (undo: "make V=0")])dnl +]) +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +dnl +dnl A few 'make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi]) +if test $am_cv_make_support_nested_variables = yes; then + dnl Using '$V' instead of '$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) + +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor 'install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in "make install-strip", and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# -------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of 'v7', 'ustar', or 'pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +# +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' + +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + + [m4_case([$1], + [ustar], + [# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) + if test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi + AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) + if test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi], + + [pax], + [], + + [m4_fatal([Unknown tar format])]) + + AC_MSG_CHECKING([how to create a $1 tar archive]) + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_$1-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) + AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + diff -Nru ricochet-0.6/ricochet-0.6/array.5c ricochet-0.7/ricochet-0.6/array.5c --- ricochet-0.6/ricochet-0.6/array.5c 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/ricochet-0.6/array.5c 2012-02-01 04:45:07.000000000 +0000 @@ -0,0 +1,68 @@ +/* + * $Id$ + * + * Copyright © 2003 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Keith Packard not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. Keith Packard makes no + * representations about the suitability of this software for any purpose. It + * is provided "as is" without express or implied warranty. + * + * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +namespace Array { + public bool contains (&poly[*] a, poly v) { + for (int i = 0; i < dim(a); i++) + if (a[i] == v) + return true; + return false; + } + + public poly append (&poly[*] a, poly v) { + if (contains(&a, v)) + return v; + a = (poly[dim(a)+1]) { [i] = i < dim(a) ? a[i] : v }; + return v; + } + + public poly push (&poly[*] a, poly v) { + a = (poly[dim(a)+1]) { [i] = i < dim(a) ? a[i] : v }; + return v; + } + + public exception empty (&poly[*] a); + + public poly pop (&poly[*] a) { + if (dim(a) == 0) + raise empty (a); + poly v = a[dim(a)-1]; + a = (poly[dim(a)-1]) { [i] = a[i] }; + return v; + } + + public void iterate (&poly[*] a, void (poly v) f) { + for (int i = 0; i < dim (a); i++) + f(a[i]); + } + + public void remove (&poly[*] a, poly v) { + if (!contains (&a, v)) + return; + bool found = false; + a = (poly[dim(a)-1]) { [i] = found ? a[i+1] : + a[i] == v ? (found=true, a[i+1]) : a[i] }; + } + +} diff -Nru ricochet-0.6/ricochet-0.6/client.5c ricochet-0.7/ricochet-0.6/client.5c --- ricochet-0.6/ricochet-0.6/client.5c 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/ricochet-0.6/client.5c 2012-02-10 17:15:06.000000000 +0000 @@ -0,0 +1,19 @@ +/* + * Copyright © 2012 Keith Packard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +namespace Client { +} diff -Nru ricochet-0.6/ricochet-0.6/client-board.5c ricochet-0.7/ricochet-0.6/client-board.5c --- ricochet-0.6/ricochet-0.6/client-board.5c 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/ricochet-0.6/client-board.5c 2012-02-11 03:53:00.000000000 +0000 @@ -0,0 +1,27 @@ +/* + * Copyright © 2012 Keith Packard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +autoload Client; +autoload RR; + +extend namespace Client { + namespace Board { + Board parse(string text) { + string[] lines = String::split(text, "\n"); + } + } +} diff -Nru ricochet-0.6/ricochet-0.6/client-draw.5c ricochet-0.7/ricochet-0.6/client-draw.5c --- ricochet-0.6/ricochet-0.6/client-draw.5c 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/ricochet-0.6/client-draw.5c 2012-06-09 23:37:36.000000000 +0000 @@ -0,0 +1,225 @@ +/* + * Copyright © 2012 Keith Packard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +autoload Cairo; +autoload Client; +autoload Client::SVG; + +extend namespace Client { + + public namespace Draw { + + import Cairo; + import Cairo::Rsvg; + import RR; + + public typedef struct { + int xoff, yoff; + real xscale, yscale; + } transform_t; + + typedef struct { + Cairo::surface_t surface; + int width, height; + rsvg_t svg; + } sprite_t; + + sprite_t sprite_from_string(string xml) = (sprite_t) { + .svg = Cairo::Rsvg::new_from_string(xml), + .width = -1, + .height = -1 + }; + + sprite_t[2] cell = { sprite_from_string(Client::SVG::cell1), + sprite_from_string(Client::SVG::cell2) }; + + sprite_t[Color] robots = { + Color.Red => sprite_from_string(Client::SVG::robot_red), + Color.Blue => sprite_from_string(Client::SVG::robot_blue), + Color.Yellow => sprite_from_string(Client::SVG::robot_yellow), + Color.Green => sprite_from_string(Client::SVG::robot_green) }; + + sprite_t robot_shadow = sprite_from_string(Client::SVG::robot_shadow); + + sprite_t[Color][Shape] targets = { + Color.Red => { + Shape.Triangle => sprite_from_string(Client::SVG::target_red_triangle), + Shape.Square => sprite_from_string(Client::SVG::target_red_square), + Shape.Octagon => sprite_from_string(Client::SVG::target_red_octagon), + Shape.Circle => sprite_from_string(Client::SVG::target_red_circle), + }, + Color.Yellow => { + Shape.Triangle => sprite_from_string(Client::SVG::target_yellow_triangle), + Shape.Square => sprite_from_string(Client::SVG::target_yellow_square), + Shape.Octagon => sprite_from_string(Client::SVG::target_yellow_octagon), + Shape.Circle => sprite_from_string(Client::SVG::target_yellow_circle), + }, + Color.Green => { + Shape.Triangle => sprite_from_string(Client::SVG::target_green_triangle), + Shape.Square => sprite_from_string(Client::SVG::target_green_square), + Shape.Octagon => sprite_from_string(Client::SVG::target_green_octagon), + Shape.Circle => sprite_from_string(Client::SVG::target_green_circle), + }, + Color.Blue => { + Shape.Triangle => sprite_from_string(Client::SVG::target_blue_triangle), + Shape.Square => sprite_from_string(Client::SVG::target_blue_square), + Shape.Octagon => sprite_from_string(Client::SVG::target_blue_octagon), + Shape.Circle => sprite_from_string(Client::SVG::target_blue_circle), + }, + Color.Whirl => { + Shape.Whirl => sprite_from_string(Client::SVG::target_whirl), + }, + }; + + sprite_t wall = sprite_from_string(Client::SVG::wall); + + void draw_sprite(&sprite_t sprite, cairo_t cr) { + render(sprite.svg, cr); + } + + dimensions_t cell_dim = get_dimensions(cell[0].svg); + dimensions_t wall_dim = get_dimensions(wall.svg); + + public int cell_width = cell_dim.width; + public int cell_height = cell_dim.height; + + public int wall_thickness = wall_dim.height; + + void draw_cached_sprite(&sprite_t sprite, cairo_t cr, &transform_t t, real alpha) { + int width = ceil(cell_width * t.xscale); + int height = ceil(cell_width * t.yscale); + + save(cr); + if (width != sprite.width || height != sprite.height) { + if (!is_uninit(&sprite.surface)) + Cairo::Surface::destroy(sprite.surface); + sprite.width = width; + sprite.height = height; + if (width > 0 && height > 0) { + sprite.surface = Cairo::Surface::create_similar(Cairo::get_target(cr), + Cairo::content_t.COLOR_ALPHA, + width, height); + cairo_t scr = Cairo::create(sprite.surface); + scale(scr, t.xscale, t.yscale); + draw_sprite(&sprite, scr); + Cairo::destroy(scr); + } + } + if (sprite.width > 0 && sprite.height > 0) { + set_source_surface(cr, sprite.surface, 0, 0); + if (alpha != 1) + paint_with_alpha(cr, alpha); + else + paint(cr); + } + restore(cr); + } + + public void background (cairo_t cr, int x, int y, RR::Object object, &transform_t t) { + save(cr); + translate(cr, x * cell_width * t.xscale + t.xoff, y * cell_height * t.yscale + t.yoff); + + draw_cached_sprite(&cell[x+y & 1], cr, &t, 1); + restore(cr); + } + + public void walls(cairo_t cr, int x, int y, RR::Object object, &transform_t t) { + save(cr); + translate(cr, t.xoff, t.yoff); + scale(cr, t.xscale, t.yscale); + translate(cr, x * cell_width, y * cell_height); + /* + rectangle(cr, 0, 0, cell_width, cell_height); + clip(cr); + */ + + void draw_wall (bool doit, bool vertical, bool shift) { + if (!doit) return; + save(cr); + if (vertical) { + rotate(cr, pi/2); + if (shift) + translate(cr, 0, -cell_height); + } else if (shift) + translate(cr, 0, cell_height); + draw_sprite(&wall, cr); + restore(cr); + } + draw_wall (object.walls.left, true, false); + draw_wall (object.walls.above, false, false); + if (x == 15) + draw_wall (object.walls.right, true, true); + if (y == 15) + draw_wall (object.walls.below, false, true); + restore(cr); + } + + public void contents (cairo_t cr, int x, int y, RR::Object object, + RR::TargetOrNone active_target, + RR::RobotOrNone active_robot, + &transform_t t) { + save(cr); + translate(cr, x * cell_width * t.xscale + t.xoff, y * cell_height * t.yscale + t.yoff); + + union switch (object.target) { + case none: + break; + case target target: + real alpha = 1; + if (object.target != active_target) + alpha = 0.25; + draw_cached_sprite(&targets[target.color][target.shape], cr, &t, alpha); + break; + } + union switch(object.robot) { + case none: + break; + case robot r: + union switch (active_robot) { + case robot a: + if (a.color == r.color) { + save(cr); + scale(cr, t.xscale, t.yscale); + translate(cr, 5, 1); + scale(cr, 1.1, 1.1); + draw_sprite(&robot_shadow, cr); + restore(cr); + } + break; + default: + } + draw_cached_sprite(&robots[r.color], cr, &t, 1); + break; + } + restore(cr); + } + + public void target (cairo_t cr, real x, real y, TargetOrNone target, &transform_t t) { + save(cr); + translate(cr, x * cell_width * t.xscale + t.xoff, y * cell_height * t.yscale + t.yoff); + scale(cr, 2 * t.xscale, 2 *t.yscale); + union switch (target) { + case target t: + draw_sprite(&targets[t.color][t.shape], cr); + break; + default: + break; + } + restore(cr); + } + } +} diff -Nru ricochet-0.6/ricochet-0.6/client-games.5c ricochet-0.7/ricochet-0.6/client-games.5c --- ricochet-0.6/ricochet-0.6/client-games.5c 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/ricochet-0.6/client-games.5c 2012-05-21 21:04:32.000000000 +0000 @@ -0,0 +1,315 @@ +/* + * Copyright © 2012 Keith Packard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +autoload Client; +autoload Client::Link; +autoload Client::Util; +autoload Nichrome; +autoload Nichrome::Box; +autoload Nichrome::Label; +autoload Nichrome::Button; +autoload Nichrome::Solid; +autoload Nichrome::Textline; +autoload Sort; + +extend namespace Client { + public namespace Games { + import Nichrome; + import Util; + + public typedef games_t; + + typedef struct { + string name; + string[*] players; + } game_t; + + public string current_game; + + protected typedef void (string game, bool watch) callback_t; + + public typedef struct { + *nichrome_t ui; + *Box::box_t box; + *Box::box_t game_box; + *Label::label_t title; + *Button::button_t close; + *Textline::textline_t game_name; + Link::link_t link; + callback_t callback; + game_t[*] games; + } games_t; + + Mutex::mutex games_mutex = Mutex::new(); + bool games_running = false; + *games_t global_games; + thread global_games_thread; + + void stop(*games_t games) { + twixt(Mutex::acquire(games_mutex); Mutex::release(games_mutex)) { + games_running = false; + Nichrome::destroy(games->ui); + make_uninit(&global_games); + } + } + + int rows(*game_t game) { + return max(1, dim(game->players)) + 1; + } + + void find_game(*games_t games, string name, void (*game_t game, int row) doit) { + int row = 2; + for (int g = 0; g < dim(games->games); g++) { + if (games->games[g].name == name) + doit(&games->games[g], row); + row += rows (&games->games[g]); + } + } + + + void add_dispose_game(*games_t games, *game_t game, int row) { + void dispose_game(&widget_t w, bool state) { + static string name = game->name; + if (state) + Link::command(games->link, + "DISPOSE %s\n", name); + } + Box::add_widget(games->game_box, 1, row, Button::new(games->ui, "Dispose Game", + dispose_game), 0); + } + + void remove_user(*games_t games, string game, string name) { + find_game(games, game, void func (*game_t game, int row) { + int p; + for (p = 0; p < dim (game->players); p++) + if (game->players[p] == name) + break; + if (p == dim(game->players)) + return; + for (int q = p; q < dim(game->players) - 1; q++) + game->players[q] = game->players[q+1]; + setdim(game->players, dim(game->players) - 1); + int r = row + p; + if (dim (game->players) == 0) { + add_dispose_game(games, game, r); + } else { + Box::delete_row(games->game_box, r); + } + Nichrome::redraw(games->ui); + }); + } + + void add_user(*games_t games, string game, string name) { + find_game(games, game, void func (*game_t game, int row) { + int p; + for (p = 0; p < dim (game->players); p++) + if (game->players[p] > name) + break; + for (int q = dim(game->players); q > p; q--) + game->players[q] = game->players[q-1]; + int r = row + p; + game->players[p] = name; + *widget_t w = Util::new_left(games->ui, name); + if (dim (game->players) > 1) { + if (p == 0) { + Box::insert_row(games->game_box, r+1); + Box::add_widget(games->game_box, 1, r+1, + new_left(games->ui, game->players[1])); + Box::add_glue(games->game_box, 0, r+1, 1); + Box::add_glue(games->game_box, 2, r+1, 1); + Box::add_glue(games->game_box, 3, r+1, 1); + } else { + Box::insert_row(games->game_box, r); + Box::add_glue(games->game_box, 0, r, 1); + Box::add_glue(games->game_box, 2, r, 1); + Box::add_glue(games->game_box, 3, r, 1); + } + } + Box::add_widget(games->game_box, 1, r, w, 0); + Nichrome::redraw(games->ui); + }); + } + + Box::item_t separator(*nichrome_t ui) { + return Box::widget_span_item(Solid::new(ui, 1, 1), 100, 1, 1, 0); + } + + int add_game(*games_t games, string name) { + Link::message_t players = Link::command(games->link, "PLAYERS %s\n", name); + if (dim(players->reply) == 0 || players->reply[0] != "PLAYERS") + return -1; + int nplayers = (dim(players->reply) - 1) // 2; + + int g; + int r = 2; + for (g = 0; g < dim(games->games); g++) { + if (name < games->games[g].name) + break; + r += rows(&games->games[g]); + } + for (int h = dim(games->games); h > g; h--) { + games->games[h] = games->games[h-1]; + } + games->games[g] = (game_t) { + .name = name, + .players = (string[...]) {} + }; + Box::insert_row(games->game_box, r); + Box::add_widget(games->game_box, 0, r, new_left(games->ui, games->games[g].name), 0); + if (!is_uninit(¤t_game) && current_game == name) { + Box::add_widget(games->game_box, 2, r, Label::new(games->ui, ""), 0); + Box::add_widget(games->game_box, 3, r, Label::new(games->ui, ""), 0); + } else { + Box::add_widget(games->game_box, 2, r, Button::new(games->ui, "Join Game", + void func (&widget_t w, bool state) { + if (state) { + games->callback(name, false); + stop(games); + } + }), 0); + Box::add_widget(games->game_box, 3, r, Button::new(games->ui, "Watch Game", + void func (&widget_t w, bool state) { + if (state) { + games->callback(name, true); + stop(games); + } + }), 0); + } + add_dispose_game(games, &games->games[g], r); + r++; + Box::insert_row(games->game_box, r); + Box::add(games->game_box, 0, r, separator(games->ui)); + for (int p = 0; p < nplayers; p++) + add_user(games, name, players->reply[1+2*p]); + return g; + } + + void remove_game(*games_t games, string name) { + int row = 2; + for (int g = 0; g < dim(games->games); g++) { + int rows = Games::rows(&games->games[g]); + if (games->games[g].name == name) { + for (int h = g; h < dim(games->games) - 1; h++) + games->games[h] = games->games[h+1]; + setdim(games->games, dim(games->games) - 1); + for (int r = 0; r < rows; r++) + Box::delete_row(games->game_box, row); + break; + } + row += rows; + } + } + + void get_games(*games_t games) { + Link::message_t r = Link::command(games->link, "GAMES\n"); + games->games = (game_t[...]) {}; + if (dim(r->reply) == 0 || r->reply[0] != "GAMES") + return; + for (int i = 1; i < dim(r->reply); i++) + add_game(games, r->reply[i]); + } + + public *games_t new(Link::link_t link, callback_t callback) { + *games_t games = &(games_t) {}; + games->link = link; + games->ui = Nichrome::new("Ricochet Robots Games", 100, 100); + games->title = new_bold(games->ui, "Games", Label::justify_t.center); + games->close = Button::new(games->ui, "Close", + void func (&widget_t w, bool state) { + if (state) + stop(games); + }); + games->game_box = Box::new(Box::dir_t.horizontal, + Box::widget_item(new_bold(games->ui, "Game Name", Label::justify_t.left), 0), + Box::widget_item(new_bold(games->ui, "Players", Label::justify_t.left), 0), + Box::glue_item(1)); + + Box::add_row(games->game_box, 0, 1, separator(games->ui)); + int r = 2; + games->game_name = Textline::new(games->ui, 40); + Box::add_widget(games->game_box, 0, r, games->game_name, 0); + Box::add_widget(games->game_box, 1, r, Label::new(games->ui, ""), 0); + Box::add_widget(games->game_box, 2, r, Button::new(games->ui, "New Game", + void func (&widget_t w, bool state) { + if (state) { + callback(games->game_name->text, true); + stop(games); + } + }), 0); + Box::add_widget(games->game_box, 3, r, Label::new(games->ui, ""), 0); + get_games(games); + + games->box = Box::new(Box::dir_t.vertical, + Box::widget_item(games->title, 0), + Box::box_item(games->game_box), + Box::box_item(Box::new(Box::dir_t.horizontal, + Box::glue_item(1), + Box::widget_item(games->close, 0))), + Box::glue_item(1)); + games->link = link; + games->callback = callback; + set_box(games->ui, games->box); + set_key_focus(games->ui, games->game_name); + return games; + } + + public void run(*games_t games) { + main_loop(games->ui); + } + + public void handle_notice(Link::message_t notice) { + twixt(Mutex::acquire(games_mutex); Mutex::release(games_mutex)) { + if (!games_running) + return; + switch (notice->reply[1]) { + case "GAME": + add_game(global_games, notice->reply[2]); + Nichrome::redraw(global_games->ui); + break; + case "DISPOSE": + remove_game(global_games, notice->reply[2]); + Nichrome::redraw(global_games->ui); + break; + case "WATCH": + case "JOIN": + add_user(global_games, notice->reply[3], notice->reply[2]); + break; + case "PART": + printf ("Remove user %s from %s\n", notice->reply[3], notice->reply[2]); + remove_user(global_games, notice->reply[3], notice->reply[2]); + break; + } + } + } + + public void start(Link::link_t link, callback_t callback) { + twixt(Mutex::acquire(games_mutex); Mutex::release(games_mutex)) { + if (!games_running) { + games_running = true; + global_games = new(link, callback); + global_games_thread = fork run (global_games); + } + } + } + + public void wait() { + if (games_running) + Thread::join (global_games_thread); + } + } +} + diff -Nru ricochet-0.6/ricochet-0.6/client-host.5c ricochet-0.7/ricochet-0.6/client-host.5c --- ricochet-0.6/ricochet-0.6/client-host.5c 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/ricochet-0.6/client-host.5c 2012-05-30 22:42:28.000000000 +0000 @@ -0,0 +1,193 @@ +/* + * Copyright © 2012 Keith Packard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +autoload Client; +autoload Client::Window; +autoload Client::Link; +autoload Client::Update; +autoload Client::Userlist; +autoload Client::Messages; +autoload Client::Games; +autoload ParseArgs; +autoload RR; +autoload Cairo; +autoload Nichrome; +autoload Nichrome::Button; +autoload Nichrome::Box; +autoload Nichrome::Label; +autoload Nichrome::Toggle; +autoload Nichrome::Textline; +autoload Nichrome::RRboard; +autoload Nichrome::Solid; +autoload Mutex; +autoload Process; + +extend namespace Client { + public namespace Host { + import Nichrome; + import Util; + import Box; + + public string host; + public string name; + public string rrserve_path = "rrserve"; + + try { + name = Environ::get("USER"); + } catch invalid_argument(string message, int id, poly value) { + name = "user"; + } + + *Nichrome::nichrome_t ui; + *Label::label_t name_title; + *Label::label_t name_label; + *Textline::textline_t name_text; + *Label::label_t host_title; + *Label::label_t master_label; + *Label::label_t master; + *Button::button_t master_connect; + *Label::label_t remote_label; + *Textline::textline_t host_text; + *Button::button_t remote_connect; + *Label::label_t local_label; + *Button::button_t local; + *Button::button_t local_connect; + *Button::button_t cancel; + + bool ret; + + void stop (bool val) { + name = name_text->text; + ret = val; + Nichrome::destroy(ui); + } + + void do_ok(*widget_t w, bool state) { + if (state) { + host = host_text->text; + stop(true); + } + } + + void do_cancel(*widget_t w, bool state) { + if (state) { + if (is_uninit(&host)) + exit(0); + stop(false); + } + } + + bool key_callback(*Textline::textline_t widget, string key) { + switch (key) { + case "Return": do_ok(widget, true); return true; + default: + } + return false; + } + + string master_host = "rr.nickle.org"; + + void do_master(*Button::button_t w, bool state) { + if (state) { + host = master_host; + stop(true); + } + } + + void do_remote(*Button::button_t w, bool state) { + if (state) { + host = host_text->text; + stop(true); + } + } + + + void do_local(*Button::button_t w, bool state) { + if (state) { + host = "localhost"; + stop(true); + } + } + + void do_start_local(*Button::button_t w, bool state) { + if (state) { + Process::system(rrserve_path, "rrserve"); + } + } + + public bool select() { + ui = new("Connect to Ricochet Robots Server", 100, 100); + + name_title = new_bold(ui, "Choose a name", Label::justify_t.center); + + name_label = new_left(ui, "User name:"); + name_text = Textline::new(ui, 40); + if (!is_uninit(&name)) + Textline::set_text(name_text, name); + + host_title = new_bold(ui, "Select a server", Label::justify_t.center); + + master_label = new_left (ui, "Master server:"); + master = new_left(ui, master_host); + master_connect = Button::new(ui, "Connect", do_master); + + remote_label = new_left (ui, "Another server:"); + host_text = Textline::new(ui, 40); + host_text->callback = key_callback; + if (!is_uninit(&host)) + Textline::set_text(host_text, host); + remote_connect = Button::new(ui, "Connect", do_remote); + + local_label = new_left (ui, "Local server:"); + local = Button::new(ui, "Start", do_start_local); + local_connect = Button::new(ui, "Connect", do_local); + + cancel = Button::new(ui, "Cancel", do_cancel); + *Box::box_t box = Box::new_empty(); + int row = 0; + Box::add_row(box, 0, row++, + Box::widget_span_item(name_title, 4, 1, 1, 0)); + Box::add_row(box, 0, row++, + Box::widget_item(name_label, 0, 1), + Box::glue_item(1), + Box::widget_item(name_text, 1, 0)); + Box::add_row(box, 0, row++, + Box::widget_span_item(host_title, 4, 1, 1, 0)); + Box::add_row(box, 0, row++, + Box::widget_item(master_label, 0, 1), + Box::glue_item(1), + Box::widget_item(master, 1, 1), + Box::widget_item(master_connect, 1, 0)); + Box::add_row(box, 0, row++, + Box::widget_item(remote_label, 0, 1), + Box::glue_item(1), + Box::widget_item(host_text, 1, 1), + Box::widget_item(remote_connect, 1, 0)); + Box::add_row(box, 0, row++, + Box::widget_item(local_label, 0, 1), + Box::glue_item(1), + Box::widget_item(local, 1, 1), + Box::widget_item(local_connect, 1, 0)); + Box::add_row(box, 0, row++, + Box::widget_item(cancel, 1, 0)); + Nichrome::set_box(ui, box); + set_key_focus(ui, host_text); + Nichrome::main_loop(ui); + return ret; + } + } +} diff -Nru ricochet-0.6/ricochet-0.6/client-link.5c ricochet-0.7/ricochet-0.6/client-link.5c --- ricochet-0.6/ricochet-0.6/client-link.5c 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/ricochet-0.6/client-link.5c 2012-05-21 21:04:32.000000000 +0000 @@ -0,0 +1,145 @@ +/* + * Copyright © 2012 Keith Packard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +autoload RR; +autoload RR::Lex; +autoload RR::Send; +autoload Client; +autoload Client::Net; +autoload Mutex; +autoload List; + +extend namespace Client { + public namespace Link { + + public typedef List::list_t + struct { + string[*] reply; + } message_struct; + + public typedef *message_struct message_t; + + public exception link_error(string); + + typedef struct { + file f; + string host; + int port; + List::list_t replies; + semaphore replies_sem; + List::list_t notices; + semaphore notices_sem; + bool closing; + Mutex::mutex command_lock; + Mutex::mutex notice_lock; + Mutex::mutex reply_lock; + thread reader; + } link_struct; + + public typedef *link_struct link_t; + + public exception link_closing(); + + void read_replies(link_t l) { + try { + for (;;) { + message_t m = &(message_struct) { .reply = RR::Lex::recv(l->f) }; + if (dim(m->reply) == 0) + continue; + twixt (Mutex::acquire(l->reply_lock); Mutex::release(l->reply_lock)) { + if (m->reply[0] == "NOTICE") { + List::append(m, &l->notices); + Semaphore::signal(l->notices_sem); + } else { + List::append(m, &l->replies); + Semaphore::signal(l->replies_sem); + } + } + } + } catch Thread::signal(int sig) { + } catch File::io_eof(file f) { + l->closing = true; + } catch File::io_error(string reason, File::error_type error, file f) { + l->closing = true; + } + while (Semaphore::count(l->notices_sem) < 0) + Semaphore::signal(l->notices_sem); + while (Semaphore::count(l->replies_sem) < 0) + Semaphore::signal(l->replies_sem); + } + + public message_t command(link_t l, string format, poly args...) { + message_t reply; + twixt (Mutex::acquire(l->command_lock); Mutex::release(l->command_lock)) { + try { + RR::Send::send(l->f, format, args...); + File::flush(l->f); + } catch File::io_error(string reason, File::error_type error, file f) { + raise link_error(sprintf("I/O error on link: %s", reason)); + } + Semaphore::wait(l->replies_sem); + twixt(Mutex::acquire(l->reply_lock); Mutex::release(l->reply_lock)) { + if (l->closing) + raise link_closing(); + reply = List::first(&l->replies); + List::remove(reply); + } + } + return reply; + } + + public message_t notice(link_t l) { + message_t notice; + twixt (Mutex::acquire(l->notice_lock); Mutex::release(l->notice_lock)) { + Semaphore::wait(l->notices_sem); + twixt(Mutex::acquire(l->reply_lock); Mutex::release(l->reply_lock)) { + if (l->closing) + raise link_closing(); + notice = List::first(&l->notices); + List::remove(notice); + } + } + return notice; + } + + public link_t new (string host, int port) { + link_t l = &(link_struct) { + .host = host, + .port = port, + .closing = false, + .command_lock = Mutex::new(), + .notice_lock = Mutex::new(), + .reply_lock = Mutex::new(), + .replies_sem = Semaphore::new(), + .notices_sem = Semaphore::new(), + }; + + List::init(&l->replies); + List::init(&l->notices); + + l->f = Net::connect (l->host, l->port); + l->reader = fork read_replies(l); + return l; + } + + public void close(link_t l) { + l->closing = true; + Thread::send_signal(l->reader, 1); + Thread::join(l->reader); + File::close(l->f); + } + } +} diff -Nru ricochet-0.6/ricochet-0.6/client-main.5c ricochet-0.7/ricochet-0.6/client-main.5c --- ricochet-0.6/ricochet-0.6/client-main.5c 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/ricochet-0.6/client-main.5c 2012-06-13 04:53:09.000000000 +0000 @@ -0,0 +1,657 @@ +/* + * Copyright © 2012 Keith Packard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +autoload Client; +autoload Client::Window; +autoload Client::Link; +autoload Client::Update; +autoload Client::Userlist; +autoload Client::Messages; +autoload Client::Games; +autoload Client::Host; +autoload ParseArgs; +autoload RR; +autoload Cairo; +autoload Nichrome; +autoload Nichrome::Button; +autoload Nichrome::Box; +autoload Nichrome::Label; +autoload Nichrome::Toggle; +autoload Nichrome::Textline; +autoload Nichrome::RRboard; +autoload Nichrome::Solid; +autoload Nichrome::Message; +autoload Mutex; + +extend namespace Client { + + public namespace Main { + import Nichrome; + import RRboard; + import Box; + import RR; + import Userlist; + + int port = RR::Port; + + string font = Widget::default_font; + + Mutex::mutex board_lock = Mutex::new(); + + Link::link_t link; + bool watch = false; + + ParseArgs::argdesc argd = { + .args = { + { .var = { .arg_string = &Host::host }, + .abbr = 'h', + .name = "host", + .expr_name = "hostname", + .desc = "server hostname"}, + { .var = { .arg_int = &port }, + .abbr = 'p', + .name = "port", + .expr_name = "port", + .desc = "server port" }, + { .var = { .arg_string = &Host::name }, + .abbr = 'n', + .name = "name", + .expr_name = "username", + .desc = "user name" }, + { .var = { .arg_string = &Games::current_game }, + .abbr = 'g', + .name = "game", + .expr_name = "gamename", + .desc = "proposed game name" }, + { .var = { .arg_string = &font }, + .abbr = 'f', + .name = "font", + .expr_name = "font name", + .desc = "default font name" }, + { .var = { .arg_flag = &watch }, + .abbr = 'w', + .name = "watch", + .desc = "watch game" }, + }, + .unknown = &(int user_argind), + }; + + &nichrome_t ui; + &Label::label_t game_name; + &Label::label_t turn; + &Label::label_t state; + + /* New/Bid mode items */ + &Box::box_t bid_box; + &Button::button_t bid; + &Textline::textline_t bid_value; + &Button::button_t revoke; + &Button::button_t abandon; + &Button::button_t nobid; + + /* Show mode items */ + &Box::box_t show_box; + &Label::label_t moves; + &Button::button_t undo; + &Button::button_t reset; + &Button::button_t pass; + + /* Done mode items */ + &Box::box_t done_box; + &Button::button_t next_turn; + + &Button::button_t select_game; + &Button::button_t quit; + &rrboard_widget_t rrboard; + &userlist_t userlist; + RR::GameState current_state; + &Messages::messages_t messages; + &Nichrome::widget_t desired_focus; + + void update_board(string board) { + twixt (Mutex::acquire(board_lock); Mutex::release(board_lock)) + Update::update(&(rrboard.board), board); + } + + void update_robot(Color color, int x, int y) { + twixt (Mutex::acquire(board_lock); Mutex::release(board_lock)) + Update::update_robot(&(rrboard.board), color, x, y); + } + + void update_target(Color color, Shape shape) { + twixt (Mutex::acquire(board_lock); Mutex::release(board_lock)) + Update::update_target(&(rrboard.board), color, shape); + } + + int current_moves = 0; + + void update_moves(int new_moves) { + current_moves = new_moves; + Label::relabel(&moves, sprintf("Moves: %d", new_moves)); + } + + int current_turn = 0; + + void update_game(string new_game) { + Games::current_game = new_game; + Label::relabel(&game_name, sprintf("Game: %s", Games::current_game)); + } + + void update_turn(int new_turn) { + current_turn = new_turn; + Label::relabel(&turn, sprintf("Turn: %d", new_turn)); + } + + void clear_bid() { + Textline::set_text(&bid_value, ""); + } + + bool messages_active() { + if (is_uninit(&(&ui.key_focus))) + return false; + return &ui.key_focus == messages.input; + } + + void set_focus(&Nichrome::widget_t focus, bool force) { + &desired_focus = &focus; + if (!messages_active() || force) + Nichrome::set_key_focus(&ui, &focus); + } + + void update_state(string new_state) { + Label::relabel(&state, sprintf("State: %s", new_state)); + Nichrome::suspend_draw(&ui); + current_state = RR::game_state(new_state); + Box::set_active(&bid_box, false); + Box::set_active(&done_box, false); + Box::set_active(&show_box, false); + union switch (current_state){ + case NEW: + RRboard::hide_timer(&rrboard); + clear_bid(); + Userlist::clear_bid(&userlist); + Userlist::clear_modes(&userlist); + /* fall through ... */ + case BID: + set_focus(&bid_value, false); + Box::set_active(&bid_box, true); + Userlist::clear_showing(&userlist); + break; + case SHOW: + RRboard::stop_timer(&rrboard); + set_focus(&rrboard, false); + update_moves(0); + Box::set_active(&show_box, true); + break; + case DONE: + RRboard::hide_timer(&rrboard); + set_focus(&rrboard, false); + Box::set_active(&done_box, true); + Userlist::clear_showing(&userlist); + Userlist::clear_modes(&userlist); + break; + } + Nichrome::release_draw(&ui); + } + + void add_user(string name) { + Link::message_t u = Link::command(link, "USERINFO %s\n", name); + if (u->reply[0] == "ERROR") + return; + Userlist::add(&userlist, name, + RR::boolean(u->reply[2]), + string_to_integer(u->reply[3]), + string_to_integer(u->reply[4]), + string_to_integer(u->reply[5])); + } + + void handle_notice(thread main) { + for (;;) { + try { + Link::message_t notice = Link::notice(link); + } catch Link::link_closing() { + break; + } + switch (notice->reply[1]) { + + /* Global game notices */ + case "BOARD": + update_board(notice->reply[2]); + break; + case "GAMESTATE": + update_state (notice->reply[2]); + break; + case "TURN": + update_target(RR::color(notice->reply[2]), + RR::shape(notice->reply[3])); + update_turn(current_turn + 1); + break; + case "GAMEOVER": + /* start new game */ + clear_score(&userlist); + Userlist::update(&userlist); + update_turn(0); + break; + case "JOIN": + case "WATCH": + if (dim(notice->reply) > 3) + if (!is_uninit(&Games::current_game) && notice->reply[3] != Games::current_game) + break; + add_user(notice->reply[2]); + break; + case "PART": + if (dim(notice->reply) > 3) + if (!is_uninit(&Games::current_game) && notice->reply[3] != Games::current_game) + break; + Userlist::remove(&userlist, notice->reply[2]); + break; + case "MESSAGE": + Messages::add(&messages, notice->reply[2], + notice->reply[3]); + break; + + /* Bid notices */ + case "BID": + Userlist::bid(&userlist, notice->reply[2], + string_to_integer(notice->reply[3])); + break; + case "REVOKE": + Userlist::bid(&userlist, notice->reply[2], 0); + break; + case "TIMER": + RRboard::set_timer(&rrboard, + string_to_integer(notice->reply[2])); + break; + case "ABANDON": + Userlist::set_mode(&userlist, notice->reply[2], "abandon"); + break; + case "NOBID": + Userlist::set_mode(&userlist, notice->reply[2], "done"); + break; + + + /* Solving notices */ + case "ACTIVE": + Userlist::showing(&userlist, notice->reply[2], true); + break; + case "MOVE": + update_moves(string_to_integer(notice->reply[2])); + break; + case "UNDO": + update_moves(max(current_moves - 1, 0)); + break; + case "RESET": + update_moves(0); + break; + case "POSITION": + update_robot(RR::color(notice->reply[2]), + string_to_integer(notice->reply[3]), + string_to_integer(notice->reply[4])); + break; + case "SCORE": + Userlist::score(&userlist, notice->reply[2], + string_to_integer(notice->reply[3])); + break; + } + Nichrome::redraw(&ui); + Games::handle_notice(notice); + } + Thread::send_signal(main, 0); + } + + void move_callback(RR::Color color, RR::Direction dir) { + Link::command(link, "MOVE %C %D\n", color, dir); + } + + void do_undo() { + Link::command(link, "UNDO\n"); + } + + void do_bid() { + Link::command(link, "BID %s\n", bid_value.text); + Textline::set_text(&bid_value, ""); + } + + void do_revoke() { + Link::command(link, "REVOKE\n"); + } + + void do_abandon() { + Link::command(link, "ABANDON\n"); + } + + void do_no_bid() { + Link::command(link, "NOBID\n"); + } + + void do_pass() { + Link::command(link, "PASS\n"); + } + + void go_message() { + Messages::set_focus(&messages); + } + + void done_message() { + set_focus(&desired_focus, true); + } + + void do_turn () { + Link::command(link, "TURN\n"); + } + + void do_pass () { + Link::command(link, "PASS\n"); + } + + void do_reset() { + Link::command(link, "RESET\n"); + } + + void message_done(*Messages::messages_t m, string message) { + Link::command(link, "MESSAGE %s\n", message); + done_message(); + } + + bool global_key(&key_event_t key) { + if (key.type != key_type_t.press) + return false; + + if (messages_active()) + return false; + + switch (key.key) { + case "m": case "slash": go_message(); return true; + } + enum switch (current_state) { + case NEW: + case BID: + switch (key.key) { + case "b": case "Return": do_bid(); return true; + case "r": do_revoke(); return true; + case "a": do_abandon(); return true; + case "d": do_no_bid(); return true; + } + break; + case SHOW: + switch (key.key) { + case "p": case "P": + do_pass(); + return true; + case "BackSpace": case "u": case "U": + do_undo(); + return true; + } + break; + case DONE: + switch (key.key) { + case "Return": case "t": case "T": + do_turn(); return true; + } + break; + } + return false; + } + + public void do_quit() { + Link::close(link); + ui.running = false; + RRboard::stop_timer(&rrboard); + exit(0); + } + + public void do_join(string game, bool watch) { + Userlist::clear(&userlist); + + Games::current_game = game; + + Link::message_t r = Link::command(link, "%s %s\n", watch ? "WATCH" : "JOIN", game); + + if (r->reply[0] == "ERROR") { + if (r->reply[1] == "NOGAME") { + Link::message_t r = Link::command(link, "NEW %s\n", game); + if (r->reply[0] == "ERROR") { + printf ("Cannot create game %s: %s\n", game, r->reply[1]); + do_quit(); + } + } else { + printf ("Cannot join game %s: %s\n", game, r->reply[1]); + } + } + + update_game(game); + + Link::message_t r = Link::command(link, "PLAYERS %s\n", game); + + if (r->reply[0] == "ERROR") { + printf ("Cannot enumerate players: %s\n", r->reply[1]); + do_quit(); + } + + for (int i = 1; i < dim(r->reply); i += 2) + add_user(r->reply[i]); + + Link::message_t r = Link::command(link, "GAMEINFO %s\n", game); + + if (r->reply[0] == "ERROR") { + printf ("Cannot get game info for %s: %s\n", game, r->reply[1]); + do_quit(); + } + update_turn(string_to_integer(r->reply[1])); + + update_state(r->reply[4]); + + if (current_state == RR::GameState.SHOW) + Userlist::showing(&userlist, r->reply[7], true); + + Link::message_t r = Link::command(link, "SHOW\n"); + + if (r->reply[0] == "ERROR") { + printf ("Cannot show board: %s\n", r->reply[1]); + do_quit(); + } + + update_board(r->reply[1]); + } + + public void select_game_callback(string game, bool watch) { + do_join (game, watch); + Nichrome::redraw(&ui); + } + + public void do_select_game() { + Games::start(link, select_game_callback); + } + + public void do_select_host() { + if (!Host::select()) + exit(0); + } + + public void main () { + ParseArgs::parseargs(&argd, &argv); + + if (!is_uninit(&font)) + Widget::default_font = font; + + &ui = Nichrome::new("Ricochet Robots", board_width, board_height); + Nichrome::hide(&ui); + Nichrome::set_global_key(&ui, global_key); + &rrboard = RRboard::new(&ui, move_callback); + &userlist = Userlist::new(&ui); + &messages = Messages::new(&ui, 20, message_done, Host::name); + + &select_game = Button::new(&ui, "Switch Game", + void func (&widget_t w, bool state) { + if (state) + do_select_game(); + }); + + &quit = Button::new(&ui, "Quit", + void func (&widget_t w, bool state) { + do_quit(); + }); + + &game_name = Label::new(&ui, "game"); + + &turn = Label::new(&ui, "turn"); + + &state = Label::new(&ui, "state"); + + /* Bid mode items */ + &bid = Button::new(&ui, "Bid", + void func (&widget_t w, bool state) { + if (state) + do_bid(); + }); + + &bid_value = Textline::new(&ui, 6); + clear_bid(); + + &revoke = Button::new(&ui, "Revoke", + void func (&widget_t w, bool state) { + if (state) + do_revoke(); + }); + + &abandon = Button::new(&ui, "Abandon", + void func (&widget_t w, bool state) { + if (state) + do_abandon(); + }); + + &nobid = Button::new(&ui, "Done Bidding", + void func (&widget_t w, bool state) { + if (state) + do_no_bid(); + }); + + &bid_box = Box::new(Box::dir_t.horizontal, + Box::widget_item(&bid, 0), + Box::widget_item(&bid_value, 0), + Box::widget_item(&revoke, 0), + Box::widget_item(&abandon, 0), + Box::widget_item(&nobid, 0)); + + /* Show mode items */ + &moves = Label::new(&ui, "moves"); + + &undo = Button::new(&ui, "Undo Move", + void func (&widget_t w, bool state) { + if (state) + do_undo(); + }); + + &reset = Button::new(&ui, "Reset Robots", + void func (&widget_t w, bool state) { + if (state) + do_reset(); + }); + &pass = Button::new(&ui, "Pass", + void func (&widget_t w, bool state) { + if (state) + do_pass(); + }); + &show_box = Box::new(Box::dir_t.horizontal, + Box::widget_item(&moves, 0), + Box::widget_item(&undo, 0), + Box::widget_item(&reset, 0), + Box::widget_item(&pass, 0)); + + &next_turn = Button::new(&ui, "Turn", + void func (&widget_t w, bool state) { + if (state) + do_turn(); + }); + + &done_box = Box::new(Box::dir_t.horizontal, + Box::widget_item(&next_turn, 0)); + + &box_t top = Box::new (Box::dir_t.horizontal, + Box::widget_item(&game_name, 0), + Box::widget_item(&turn, 0), + Box::widget_item(&state, 0), + Box::box_item(&show_box), + Box::box_item(&bid_box), + Box::box_item(&done_box), + Box::glue_item(1), + Box::widget_item(&select_game, 0), + Box::widget_item(&quit, 0)); + &box_t rbox = Box::new (Box::dir_t.vertical, + Box::box_item(userlist.box), + Box::widget_item(Solid::new(&ui, 1, 1), + 1, 0), + Box::box_item(messages.vbox)); + &box_t hbox = Box::new (Box::dir_t.horizontal, + Box::widget_item(&rrboard, 1, 1, 1), + Box::box_item(&rbox)); + + &box_t vbox = Box::new (Box::dir_t.vertical, + Box::box_item(&top), + Box::box_item(&hbox)); + + set_box(&ui, &vbox); + + for (;;) { + if (is_uninit(&Host::host)) + do_select_host(); + + try { + for (;;) { + try { + link = Link::new(Host::host, port); + + Link::message_t r = Link::command(link, "helo %s\n", Host::name); + + if (r->reply[0] == "ERROR") + raise Link::link_error(sprintf("%s %s", r->reply[1], Host::name)); + break; + } catch Link::link_error(string reason) { + Nichrome::Message::new("Connection failed", + sprintf ("host \"%s\": %s", Host::host, reason)); + } + do_select_host(); + } + + thread me = Thread::current(); + fork handle_notice(me); + + Userlist::set_link(&userlist, link); + + if (is_uninit(&Games::current_game)) { + do_select_game(); + Games::wait(); + } + + if (is_uninit(&Games::current_game)) + do_quit(); + + Nichrome::show(&ui); + + main_loop(&ui); + } catch Thread::signal(int sig) { + if (sig != 0) + raise Thread::signal(sig); + make_uninit(&Host::host); + Userlist::clear_link(&userlist); + Nichrome::hide(&ui); + } + } + } + } +} + diff -Nru ricochet-0.6/ricochet-0.6/client-messages.5c ricochet-0.7/ricochet-0.6/client-messages.5c --- ricochet-0.6/ricochet-0.6/client-messages.5c 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/ricochet-0.6/client-messages.5c 2012-05-21 21:04:32.000000000 +0000 @@ -0,0 +1,92 @@ +/* + * Copyright © 2012 Keith Packard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +autoload Client; +autoload Nichrome; +autoload Nichrome::Box; +autoload Nichrome::Text; +autoload Nichrome::Textline; +autoload Nichrome::Label; +autoload Nichrome::Scrollbar; +autoload Nichrome::Solid; + +extend namespace Client { + public namespace Messages { + import Nichrome; + + public typedef messages_t; + + protected typedef void (*messages_t m, string text) callback_t; + + public typedef struct { + *nichrome_t ui; + *Box::box_t hbox; + *Box::box_t vbox; + *Text::text_t output; + *Scrollbar::scrollbar_t scrollbar; + *Label::label_t name; + *Textline::textline_t input; + callback_t done_callback; + } messages_t; + + protected void add (&messages_t m, string user, string message) { + Text::insert(m.output, String::length(m.output->text), + sprintf ("<%s> %s\n", user, message)); + while (Text::scroll_down(m.output)) + ; + } + + void send(&messages_t m) { + string s = m.input->text; + Textline::set_text(m.input, ""); + m.done_callback(&m, s); + } + + protected void set_focus(*messages_t m) { + Nichrome::set_key_focus(m->ui, m->input); + } + + protected *messages_t new(&nichrome_t ui, int lines, callback_t done_callback, string name) { + *messages_t m = &(messages_t) { + .ui = &ui, + .output = Text::new(&ui), + .name = Label::new(&ui, sprintf("%s: ", name)), + .input = Textline::new(&ui, 40), + .done_callback = done_callback + }; + bool key_callback(&Textline::textline_t widget, string key) { + switch (key) { + case "Return": send(m); break; + default: return false; + } + return true; + } + m->input->callback = key_callback; + m->scrollbar = Text::scrollbar(m->output); + m->hbox = Box::new(Box::dir_t.horizontal, + Box::widget_item(m->output, 1, 1), + Box::widget_item(m->scrollbar, 0, 1)); + m->vbox = Box::new(Box::dir_t.vertical, + Box::box_item(m->hbox), + Box::widget_item(Solid::new(&ui, 1, 1), 1, 0), + Box::box_item(Box::new(Box::dir_t.horizontal, + Box::widget_item(m->name, 0), + Box::widget_item(m->input, 1, 0)))); + return m; + } + } +} diff -Nru ricochet-0.6/ricochet-0.6/client-net.5c ricochet-0.7/ricochet-0.6/client-net.5c --- ricochet-0.6/ricochet-0.6/client-net.5c 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/ricochet-0.6/client-net.5c 2012-02-12 05:46:39.000000000 +0000 @@ -0,0 +1,29 @@ +/* + * Copyright © 2012 Keith Packard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +autoload Client; +autoload RR; + +extend namespace Client { + namespace Net { + public file connect (string host, int port) { + file f = Sockets::create(Sockets::SOCK_STREAM); + Sockets::connect(f, host, port); + return f; + } + } +} diff -Nru ricochet-0.6/ricochet-0.6/client-update.5c ricochet-0.7/ricochet-0.6/client-update.5c --- ricochet-0.6/ricochet-0.6/client-update.5c 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/ricochet-0.6/client-update.5c 2012-02-21 20:44:15.000000000 +0000 @@ -0,0 +1,136 @@ +/* + * Copyright © 2012 Keith Packard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +autoload Client; +autoload RR; +autoload Nichrome::RRboard; + +extend namespace Client { + public namespace Update { + + import Nichrome::RRboard; + import RR; + + public void update(&RR::Board board, string image) { + + string[*] lines = String::split(image, "\n"); + + int width = (String::length(lines[1]) - 1) / 4; + int height = (dim(lines) - 2) / 2; + + void update_hwall(int x, int y, bool above) { + if (y > 0) + board[x,y-1].walls.below = above; + if (y < height) + board[x,y].walls.above = above; + } + + void update_vwall(int x, int y, int c) { + bool left; + + switch (c) { + case '|': + left = true; + break; + case ' ': + left = false; + break; + } + if (x > 0) + board[x-1,y].walls.right = left; + if (x < width) + board[x,y].walls.left = left; + } + + void update_hwalls(int y, string line) { + for (int x = 0; x < width; x++) + update_hwall(x, y, line[x*4 + 2] == '='); + } + + void update_squares(int y, string line) { + int x; + for (x = 0; x < width; x++) { + update_vwall(x, y, line[x*4]); + string robot = String::substr(line,x*4+1,1); + if (robot == ".") + board[x,y].robot = RobotOrNone.none; + else { + Color c = color(robot); + Robot r = { .color = color(robot), + .active = Ctype::isupper(robot[0]) }; + board[x,y].robot = (RobotOrNone.robot) r; + } + string target = String::substr(line,x*4+2,2); + if (target[0] == '.') { + board[x,y].target = TargetOrNone.none; + } else { + Color c = color(String::substr(target,0,1)); + Shape s = shape(String::substr(target,1,1)); + Target t = { .color = c, + .shape = s, + .active = Ctype::isupper(target[0]) }; + board[x,y].target = (TargetOrNone.target) t; + } + } + update_vwall(x, y, line[x*4]); + } + + int x, y; + for (y = 0; y < height; y++) { + update_hwalls(y, lines[y*2 + 1]); + update_squares(y, lines[y*2 + 2]); + } + update_hwalls(y, lines[y*2 + 1]); + } + + public void update_robot(&RR::Board board, Color color, int new_x, int new_y) { + bool active = false; + for (int y = 0; y < RR::Height; y++) { + for (int x = 0; x < RR::Width; x++) { + union switch (board[x,y].robot) { + case robot r: + if (r.color == color) { + active = r.active; + board[x,y].robot = RobotOrNone.none; + } + break; + default: + break; + } + } + } + board[new_x, new_y].robot = (RobotOrNone.robot) (Robot) { .color = color, .active = active }; + } + + public void update_target(&RR::Board board, Color color, Shape shape) { + for (int y = 0; y < RR::Height; y++) { + for (int x = 0; x < RR::Width; x++) { + union switch (board[x,y].target) { + case target t: + if (t.color == color && t.shape == shape) + board[x,y].target.target.active = true; + else + board[x,y].target.target.active = false; + break; + default: + break; + } + } + } + } + } +} diff -Nru ricochet-0.6/ricochet-0.6/client-userlist.5c ricochet-0.7/ricochet-0.6/client-userlist.5c --- ricochet-0.6/ricochet-0.6/client-userlist.5c 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/ricochet-0.6/client-userlist.5c 2012-06-13 04:45:32.000000000 +0000 @@ -0,0 +1,345 @@ +/* + * Copyright © 2012 Keith Packard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +autoload Client; +autoload Client::Link; +autoload Nichrome; +autoload Nichrome::Box; +autoload Nichrome::Label; +autoload Nichrome::Solid; +autoload Mutex; + +extend namespace Client { + public namespace Userlist { + + import Nichrome; + + typedef struct { + string name; + *Label::label_t name_label; + bool playing; + int games; + *Label::label_t games_label; + int score; + *Label::label_t score_label; + int bid; + *Label::label_t bid_label; + string mode; + *Label::label_t mode_label; + } user_t; + + typedef union { + *user_t user; + void none; + } user_or_none_t; + + typedef struct { + *Label::label_t label; + int width; + } column_t; + + public typedef struct { + *nichrome_t ui; + *Box::box_t box; + column_t name; + column_t games; + column_t score; + column_t bid; + column_t mode; + (*user_t)[...] names; + user_or_none_t showing; + string font; + string bold_font; + string italic_font; + Link::link_t link; + Mutex::mutex lock; + } userlist_t; + + bool user_greater(*user_t a, *user_t b) = a->name > b->name; + + string games_string(int games) { + return sprintf("%d", games); + } + + string score_string(bool playing, int score) { + if (playing) + return sprintf("%d", score); + return ""; + } + + string bid_string(bool playing, int bid) { + if (playing) + return sprintf("%d", bid); + return ""; + } + + void forname(*userlist_t ul, string name, void (*user_t, int u) doit) { + twixt(Mutex::acquire(ul->lock); Mutex::release(ul->lock)) { + for (int u = 0; u < dim(ul->names); u++) + if (ul->names[u]->name == name) { + doit (ul->names[u], u); + break; + } + } + } + + void foreach(*userlist_t ul, void (*user_t, int u) doit) { + twixt(Mutex::acquire(ul->lock); Mutex::release(ul->lock)) { + for (int u = 0; u < dim(ul->names); u++) + doit (ul->names[u], u); + } + } + + public void score(*userlist_t ul, string name, int score) { + forname(ul, name, void func (*user_t user, int u) { + user->score = score; + Label::relabel(user->score_label, score_string(user->playing, user->score)); + }); + } + + void update_user(*userlist_t ul, *user_t user) { + Link::message_t r = Link::command(ul->link, "USERINFO %s\n", user->name); + if (r->reply[0] == "ERROR") + return; + user->playing = RR::boolean(r->reply[2]); + user->games = string_to_integer(r->reply[3]); + Label::relabel(user->games_label, games_string(user->games)); + user->score = string_to_integer(r->reply[4]); + Label::relabel(user->score_label, score_string(user->playing, user->score)); + user->bid = string_to_integer(r->reply[5]); + Label::relabel(user->bid_label, bid_string(user->playing, user->bid)); + } + + public void bid(*userlist_t ul, string name, int bid) { + forname(ul, name, void func (*user_t user, int u) { + user->bid = bid; + Label::relabel(user->bid_label, bid_string(user->playing, user->bid)); + }); + } + + public void clear_bid(*userlist_t ul) { + foreach(ul, void func (*user_t user, int u) { + user->bid = 0; + Label::relabel(user->bid_label, bid_string(user->playing, user->bid)); + }); + } + + public void clear_score(*userlist_t ul) { + foreach(ul, void func (*user_t user, int u) { + user->score = 0; + Label::relabel(user->score_label, score_string(user->playing, user->score)); + }); + } + + void set_font(*user_t user, string font) { + user->name_label->font = font; + user->games_label->font = font; + user->score_label->font = font; + user->bid_label->font = font; + user->mode_label->font = font; + } + + void set_showing (*userlist_t ul, *user_t user, bool showing) { + if (showing) { + if (ul->showing != (user_or_none_t.user) user) { + union switch (ul->showing) { + case user old: + set_font(old, ul->font); + break; + default: + } + ul->showing = (user_or_none_t.user) user; + set_font(user, ul->bold_font); + } + } else { + if (ul->showing == (user_or_none_t.user) user) { + ul->showing = user_or_none_t.none; + set_font(user, ul->font); + } + } + } + + public void showing(*userlist_t ul, string name, bool showing) { + forname(ul, name, void func (*user_t user, int u) { + set_showing (ul, user, showing); + }); + } + + public void clear_showing(*userlist_t ul) { + twixt(Mutex::acquire(ul->lock); Mutex::release(ul->lock)) { + union switch (ul->showing) { + case user u: + set_showing (ul, u, false); + break; + default: + } + } + } + + public void clear_modes(*userlist_t ul) { + foreach (ul, void func (*user_t user, int u) { + Label::relabel(user->mode_label, ""); + }); + } + + public void set_mode(*userlist_t ul, string name, string mode) { + forname (ul, name, void func (*user_t user, int u) { + user->mode = mode; + Label::relabel(user->mode_label, user->mode); + }); + } + + public void update(*userlist_t ul) { + foreach (ul, void func (*user_t user, int u) { + update_user(ul, user); + }); + } + + bool user_gt(*user_t a, *user_t b) { + if (!a->playing && b->playing) + return true; + if (a->playing && !b->playing) + return false; + return a->name > b->name; + } + + public void add(*userlist_t ul, string name, bool playing, int games, int score, int bid) { + twixt(Mutex::acquire(ul->lock); Mutex::release(ul->lock)) { + for (int u = 0; u < dim (ul->names); u++) + if (ul->names[u]->name == name) + return; + + *user_t user = &(user_t) { + .name = name, + .name_label = Label::new(ul->ui, name), + .playing = playing, + .games = games, + .games_label = Label::new(ul->ui, games_string(games)), + .score = score, + .score_label = Label::new(ul->ui, score_string(playing, score)), + .bid = bid, + .bid_label = Label::new(ul->ui, bid_string(playing, bid)), + .mode = "", + .mode_label = Label::new(ul->ui, ""), + }; + + string font = ul->font; + if (!playing) + font = ul->italic_font; + user->name_label->font = font; + user->name_label->justify = Label::justify_t.left; + user->games_label->font = font; + user->score_label->font = font; + user->bid_label->font = font; + user->mode_label->font = font; + + int u = 0; + for (; u < dim (ul->names); u++) + if (user_gt (ul->names[u], user)) + break; + + Box::suspend(ul->box); + Box::insert_row(ul->box, u+2); + Box::add_row(ul->box, 0, u+2, + Box::widget_item(user->name_label, 0, 0), + Box::widget_item(user->games_label, 0, 0), + Box::widget_item(user->score_label, 0, 0), + Box::widget_item(user->bid_label, 0, 0), + Box::widget_item(user->mode_label, 0, 0)); + Box::release(ul->box); + + for (int t = dim(ul->names); t > u; t--) + ul->names[t] = ul->names[t-1]; + + ul->names[u] = user; + } + } + + public void remove(*userlist_t ul, string name) { + forname(ul, name, void func (*user_t user, int u) { + Box::delete_row(ul->box, u + 2); + for (; u < dim(ul->names) - 1; u++) + ul->names[u] = ul->names[u+1]; + setdim(ul->names, dim(ul->names) - 1); + }); + } + + public void clear(*userlist_t ul) { + twixt(Mutex::acquire(ul->lock); Mutex::release(ul->lock)) { + Box::clear(ul->box, 0, 2, 0, dim(ul->names)); + setdim(ul->names, 0); + } + } + + protected void set_link(*userlist_t ul, Link::link_t link) { + ul->link = link; + } + + protected void clear_link(*userlist_t ul) { + make_uninit(&ul->link); + } + + protected void init (*userlist_t ul, + *nichrome_t ui) { + ul->ui = ui; + ul->font = Widget::default_font; + ul->bold_font = sprintf("%s:bold", Widget::default_font); + ul->italic_font = sprintf("%s:italic", Widget::default_font); + + ul->names = ((*user_t)[...]) {}; + ul->lock = Mutex::new(); + Cairo::cairo_t cr = Nichrome::cairo(ui); + Cairo::set_font(cr, ul->font); + Cairo::text_extents_t x = Cairo::text_extents(cr, "x"); + real x_width = x.x_advance; + void init_column(*column_t column, string label, int width) { + column->label = Label::new(ui, label); + column->label->font = ul->bold_font; + column->width = ceil(width * x_width); + } + init_column(&ul->name, "Player", 32); + ul->name.label->justify = Label::justify_t.left; + init_column(&ul->games, "Games", 3); + init_column(&ul->score, "Score", 2); + init_column(&ul->bid, "Bid", 3); + init_column(&ul->mode, "State", 12); + ul->box = Box::new(Box::dir_t.horizontal, + Box::widget_item(ul->name.label, 0), + Box::widget_item(ul->games.label, 0), + Box::widget_item(ul->score.label, 0), + Box::widget_item(ul->bid.label, 0), + Box::widget_item(ul->mode.label, 0)); + Box::add_row(ul->box, 0, 1, + Box::widget_span_item(Solid::new(ui, 1, 1), + 100, 1, 1, 0)); + Box::add_row(ul->box, 0, 2, + Box::glue_item(ul->name.width, 0, 0, 0), + Box::glue_item(ul->games.width, 0, 0, 0), + Box::glue_item(ul->score.width, 0, 0, 0), + Box::glue_item(ul->bid.width, 0, 0, 0), + Box::glue_item(ul->mode.width, 0, 0, 0)); + + ul->showing = user_or_none_t.none; + } + + public *userlist_t new (*nichrome_t ui) { + *userlist_t ul = &(userlist_t) {}; + init(ul, ui); + return ul; + } + } +} diff -Nru ricochet-0.6/ricochet-0.6/client-util.5c ricochet-0.7/ricochet-0.6/client-util.5c --- ricochet-0.6/ricochet-0.6/client-util.5c 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/ricochet-0.6/client-util.5c 2012-05-21 21:04:32.000000000 +0000 @@ -0,0 +1,35 @@ +/* + * Copyright © 2012 Keith Packard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +extend namespace Client { + public namespace Util { + import Nichrome; + + public *Label::label_t new_left(*nichrome_t ui, string label) { + *Label::label_t l = Label::new(ui, label); + l->justify = Label::justify_t.left; + return l; + } + + public *Label::label_t new_bold(*nichrome_t ui, string label, Label::justify_t justify) { + *Label::label_t l = Label::new(ui, label); + l->font = l->font + ":bold"; + l->justify = justify; + return l; + } + } +} diff -Nru ricochet-0.6/ricochet-0.6/client-window.5c ricochet-0.7/ricochet-0.6/client-window.5c --- ricochet-0.6/ricochet-0.6/client-window.5c 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/ricochet-0.6/client-window.5c 2012-02-10 22:00:49.000000000 +0000 @@ -0,0 +1,37 @@ +/* + * Copyright © 2012 Keith Packard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +autoload Cairo; +autoload Nichrome; +autoload Nichrome::Button; +autoload Nichrome::Box; +autoload Nichrome::Label; +autoload Nichrome::Toggle; +autoload Nichrome::RRboard; + +autoload RR; +autoload Client; +autoload Client::SVG; + +extend namespace Client { + public namespace Window { + import Nichrome; + + void play() { + } + } +} diff -Nru ricochet-0.6/ricochet-0.6/configure ricochet-0.7/ricochet-0.6/configure --- ricochet-0.6/ricochet-0.6/configure 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/ricochet-0.6/configure 2017-03-23 14:30:22.000000000 +0000 @@ -0,0 +1,3602 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.69 for server-main.5c 0.6. +# +# Report bugs to . +# +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org and +$0: http://rr.nickle.org about your system, including any +$0: error possibly output before this message. Then install +$0: a modern shell, or manually run the script under such a +$0: shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='server-main.5c' +PACKAGE_TARNAME='ricochet' +PACKAGE_VERSION='0.6' +PACKAGE_STRING='server-main.5c 0.6' +PACKAGE_BUGREPORT='http://rr.nickle.org' +PACKAGE_URL='' + +ac_unique_file="server-main.5c" +ac_subst_vars='LTLIBOBJS +LIBOBJS +BUILD_DATE +MAN_SECTION +GAMEMAN_FALSE +GAMEMAN_TRUE +ricochetlibdir +MAINT +MAINTAINER_MODE_FALSE +MAINTAINER_MODE_TRUE +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +runstatedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_silent_rules +enable_maintainer_mode +enable_gameman +' + ac_precious_vars='build_alias +host_alias +target_alias' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir runstatedir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures server-main.5c 0.6 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/ricochet] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of server-main.5c 0.6:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + --enable-maintainer-mode + enable make rules and dependencies not useful (and + sometimes confusing) to the casual installer + --enable-gameman Install manual pages in section 6 rather than section 1 + +Report bugs to . +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +server-main.5c configure 0.6 +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by server-main.5c $as_me 0.6, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + +ac_aux_dir= +for ac_dir in . "$srcdir"/.; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in . \"$srcdir\"/." "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + + +am__api_version='1.15' + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken + alias in your environment" "$LINENO" 5 + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi + +rm -f conftest.file + +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if ${ac_cv_path_mkdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=1;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='ricochet' + VERSION='0.6' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +mkdir_p='$(MKDIR_P)' + +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar pax cpio none' + +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' + + + + + + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 +$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } + # Check whether --enable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then : + enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 +$as_echo "$USE_MAINTAINER_MODE" >&6; } + if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + + MAINT=$MAINTAINER_MODE_TRUE + + + + + +ricochetlibdir='${datadir}'/ricochet + + + +# Check whether --enable-gameman was given. +if test "${enable_gameman+set}" = set; then : + enableval=$enable_gameman; case "${enableval}" in + yes) gameman=true ;; + no) gameman=false ;; + *) as_fn_error $? "bad value ${enableval} for --enable-gameman" "$LINENO" 5 ;; +esac +else + gameman=false +fi + + + if test x$gameman = xtrue; then + GAMEMAN_TRUE= + GAMEMAN_FALSE='#' +else + GAMEMAN_TRUE='#' + GAMEMAN_FALSE= +fi + + +if test x$gameman = xtrue; then + MAN_SECTION=6 +else + MAN_SECTION=1 +fi + + + +if test x$BUILD_DATE = x; then + BUILD_DATE=`date +%F` +fi + + + +ac_config_files="$ac_config_files Makefile ricochet.man rrserve.man ricochet.spec" + + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +# +# If the first sed substitution is executed (which looks for macros that +# take arguments), then branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +ac_script=' +:mline +/\\$/{ + N + s,\\\n,, + b mline +} +t clear +:clear +s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g +t quote +s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g +t quote +b any +:quote +s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g +s/\[/\\&/g +s/\]/\\&/g +s/\$/$$/g +H +:any +${ + g + s/^\n// + s/\n/ /g + p +} +' +DEFS=`sed -n "$ac_script" confdefs.h` + + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +$as_echo_n "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 +$as_echo "done" >&6; } + +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GAMEMAN_TRUE}" && test -z "${GAMEMAN_FALSE}"; then + as_fn_error $? "conditional \"GAMEMAN\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by server-main.5c $as_me 0.6, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + +Configuration files: +$config_files + +Report bugs to ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +server-main.5c config.status 0.6 +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "ricochet.man") CONFIG_FILES="$CONFIG_FILES ricochet.man" ;; + "rrserve.man") CONFIG_FILES="$CONFIG_FILES rrserve.man" ;; + "ricochet.spec") CONFIG_FILES="$CONFIG_FILES ricochet.spec" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + + +eval set X " :F $CONFIG_FILES " +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + + + + esac + +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff -Nru ricochet-0.6/ricochet-0.6/configure.ac ricochet-0.7/ricochet-0.6/configure.ac --- ricochet-0.6/ricochet-0.6/configure.ac 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/ricochet-0.6/configure.ac 2017-03-23 14:30:22.000000000 +0000 @@ -0,0 +1,65 @@ +dnl Process this file with autoconf to produce a configure script. + +dnl Copyright © 2012 Keith Packard +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; version 2 of the License. +dnl +dnl This program is distributed in the hope that it will be useful, but +dnl WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License along +dnl with this program; if not, write to the Free Software Foundation, Inc., +dnl 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + +AC_PREREQ([2.64]) + +AC_INIT([server-main.5c],[0.6],[http://rr.nickle.org],[ricochet]) + +AC_CONFIG_SRCDIR([server-main.5c]) +AC_CONFIG_AUX_DIR(.) + +AM_INIT_AUTOMAKE([foreign]) + +AM_MAINTAINER_MODE + +AC_PROG_INSTALL + +ricochetlibdir='${datadir}'/ricochet + +AC_SUBST(ricochetlibdir) + +AC_ARG_ENABLE([gameman], +[ --enable-gameman Install manual pages in section 6 rather than section 1], +[case "${enableval}" in + yes) gameman=true ;; + no) gameman=false ;; + *) AC_MSG_ERROR([bad value ${enableval} for --enable-gameman]) ;; +esac],[gameman=false]) + +AM_CONDITIONAL([GAMEMAN], [test x$gameman = xtrue]) + +if test x$gameman = xtrue; then + MAN_SECTION=6 +else + MAN_SECTION=1 +fi + +AC_SUBST(MAN_SECTION) + +if test x$BUILD_DATE = x; then + BUILD_DATE=`date +%F` +fi + +AC_SUBST(BUILD_DATE) + +AC_CONFIG_FILES( + Makefile + ricochet.man + rrserve.man + ricochet.spec + ) + +AC_OUTPUT diff -Nru ricochet-0.6/ricochet-0.6/debian/changelog ricochet-0.7/ricochet-0.6/debian/changelog --- ricochet-0.6/ricochet-0.6/debian/changelog 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/ricochet-0.6/debian/changelog 2017-03-23 14:30:22.000000000 +0000 @@ -0,0 +1,43 @@ +ricochet (0.6) unstable; urgency=medium + + * Debian standard 3.9.8 + * dh compat 10 + * versioned link to debian/copyright format + + -- Keith Packard Thu, 23 Mar 2017 15:30:22 +0100 + +ricochet (0.5) unstable; urgency=medium + + * Make build reproducible by setting BUILD_DATE from changelog. + Closes: #787675. + * Release version 0.5. + + -- Keith Packard Tue, 09 Jun 2015 06:00:54 -0600 + +ricochet (0.4) unstable; urgency=low + + * Bring up the host chooser UI when the server connection fails + * Add .desktop file and application icon. Closes: #738017. + + -- Keith Packard Mon, 10 Feb 2014 00:14:52 -0800 + +ricochet (0.3) unstable; urgency=low + + * Improve appearance of board + * Fix user list when removing/adding same user + + -- Keith Packard Mon, 11 Jun 2012 13:37:57 -0700 + +ricochet (0.2) unstable; urgency=low + + * Rename 'rrclient' to 'ricochet' + * Add name/host selection dialog + * Add build dependency on 'nickle'. Closes: #674302. + + -- Keith Packard Wed, 30 May 2012 15:19:02 -0700 + +ricochet (0.1) unstable; urgency=low + + * Initial release + + -- Keith Packard Mon, 19 Mar 2012 21:46:32 -0700 diff -Nru ricochet-0.6/ricochet-0.6/debian/compat ricochet-0.7/ricochet-0.6/debian/compat --- ricochet-0.6/ricochet-0.6/debian/compat 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/ricochet-0.6/debian/compat 2017-03-23 14:30:22.000000000 +0000 @@ -0,0 +1 @@ +10 diff -Nru ricochet-0.6/ricochet-0.6/debian/control ricochet-0.7/ricochet-0.6/debian/control --- ricochet-0.6/ricochet-0.6/debian/control 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/ricochet-0.6/debian/control 2017-03-23 14:30:22.000000000 +0000 @@ -0,0 +1,13 @@ +Source: ricochet +Section: games +Priority: extra +Maintainer: Keith Packard +Build-Depends: debhelper (>= 10), autotools-dev, nickle (>= 2.74) +Standards-Version: 3.9.8 +Homepage: http://rr.nickle.org + +Package: ricochet +Architecture: all +Depends: ${misc:Depends}, nickle (>= 2.74), cairo-5c (>= 1.7) +Description: multi-user networked version of the Ricochet Robots game + Client and server programs written in nickle using the nichrome toolkit diff -Nru ricochet-0.6/ricochet-0.6/debian/copyright ricochet-0.7/ricochet-0.6/debian/copyright --- ricochet-0.6/ricochet-0.6/debian/copyright 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/ricochet-0.6/debian/copyright 2017-03-23 14:30:22.000000000 +0000 @@ -0,0 +1,24 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: ricochet +Source: http://rr.nickle.org + +Files: * +Copyright: 2003, 2012 Keith Packard +License: GPL-2 + +License: GPL-2 + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + . + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + . + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + . + A copy of the license is available on Debian systems at + /usr/share/common-licenses/GPL-2 diff -Nru ricochet-0.6/ricochet-0.6/debian/rules ricochet-0.7/ricochet-0.6/debian/rules --- ricochet-0.6/ricochet-0.6/debian/rules 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/ricochet-0.6/debian/rules 2015-06-09 11:54:35.000000000 +0000 @@ -0,0 +1,21 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +BUILD_DATE=$(shell dpkg-parsechangelog -S Date | LC_ALL=C date -u "+%F" -f -) +export BUILD_DATE + +configure_flags = --bindir=/usr/games --enable-gameman + +%: + dh $@ --with autotools-dev + +override_dh_auto_configure: + dh_auto_configure -- $(configure_flags) diff -Nru ricochet-0.6/ricochet-0.6/debian/source/format ricochet-0.7/ricochet-0.6/debian/source/format --- ricochet-0.6/ricochet-0.6/debian/source/format 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/ricochet-0.6/debian/source/format 2017-03-23 14:27:54.000000000 +0000 @@ -0,0 +1 @@ +3.0 (native) diff -Nru ricochet-0.6/ricochet-0.6/install-sh ricochet-0.7/ricochet-0.6/install-sh --- ricochet-0.6/ricochet-0.6/install-sh 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/ricochet-0.6/install-sh 2012-03-20 04:19:07.000000000 +0000 @@ -0,0 +1,527 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2011-01-19.21; # UTC + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +nl=' +' +IFS=" "" $nl" + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit=${DOITPROG-} +if test -z "$doit"; then + doit_exec=exec +else + doit_exec=$doit +fi + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_glob='?' +initialize_posix_glob=' + test "$posix_glob" != "?" || { + if (set -f) 2>/dev/null; then + posix_glob= + else + posix_glob=: + fi + } +' + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +no_target_directory= + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -s) stripcmd=$stripprog;; + + -t) dst_arg=$2 + # Protect names problematic for `test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; + + -T) no_target_directory=true;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + # Protect names problematic for `test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call `install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names problematic for `test' and other utilities. + case $src in + -* | [=\(\)!]) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + dst=$dst_arg + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + # Prefer dirname, but fall back on a substitute if dirname fails. + dstdir=` + (dirname "$dst") 2>/dev/null || + expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$dst" : 'X\(//\)[^/]' \| \ + X"$dst" : 'X\(//\)$' \| \ + X"$dst" : 'X\(/\)' \| . 2>/dev/null || + echo X"$dst" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q' + ` + + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writeable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; + esac + + eval "$initialize_posix_glob" + + oIFS=$IFS + IFS=/ + $posix_glob set -f + set fnord $dstdir + shift + $posix_glob set +f + IFS=$oIFS + + prefixes= + + for d + do + test X"$d" = X && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + + eval "$initialize_posix_glob" && + $posix_glob set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + $posix_glob set +f && + + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff -Nru ricochet-0.6/ricochet-0.6/LICENSE ricochet-0.7/ricochet-0.6/LICENSE --- ricochet-0.6/ricochet-0.6/LICENSE 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/ricochet-0.6/LICENSE 2012-03-20 06:08:03.000000000 +0000 @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff -Nru ricochet-0.6/ricochet-0.6/list.5c ricochet-0.7/ricochet-0.6/list.5c --- ricochet-0.6/ricochet-0.6/list.5c 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/ricochet-0.6/list.5c 2012-02-12 05:27:36.000000000 +0000 @@ -0,0 +1,78 @@ +/* + * Copyright © 2012 Keith Packard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +namespace List { + public typedef list_t; + + public typedef struct { + *list_t prev; + *list_t next; + } list_t; + + public void init(*list_t l) { + l->next = l; + l->prev = l; + } + + void add(*list_t entry, *list_t prev, *list_t next) { + next->prev = entry; + entry->next = next; + entry->prev = prev; + prev->next = entry; + } + + void del(*list_t prev, *list_t next) { + next->prev = prev; + prev->next = next; + } + + public bool is_empty(*list_t head) { + return head->next == head; + } + + public *list_t first(*list_t head) { + assert(!is_empty(head), "empty list"); + return head->next; + } + + public *list_t last(*list_t head) { + assert(!is_empty(head), "empty list"); + return head->prev; + } + + public void insert(*list_t entry, *list_t head) { + add(entry, head, head->next); + } + + public void append(*list_t entry, *list_t head) { + add(entry, head->prev, head); + } + + public void remove(*list_t entry) { + del(entry->prev, entry->next); + init(entry); + } + + public iterate(*list_t head, bool (*list_t) f) { + *list_t next; + for (*list_t pos = head->next; pos != head; pos = next) { + next = pos->next; + if (!f(pos)) + break; + } + } +} diff -Nru ricochet-0.6/ricochet-0.6/Makefile.am ricochet-0.7/ricochet-0.6/Makefile.am --- ricochet-0.6/ricochet-0.6/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/ricochet-0.6/Makefile.am 2014-02-10 08:12:45.000000000 +0000 @@ -0,0 +1,200 @@ +## Process this file with automake to produce Makefile.in + +## Copyright © 2012 Keith Packard +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; version 2 of the License. +## +## This program is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License along +## with this program; if not, write to the Free Software Foundation, Inc., +## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + +AUTOMAKE_OPTIONS = foreign + +ricochetlibdir=@ricochetlibdir@ + +UTILSRC = \ + array.5c \ + list.5c \ + shuffle.5c \ + timer.5c + +RRSRC = \ + rr.5c \ + rr-lex.5c \ + rr-send.5c + +CLIENTSRC = \ + client.5c \ + client-board.5c \ + client-draw.5c \ + client-games.5c \ + client-host.5c \ + client-link.5c \ + client-main.5c \ + client-messages.5c \ + client-net.5c \ + client-update.5c \ + client-userlist.5c \ + client-util.5c \ + client-window.5c \ + nichrome-message.5c \ + nichrome-rrboard.5c \ + nichrome-timer.5c + +CLIENTBUILT = \ + client-svg.5c + + +SERVERSRC = \ + server.5c \ + server-boards.5c \ + server-clients.5c \ + server-dispatch.5c \ + server-games.5c \ + server-main.5c \ + server-net.5c \ + server-readreq.5c \ + server-show.5c + +if GAMEMAN +man6_MANS = ricochet.man rrserve.man +else +man1_MANS = ricochet.man rrserve.man +endif + +MANSRC=ricochet.man.in rrserve.man.in + +desktopdir = $(datadir)/applications +desktop_file = ricochet.desktop +desktop_DATA = $(desktop_file) + +ICON=ricochet-icon.svg + +icondir = $(datadir)/icons/hicolor/scalable/apps + +icon_DATA = $(ICON) + +SVG=\ + $(top_srcdir)/svg/cell1.svg \ + $(top_srcdir)/svg/cell2.svg \ + $(top_srcdir)/svg/robot_blue.svg \ + $(top_srcdir)/svg/robot_green.svg \ + $(top_srcdir)/svg/robot_red.svg \ + $(top_srcdir)/svg/robot_yellow.svg \ + $(top_srcdir)/svg/target_blue_circle.svg \ + $(top_srcdir)/svg/target_blue_octagon.svg \ + $(top_srcdir)/svg/target_blue_square.svg \ + $(top_srcdir)/svg/target_blue_triangle.svg \ + $(top_srcdir)/svg/target_green_circle.svg \ + $(top_srcdir)/svg/target_green_octagon.svg \ + $(top_srcdir)/svg/target_green_square.svg \ + $(top_srcdir)/svg/target_green_triangle.svg \ + $(top_srcdir)/svg/target_red_circle.svg \ + $(top_srcdir)/svg/target_red_octagon.svg \ + $(top_srcdir)/svg/target_red_square.svg \ + $(top_srcdir)/svg/target_red_triangle.svg \ + $(top_srcdir)/svg/target_whirl.svg \ + $(top_srcdir)/svg/target_yellow_circle.svg \ + $(top_srcdir)/svg/target_yellow_octagon.svg \ + $(top_srcdir)/svg/target_yellow_square.svg \ + $(top_srcdir)/svg/target_yellow_triangle.svg \ + $(top_srcdir)/svg/wall.svg \ + $(top_srcdir)/svg/robot_shadow.svg + +NICKLESRC = $(UTILSRC) $(RRSRC) $(CLIENTSRC) $(SERVERSRC) + +NICKLEFILES = $(NICKLESRC) $(CLIENTBUILT) + +DEBIAN = debian/changelog debian/compat \ + debian/control debian/copyright debian/rules \ + debian/source/format + +EXTRA_DIST = protocol \ + $(NICKLESRC) \ + ricochet.in rrserve.in \ + svg/bin2cstring.5c \ + make-icon.5c \ + $(desktop_file).in \ + $(SVG) $(DEBIAN) LICENSE $(MANSRC) + +ricochetlib_DATA = $(NICKLEFILES) + +bin_SCRIPTS = ricochet rrserve + +ricochet: ricochet.in + sed -e 's#%ricochetlibdir%#@ricochetlibdir@#' -e 's#%ricochetbindir%#$(bindir)#' ${srcdir}/ricochet.in > $@ && chmod +x $@ + +rrserve: rrserve.in + sed -e 's#%ricochetlibdir%#@ricochetlibdir@#' ${srcdir}/rrserve.in > $@ && chmod +x $@ + +$(desktop_file): $(desktop_file).in + sed -e 's#%bindir%#@bindir@#' ${srcdir}/ricochet.desktop.in > $@ + +ricochet-icon.svg: make-icon.5c $(NICKLEFILES) $(SVG) + nickle ${srcdir}/make-icon.5c --libdir "${srcdir}":"." $@ + +client-svg.5c: $(SVG) svg/bin2cstring.5c + $(RM) $@ + nickle $(top_srcdir)/svg/bin2cstring.5c $(SVG) > $@ + +clean-local: + $(RM) client-svg.5c ricochet rrserve $(ICON) $(desktop_file) + +TARFILE=$(PACKAGE)-$(VERSION).tar.gz +DEBFILE=$(PACKAGE)_$(VERSION)-1_all.deb +SRPMFILE=$(RPMDIR)/SRPMS/$(PACKAGE)-$(VERSION)-1.src.rpm +RPMFILE=$(RPMDIR)/RPMS/$(PACKAGE)-$(VERSION)-1.all.rpm +RELEASE_FILES = $(TARFILE) $(DEBFILE) $(SRPMFILE) $(RPMFILE) +DEB_TAR_DIR=$(PACKAGE)_$(VERSION).orig +DEB_TAR=$(DEB_TAR_DIR).tar.gz + +debuild: $(DEBFILE) + +$(DEBFILE): $(DEB_TAR) $(TARFILE) + tar xzf $(TARFILE) +# (cd $(distdir) && pdebuild --buildresult $(abs_top_builddir) --auto-debsign) + (cd $(distdir) && debuild) + +debuild-unsigned: $(DEB_TAR) $(TARFILE) + tar xzf $(distdir).tar.gz + (cd $(distdir)/debian && debuild -us -uc) + +$(DEB_TAR): $(TARFILE) + rm -f $(DEB_TAR) + rm -rf $(DEB_TAR_DIR) + tar xzf $(TARFILE) + mv $(distdir) $(DEB_TAR_DIR) + rm -rf $(DEB_TAR_DIR)/debian + tar czf $(DEB_TAR) $(DEB_TAR_DIR) + +$(TARFILE): dist-gzip $(DISTFILES) + touch $(TARFILE) + echo $(TARFILE) ready + +# +# This assumes you've got Mike Harris's rpmbuild-nonroot stuff installed +# using the defaults +# +RPMDIR=$(HOME)/rpmbuild + +rpm: $(RPMFILE) $(SRPMFILE) + +$(RPMFILE): $(TARFILE) ricochet.spec + mkdir -p $(RPMDIR)/$(PACKAGE)-$(VERSION) + cp $(TARFILE) $(RPMDIR)/$(PACKAGE)-$(VERSION) + rpmbuild -ba ricochet.spec + +$(SRPMFILE): $(RPMFILE) + +release-files: $(RELEASE_FILES) + +release: $(RELEASE_FILES) + scp $(RELEASE_FILES) nickle.org:/var/www/nickle/release + +.PHONY: debuild debuild-signed debuild-unsigned debuild-dirs rpm force diff -Nru ricochet-0.6/ricochet-0.6/Makefile.in ricochet-0.7/ricochet-0.6/Makefile.in --- ricochet-0.6/ricochet-0.6/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/ricochet-0.6/Makefile.in 2017-03-23 14:30:22.000000000 +0000 @@ -0,0 +1,950 @@ +# Makefile.in generated by automake 1.15 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(am__DIST_COMMON) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = ricochet.man rrserve.man ricochet.spec +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" \ + "$(DESTDIR)$(man6dir)" "$(DESTDIR)$(desktopdir)" \ + "$(DESTDIR)$(icondir)" "$(DESTDIR)$(ricochetlibdir)" +SCRIPTS = $(bin_SCRIPTS) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +man1dir = $(mandir)/man1 +man6dir = $(mandir)/man6 +NROFF = nroff +MANS = $(man1_MANS) $(man6_MANS) +DATA = $(desktop_DATA) $(icon_DATA) $(ricochetlib_DATA) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/ricochet.man.in \ + $(srcdir)/ricochet.spec.in $(srcdir)/rrserve.man.in install-sh \ + missing +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__post_remove_distdir = $(am__remove_distdir) +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +DIST_TARGETS = dist-gzip +distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILD_DATE = @BUILD_DATE@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MAN_SECTION = @MAN_SECTION@ +MKDIR_P = @MKDIR_P@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +am__leading_dot = @am__leading_dot@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +ricochetlibdir = @ricochetlibdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = foreign +UTILSRC = \ + array.5c \ + list.5c \ + shuffle.5c \ + timer.5c + +RRSRC = \ + rr.5c \ + rr-lex.5c \ + rr-send.5c + +CLIENTSRC = \ + client.5c \ + client-board.5c \ + client-draw.5c \ + client-games.5c \ + client-host.5c \ + client-link.5c \ + client-main.5c \ + client-messages.5c \ + client-net.5c \ + client-update.5c \ + client-userlist.5c \ + client-util.5c \ + client-window.5c \ + nichrome-message.5c \ + nichrome-rrboard.5c \ + nichrome-timer.5c + +CLIENTBUILT = \ + client-svg.5c + +SERVERSRC = \ + server.5c \ + server-boards.5c \ + server-clients.5c \ + server-dispatch.5c \ + server-games.5c \ + server-main.5c \ + server-net.5c \ + server-readreq.5c \ + server-show.5c + +@GAMEMAN_TRUE@man6_MANS = ricochet.man rrserve.man +@GAMEMAN_FALSE@man1_MANS = ricochet.man rrserve.man +MANSRC = ricochet.man.in rrserve.man.in +desktopdir = $(datadir)/applications +desktop_file = ricochet.desktop +desktop_DATA = $(desktop_file) +ICON = ricochet-icon.svg +icondir = $(datadir)/icons/hicolor/scalable/apps +icon_DATA = $(ICON) +SVG = \ + $(top_srcdir)/svg/cell1.svg \ + $(top_srcdir)/svg/cell2.svg \ + $(top_srcdir)/svg/robot_blue.svg \ + $(top_srcdir)/svg/robot_green.svg \ + $(top_srcdir)/svg/robot_red.svg \ + $(top_srcdir)/svg/robot_yellow.svg \ + $(top_srcdir)/svg/target_blue_circle.svg \ + $(top_srcdir)/svg/target_blue_octagon.svg \ + $(top_srcdir)/svg/target_blue_square.svg \ + $(top_srcdir)/svg/target_blue_triangle.svg \ + $(top_srcdir)/svg/target_green_circle.svg \ + $(top_srcdir)/svg/target_green_octagon.svg \ + $(top_srcdir)/svg/target_green_square.svg \ + $(top_srcdir)/svg/target_green_triangle.svg \ + $(top_srcdir)/svg/target_red_circle.svg \ + $(top_srcdir)/svg/target_red_octagon.svg \ + $(top_srcdir)/svg/target_red_square.svg \ + $(top_srcdir)/svg/target_red_triangle.svg \ + $(top_srcdir)/svg/target_whirl.svg \ + $(top_srcdir)/svg/target_yellow_circle.svg \ + $(top_srcdir)/svg/target_yellow_octagon.svg \ + $(top_srcdir)/svg/target_yellow_square.svg \ + $(top_srcdir)/svg/target_yellow_triangle.svg \ + $(top_srcdir)/svg/wall.svg \ + $(top_srcdir)/svg/robot_shadow.svg + +NICKLESRC = $(UTILSRC) $(RRSRC) $(CLIENTSRC) $(SERVERSRC) +NICKLEFILES = $(NICKLESRC) $(CLIENTBUILT) +DEBIAN = debian/changelog debian/compat \ + debian/control debian/copyright debian/rules \ + debian/source/format + +EXTRA_DIST = protocol \ + $(NICKLESRC) \ + ricochet.in rrserve.in \ + svg/bin2cstring.5c \ + make-icon.5c \ + $(desktop_file).in \ + $(SVG) $(DEBIAN) LICENSE $(MANSRC) + +ricochetlib_DATA = $(NICKLEFILES) +bin_SCRIPTS = ricochet rrserve +TARFILE = $(PACKAGE)-$(VERSION).tar.gz +DEBFILE = $(PACKAGE)_$(VERSION)-1_all.deb +SRPMFILE = $(RPMDIR)/SRPMS/$(PACKAGE)-$(VERSION)-1.src.rpm +RPMFILE = $(RPMDIR)/RPMS/$(PACKAGE)-$(VERSION)-1.all.rpm +RELEASE_FILES = $(TARFILE) $(DEBFILE) $(SRPMFILE) $(RPMFILE) +DEB_TAR_DIR = $(PACKAGE)_$(VERSION).orig +DEB_TAR = $(DEB_TAR_DIR).tar.gz + +# +# This assumes you've got Mike Harris's rpmbuild-nonroot stuff installed +# using the defaults +# +RPMDIR = $(HOME)/rpmbuild +all: all-am + +.SUFFIXES: +am--refresh: Makefile + @: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): +ricochet.man: $(top_builddir)/config.status $(srcdir)/ricochet.man.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +rrserve.man: $(top_builddir)/config.status $(srcdir)/rrserve.man.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +ricochet.spec: $(top_builddir)/config.status $(srcdir)/ricochet.spec.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +install-binSCRIPTS: $(bin_SCRIPTS) + @$(NORMAL_INSTALL) + @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n' \ + -e 'h;s|.*|.|' \ + -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) { files[d] = files[d] " " $$1; \ + if (++n[d] == $(am__install_max)) { \ + print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ + else { print "f", d "/" $$4, $$1 } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 's,.*/,,;$(transform)'`; \ + dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) +install-man1: $(man1_MANS) + @$(NORMAL_INSTALL) + @list1='$(man1_MANS)'; \ + list2=''; \ + test -n "$(man1dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.1[a-z]*$$/p'; \ + fi; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ + fi; \ + done; \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ + done; } + +uninstall-man1: + @$(NORMAL_UNINSTALL) + @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) +install-man6: $(man6_MANS) + @$(NORMAL_INSTALL) + @list1='$(man6_MANS)'; \ + list2=''; \ + test -n "$(man6dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man6dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man6dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.6[a-z]*$$/p'; \ + fi; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^6][0-9a-z]*$$,6,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man6dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man6dir)/$$inst" || exit $$?; \ + fi; \ + done; \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man6dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man6dir)" || exit $$?; }; \ + done; } + +uninstall-man6: + @$(NORMAL_UNINSTALL) + @list='$(man6_MANS)'; test -n "$(man6dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^6][0-9a-z]*$$,6,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + dir='$(DESTDIR)$(man6dir)'; $(am__uninstall_files_from_dir) +install-desktopDATA: $(desktop_DATA) + @$(NORMAL_INSTALL) + @list='$(desktop_DATA)'; test -n "$(desktopdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(desktopdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(desktopdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(desktopdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(desktopdir)" || exit $$?; \ + done + +uninstall-desktopDATA: + @$(NORMAL_UNINSTALL) + @list='$(desktop_DATA)'; test -n "$(desktopdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(desktopdir)'; $(am__uninstall_files_from_dir) +install-iconDATA: $(icon_DATA) + @$(NORMAL_INSTALL) + @list='$(icon_DATA)'; test -n "$(icondir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(icondir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(icondir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(icondir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(icondir)" || exit $$?; \ + done + +uninstall-iconDATA: + @$(NORMAL_UNINSTALL) + @list='$(icon_DATA)'; test -n "$(icondir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(icondir)'; $(am__uninstall_files_from_dir) +install-ricochetlibDATA: $(ricochetlib_DATA) + @$(NORMAL_INSTALL) + @list='$(ricochetlib_DATA)'; test -n "$(ricochetlibdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(ricochetlibdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(ricochetlibdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(ricochetlibdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(ricochetlibdir)" || exit $$?; \ + done + +uninstall-ricochetlibDATA: + @$(NORMAL_UNINSTALL) + @list='$(ricochetlib_DATA)'; test -n "$(ricochetlibdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(ricochetlibdir)'; $(am__uninstall_files_from_dir) +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + + +distdir: $(DISTFILES) + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__post_remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__post_remove_distdir) + +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz + $(am__post_remove_distdir) + +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz + $(am__post_remove_distdir) + +dist-tarZ: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__post_remove_distdir) + +dist-shar: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__post_remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__post_remove_distdir) + +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir) + chmod u+w $(distdir) + mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build/sub \ + && ../../configure \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=../.. --prefix="$$dc_install_base" \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__post_remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-am +all-am: Makefile $(SCRIPTS) $(MANS) $(DATA) +installdirs: + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man6dir)" "$(DESTDIR)$(desktopdir)" "$(DESTDIR)$(icondir)" "$(DESTDIR)$(ricochetlibdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-local mostlyclean-am + +distclean: distclean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-desktopDATA install-iconDATA install-man \ + install-ricochetlibDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binSCRIPTS + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: install-man1 install-man6 + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binSCRIPTS uninstall-desktopDATA \ + uninstall-iconDATA uninstall-man uninstall-ricochetlibDATA + +uninstall-man: uninstall-man1 uninstall-man6 + +.MAKE: install-am install-strip + +.PHONY: all all-am am--refresh check check-am clean clean-generic \ + clean-local cscopelist-am ctags-am dist dist-all dist-bzip2 \ + dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ + distcheck distclean distclean-generic distcleancheck distdir \ + distuninstallcheck dvi dvi-am html html-am info info-am \ + install install-am install-binSCRIPTS install-data \ + install-data-am install-desktopDATA install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-iconDATA install-info install-info-am install-man \ + install-man1 install-man6 install-pdf install-pdf-am \ + install-ps install-ps-am install-ricochetlibDATA install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags-am uninstall uninstall-am \ + uninstall-binSCRIPTS uninstall-desktopDATA uninstall-iconDATA \ + uninstall-man uninstall-man1 uninstall-man6 \ + uninstall-ricochetlibDATA + +.PRECIOUS: Makefile + + +ricochet: ricochet.in + sed -e 's#%ricochetlibdir%#@ricochetlibdir@#' -e 's#%ricochetbindir%#$(bindir)#' ${srcdir}/ricochet.in > $@ && chmod +x $@ + +rrserve: rrserve.in + sed -e 's#%ricochetlibdir%#@ricochetlibdir@#' ${srcdir}/rrserve.in > $@ && chmod +x $@ + +$(desktop_file): $(desktop_file).in + sed -e 's#%bindir%#@bindir@#' ${srcdir}/ricochet.desktop.in > $@ + +ricochet-icon.svg: make-icon.5c $(NICKLEFILES) $(SVG) + nickle ${srcdir}/make-icon.5c --libdir "${srcdir}":"." $@ + +client-svg.5c: $(SVG) svg/bin2cstring.5c + $(RM) $@ + nickle $(top_srcdir)/svg/bin2cstring.5c $(SVG) > $@ + +clean-local: + $(RM) client-svg.5c ricochet rrserve $(ICON) $(desktop_file) + +debuild: $(DEBFILE) + +$(DEBFILE): $(DEB_TAR) $(TARFILE) + tar xzf $(TARFILE) +# (cd $(distdir) && pdebuild --buildresult $(abs_top_builddir) --auto-debsign) + (cd $(distdir) && debuild) + +debuild-unsigned: $(DEB_TAR) $(TARFILE) + tar xzf $(distdir).tar.gz + (cd $(distdir)/debian && debuild -us -uc) + +$(DEB_TAR): $(TARFILE) + rm -f $(DEB_TAR) + rm -rf $(DEB_TAR_DIR) + tar xzf $(TARFILE) + mv $(distdir) $(DEB_TAR_DIR) + rm -rf $(DEB_TAR_DIR)/debian + tar czf $(DEB_TAR) $(DEB_TAR_DIR) + +$(TARFILE): dist-gzip $(DISTFILES) + touch $(TARFILE) + echo $(TARFILE) ready + +rpm: $(RPMFILE) $(SRPMFILE) + +$(RPMFILE): $(TARFILE) ricochet.spec + mkdir -p $(RPMDIR)/$(PACKAGE)-$(VERSION) + cp $(TARFILE) $(RPMDIR)/$(PACKAGE)-$(VERSION) + rpmbuild -ba ricochet.spec + +$(SRPMFILE): $(RPMFILE) + +release-files: $(RELEASE_FILES) + +release: $(RELEASE_FILES) + scp $(RELEASE_FILES) nickle.org:/var/www/nickle/release + +.PHONY: debuild debuild-signed debuild-unsigned debuild-dirs rpm force + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -Nru ricochet-0.6/ricochet-0.6/make-icon.5c ricochet-0.7/ricochet-0.6/make-icon.5c --- ricochet-0.6/ricochet-0.6/make-icon.5c 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/ricochet-0.6/make-icon.5c 2014-02-09 20:35:19.000000000 +0000 @@ -0,0 +1,84 @@ +#!/usr/bin/env nickle + +autoimport ParseArgs; + +string ricochet_lib = String::dirname(argv[0]); +string target_file; + +argdesc argd = { + args = { + { + .var = (arg_var.arg_string) &ricochet_lib, + .name = "libdir", + .desc = "Directory containing Ricochet nickle files" + } + }, + posn_args = { + { + .var = (arg_var.arg_string) &target_file, + .name = "targetfile", + } + } +}; + +parseargs(&argd, &argv) + +Command::nickle_path = ricochet_lib + ":" + Command::nickle_path; + +autoload Cairo; + +autoload Client; +autoload Client::Svg; +autoload RR; +autoload Client::Draw; + +void main () +{ + Cairo::cairo_t cr; + + if (!is_uninit(&target_file)) + cr = Cairo::new_svg(target_file, 32, 32); + else + cr = Cairo::new(); + + RR::RobotOrNone robot = (RR::RobotOrNone) { + .robot = (RR::Robot) { + .color = RR::Color.Blue + } + }; + + RR::RobotOrNone robot_none = (RR::RobotOrNone) { + .none = ◊ + }; + + RR::TargetOrNone target = (RR::TargetOrNone) { + .target = (RR::Target) { + .color = RR::Color.Blue, + .shape = RR::Shape.Triangle, + .active = true + } + }; + + RR::Object object = (RR::Object) { + .target = target, + .robot = robot_none + }; + + Client::Draw::transform_t transform = (Client::Draw::transform_t) { + .xoff = 0, + .yoff = 0, + .xscale = 1, + .yscale = 1 + }; + + Client::Draw::background(cr, 0, 0, object, &transform); + + Client::Draw::contents(cr, 0, 0, object, target, robot, &transform); + + if (dim(argv) <= 1) + sleep(10000); + else + Cairo::destroy(cr); +} + +main(); diff -Nru ricochet-0.6/ricochet-0.6/missing ricochet-0.7/ricochet-0.6/missing --- ricochet-0.6/ricochet-0.6/missing 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/ricochet-0.6/missing 2014-02-09 20:10:26.000000000 +0000 @@ -0,0 +1,215 @@ +#! /bin/sh +# Common wrapper for a few potentially missing GNU programs. + +scriptversion=2013-10-28.13; # UTC + +# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Originally written by Fran,cois Pinard , 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try '$0 --help' for more information" + exit 1 +fi + +case $1 in + + --is-lightweight) + # Used by our autoconf macros to check whether the available missing + # script is modern enough. + exit 0 + ;; + + --run) + # Back-compat with the calling convention used by older automake. + shift + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due +to PROGRAM being missing or too old. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + +Supported PROGRAM values: + aclocal autoconf autoheader autom4te automake makeinfo + bison yacc flex lex help2man + +Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and +'g' are ignored when checking the name. + +Send bug reports to ." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: unknown '$1' option" + echo 1>&2 "Try '$0 --help' for more information" + exit 1 + ;; + +esac + +# Run the given program, remember its exit status. +"$@"; st=$? + +# If it succeeded, we are done. +test $st -eq 0 && exit 0 + +# Also exit now if we it failed (or wasn't found), and '--version' was +# passed; such an option is passed most likely to detect whether the +# program is present and works. +case $2 in --version|--help) exit $st;; esac + +# Exit code 63 means version mismatch. This often happens when the user +# tries to use an ancient version of a tool on a file that requires a +# minimum version. +if test $st -eq 63; then + msg="probably too old" +elif test $st -eq 127; then + # Program was missing. + msg="missing on your system" +else + # Program was found and executed, but failed. Give up. + exit $st +fi + +perl_URL=http://www.perl.org/ +flex_URL=http://flex.sourceforge.net/ +gnu_software_URL=http://www.gnu.org/software + +program_details () +{ + case $1 in + aclocal|automake) + echo "The '$1' program is part of the GNU Automake package:" + echo "<$gnu_software_URL/automake>" + echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/autoconf>" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + autoconf|autom4te|autoheader) + echo "The '$1' program is part of the GNU Autoconf package:" + echo "<$gnu_software_URL/autoconf/>" + echo "It also requires GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + esac +} + +give_advice () +{ + # Normalize program name to check for. + normalized_program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + + printf '%s\n' "'$1' is $msg." + + configure_deps="'configure.ac' or m4 files included by 'configure.ac'" + case $normalized_program in + autoconf*) + echo "You should only need it if you modified 'configure.ac'," + echo "or m4 files included by it." + program_details 'autoconf' + ;; + autoheader*) + echo "You should only need it if you modified 'acconfig.h' or" + echo "$configure_deps." + program_details 'autoheader' + ;; + automake*) + echo "You should only need it if you modified 'Makefile.am' or" + echo "$configure_deps." + program_details 'automake' + ;; + aclocal*) + echo "You should only need it if you modified 'acinclude.m4' or" + echo "$configure_deps." + program_details 'aclocal' + ;; + autom4te*) + echo "You might have modified some maintainer files that require" + echo "the 'autom4te' program to be rebuilt." + program_details 'autom4te' + ;; + bison*|yacc*) + echo "You should only need it if you modified a '.y' file." + echo "You may want to install the GNU Bison package:" + echo "<$gnu_software_URL/bison/>" + ;; + lex*|flex*) + echo "You should only need it if you modified a '.l' file." + echo "You may want to install the Fast Lexical Analyzer package:" + echo "<$flex_URL>" + ;; + help2man*) + echo "You should only need it if you modified a dependency" \ + "of a man page." + echo "You may want to install the GNU Help2man package:" + echo "<$gnu_software_URL/help2man/>" + ;; + makeinfo*) + echo "You should only need it if you modified a '.texi' file, or" + echo "any other file indirectly affecting the aspect of the manual." + echo "You might want to install the Texinfo package:" + echo "<$gnu_software_URL/texinfo/>" + echo "The spurious makeinfo call might also be the consequence of" + echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" + echo "want to install GNU make:" + echo "<$gnu_software_URL/make/>" + ;; + *) + echo "You might have modified some files without having the proper" + echo "tools for further handling them. Check the 'README' file, it" + echo "often tells you about the needed prerequisites for installing" + echo "this package. You may also peek at any GNU archive site, in" + echo "case some other package contains this missing '$1' program." + ;; + esac +} + +give_advice "$1" | sed -e '1s/^/WARNING: /' \ + -e '2,$s/^/ /' >&2 + +# Propagate the correct exit status (expected to be 127 for a program +# not found, 63 for a program that failed due to version mismatch). +exit $st + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff -Nru ricochet-0.6/ricochet-0.6/nichrome-message.5c ricochet-0.7/ricochet-0.6/nichrome-message.5c --- ricochet-0.6/ricochet-0.6/nichrome-message.5c 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/ricochet-0.6/nichrome-message.5c 2012-05-21 21:04:32.000000000 +0000 @@ -0,0 +1,50 @@ +/* + * Copyright © 2012 Keith Packard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +autoload Nichrome; +autoload Nichrome::Button; +autoload Nichrome::Box; +autoload Nichrome::Label; +autoload Nichrome::Toggle; +autoload Nichrome::Textline; +autoload Nichrome::RRboard; +autoload Nichrome::Solid; + +extend namespace Nichrome { + public namespace Message { + public typedef struct { + *nichrome_t ui; + } message_t; + + protected message_t new (string title, string contents) { + *message_t message = &(message_t) {}; + message->ui = Nichrome::new(title, 100, 100); + + *Box::box_t box = Box::new(Box::dir_t.vertical, + Box::widget_item(Label::new(message->ui, contents), 1, 1), + Box::box_item(Box::new(Box::dir_t.horizontal, + Box::glue_item(1), + Box::widget_item(Button::new(message->ui, + "OK", + void func (*widget_t w, bool state) { + Nichrome::destroy(message->ui); + }), 0, 0)))); + Nichrome::set_box(message->ui, box); + main_loop(message->ui); + } + } +} diff -Nru ricochet-0.6/ricochet-0.6/nichrome-rrboard.5c ricochet-0.7/ricochet-0.6/nichrome-rrboard.5c --- ricochet-0.6/ricochet-0.6/nichrome-rrboard.5c 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/ricochet-0.6/nichrome-rrboard.5c 2012-06-09 23:35:15.000000000 +0000 @@ -0,0 +1,287 @@ +/* + * Copyright © 2012 Keith Packard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +autoload Nichrome; +autoload RR; +autoload Client; +autoload Client::Draw; +autoload Mutex; +autoload Nichrome::Timer; + +extend namespace Nichrome { + + public namespace RRboard { + + import Client; + import RR; + + public int border_width = ceil(Draw::wall_thickness / 2); + public int board_width = RR::Width * Draw::cell_width; + public int total_width = board_width + border_width * 2; + public int board_height = RR::Height * Draw::cell_height; + public int total_height = board_height + border_width * 2; + + public typedef widget_t + struct { + RR::Board board; + RR::RobotOrNone active_robot; + *Timer::timer_t timer; + void (RR::Color color, + RR::Direction direction) move_callback; + int button_x, button_y; + } rrboard_widget_t; + + real dimension(&rrboard_widget_t widget) = min (widget.geometry.width, widget.geometry.height); + + Draw::transform_t transform(&rrboard_widget_t widget) { + real dim = dimension(&widget); + real xscale = dim / total_width; + real yscale = dim / total_height; + return (Draw::transform_t) { + .xscale = xscale, + .yscale = yscale, + .xoff = (widget.geometry.width - dim) // 2 + ceil(border_width * xscale), + .yoff = (widget.geometry.height - dim) // 2 + ceil(border_width * yscale) + }; + } + + bool is_middle(int x, int y) { + if (x < RR::Width / 2 - 1) + return false; + if (x >= RR::Width / 2 + 1) + return false; + if (y < RR::Height / 2 - 1) + return false; + if (y >= RR::Height / 2 + 1) + return false; + return true; + } + + void draw (cairo_t cr, &rrboard_widget_t widget) { + Draw::transform_t t = transform(&widget); + RR::TargetOrNone active_target = RR::active_target(&widget.board); + + save(cr); + for (int y = 0; y < RR::Height; y++) + for (int x = 0; x < RR::Width; x++) + if (!is_middle(x, y)) + Draw::background(cr, x, y, widget.board[x,y], &t); + for (int y = 0; y < RR::Height; y++) + for (int x = 0; x < RR::Width; x++) { + Draw::walls(cr, x, y, widget.board[x,y], &t); + Draw::contents(cr, x, y, widget.board[x,y], + active_target, widget.active_robot, &t); + } + Draw::target(cr, RR::Width / 2 - 1, RR::Height / 2 - 1, + active_target, &t); + restore(cr); + } + + void outline (cairo_t cr, &rrboard_widget_t widget) { + rectangle(cr, 0, 0, widget.geometry.width, widget.geometry.height); + } + + void natural (cairo_t cr, &rrboard_widget_t widget) { + rectangle(cr, 0, 0, total_width, total_height); + } + + /* Override default widget configure function to also reposition + * the timer widget + */ + void configure (&rrboard_widget_t widget, rect_t geometry) { + Widget::configure(&widget, geometry); + + /* Configure timer to sit over the central + * region of the board + */ + real board_dim = dimension(&widget); + real timer_dim = board_dim * 2 / RR::Width; + real timer_pos = board_dim / RR::Width * 7; + widget.timer->configure (widget.timer, + (rect_t) { + .x = geometry.x + timer_pos, + .y = geometry.y + timer_pos, + .width = timer_dim, + .height = timer_dim + }); + } + + void set_active_robot(&rrboard_widget_t widget, RR::Robot robot) { + widget.active_robot = (RR::RobotOrNone.robot) robot; + Widget::redraw(&widget); + } + + void set_active (&rrboard_widget_t widget, string color) { + try { + set_active_robot(&widget, (RR::Robot) { .color = RR::color(color) }); + } catch RR::rr_error(RR::Error error) { + } + } + + void move_active (&rrboard_widget_t widget, string dir) { + try { + RR::Direction direction = RR::direction(dir); + union switch (widget.active_robot) { + case robot r: + widget.move_callback(r.color, direction); + break; + default: + } + } catch RR::rr_error(RR::Error error) { + } + } + + protected void key (&rrboard_widget_t widget, &key_event_t event) { + + if (event.type != key_type_t.press) + return; + + switch (event.key) { + case "r": case "R": + case "g": case "G": + case "b": case "B": + case "y": case "Y": + set_active (&widget, event.key); + break; + case " ": + set_active (&widget, "whirl"); + break; + case "Left": case "w": case "W": + move_active(&widget, "west"); + break; + case "Right": case "e": case "E": + move_active(&widget, "east"); + break; + case "Up": case "n": case "N": + move_active(&widget, "north"); + break; + case "Down": case "s": case "S": + move_active(&widget, "south"); + break; + } + } + + typedef struct { int x, y; } position_t; + + /* + * A bit expensive, but it's more reliable than trying to + * keep track of robot positions separately + */ + position_t find_robot (&rrboard_widget_t widget, RR::Robot robot) { + for (int y = 0; y < RR::Height; y++) + for (int x = 0; x < RR::Width; x++) { + union switch (widget.board[x,y].robot) { + case robot r: + if (r.color == robot.color) + return (position_t) { .x = x, .y = y }; + break; + default: + } + } + return (position_t) { .x = 0, .y = 0 }; + } + + protected void button (&rrboard_widget_t widget, &button_event_t event) { + + /* Convert button position to board location */ + Draw::transform_t t = transform(&widget); + int x = floor ((event.x - t.xoff) / t.xscale / Draw::cell_width); + int y = floor ((event.y - t.yoff) / t.yscale / Draw::cell_height); + + enum switch (event.type) { + case press: + RR::Object object = widget.board[x,y]; + + /* Clicking on a robot selects that robot + */ + union switch (object.robot) { + case robot r: + set_active_robot(&widget, r); + break; + default: + } + break; + case release: + + /* Releasing with an active robot moves the robot + * towards the point of release + */ + union switch (widget.active_robot) { + case robot r: + position_t robot_pos = find_robot(&widget, r); + int dx = x - robot_pos.x; + int dy = y - robot_pos.y; + + if (abs (dx) > abs (dy)) { + if (dx < 0) + move_active(&widget, "west"); + else if (dx > 0) + move_active(&widget, "east"); + } else { + if (dy < 0) + move_active(&widget, "north"); + else if (dy > 0) + move_active(&widget, "south"); + } + break; + default: + break; + } + break; + default: + } + } + + protected void set_timer (&rrboard_widget_t widget, real time) { + Timer::set_timer(widget.timer, time); + } + + protected void stop_timer (&rrboard_widget_t widget) { + Timer::stop_timer(widget.timer); + } + + protected void hide_timer (&rrboard_widget_t widget) { + Timer::stop_timer(widget.timer); + Timer::hide(widget.timer); + } + + protected void show_timer (&rrboard_widget_t widget) { + Timer::show(widget.timer); + } + + public *rrboard_widget_t new(&nichrome_t nichrome, + void(RR::Color color, RR::Direction dir) move_callback){ + &rrboard_widget_t widget = &(rrboard_widget_t) {}; + + widget.timer = Timer::new(&nichrome); /* make sure timer is above rrboard */ + Widget::init(&nichrome, &widget); + widget.draw = draw; + widget.outline = outline; + widget.natural = natural; + widget.configure = configure; + widget.key = key; + widget.button = button; + widget.active_robot = RobotOrNone.none; + widget.move_callback = move_callback; + widget.board = (RR::Board) { { { .robot = RobotOrNone.none, + .target = TargetOrNone.none, + .walls = { .left = false, .right = false, + .above = false, .below = false } + } ... } ... }; + return &widget; + } + } +} diff -Nru ricochet-0.6/ricochet-0.6/nichrome-timer.5c ricochet-0.7/ricochet-0.6/nichrome-timer.5c --- ricochet-0.6/ricochet-0.6/nichrome-timer.5c 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/ricochet-0.6/nichrome-timer.5c 2012-06-09 23:35:08.000000000 +0000 @@ -0,0 +1,135 @@ +/* + * Copyright © 2012 Keith Packard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +autoload Nichrome; +autoload Mutex; + +extend namespace Nichrome { + public namespace Timer { + + public typedef widget_t + struct { + Mutex::mutex lock; + bool running; + bool visible; + int end; + thread timer; + } timer_t; + + void draw (cairo_t cr, &timer_t widget) { + if (!widget.visible) + return; + real left; + if (widget.running) { + left = (widget.end - millis()) / 1000; + + if (left < 0) + left = 0; + if (left > 60) + left = 60; + } else + left = 0; + real filled = 60 - left; + save (cr); + scale (cr, widget.geometry.width / 2, widget.geometry.height / 2); + move_to (cr, 1, 1); + arc (cr, + 1, 1, /* center */ + 0.9, /* radius */ + - π / 2, /* start angle */ + 2 * π * (filled) / 60.0 - π/2); /* end angle */ + close_path (cr); + set_source_rgba (cr, 0.0, 0.0, 0.0, 0.5); + fill (cr); + restore (cr); + } + + void run_timer (&timer_t widget) { + twixt(Mutex::acquire(widget.lock); Mutex::release(widget.lock)) { + try { + while ((int now = millis()) <= widget.end) { + int delay = (widget.end - now) % 100; + if (delay == 0) + delay = 100; + twixt(Mutex::release(widget.lock); Mutex::acquire(widget.lock)) { + sleep(delay); + Widget::redraw(&widget); + } + } + } catch Thread::signal (int sig) { + } + widget.running = false; + } + } + + void start_timer (&timer_t widget) { + twixt(Mutex::acquire(widget.lock); Mutex::release(widget.lock)) { + } + } + + protected void set_timer (&timer_t widget, real time) { + twixt(Mutex::acquire(widget.lock); Mutex::release(widget.lock)) { + widget.visible = true; + widget.end = millis() + floor (time * 1000 + 0.5); + if (!widget.running) { + widget.running = true; + widget.timer = fork run_timer(&widget); + } + } + } + + protected void stop_timer (&timer_t widget) { + widget.end = millis(); + twixt(Mutex::acquire(widget.lock); Mutex::release(widget.lock)) { + if (widget.running) + Thread::send_signal(widget.timer, 0); + } + } + + protected void hide(&timer_t widget) { + widget.visible = false; + } + + protected void show(&timer_t widget) { + widget.visible = true; + } + + void outline (cairo_t cr, &timer_t widget) { + rectangle(cr, 0, 0, 0, 0); + } + + void natural (cairo_t cr, &timer_t widget) { + rectangle(cr, 0, 0, 100, 100); + } + + protected void init(*nichrome_t nichrome, &timer_t widget) { + Widget::init(nichrome, &widget); + widget.draw = draw; + widget.outline = outline; + widget.natural = natural; + widget.lock = Mutex::new(); + widget.running = false; + widget.visible = false; + } + + protected *timer_t new(*nichrome_t nichrome) { + &timer_t widget = &(timer_t) {}; + + init(nichrome, &widget); + return &widget; + } + } +} diff -Nru ricochet-0.6/ricochet-0.6/protocol ricochet-0.7/ricochet-0.6/protocol --- ricochet-0.6/ricochet-0.6/protocol 1970-01-01 00:00:00.000000000 +0000 +++ ricochet-0.7/ricochet-0.6/protocol 2012-03-13 18:35:47.000000000 +0000 @@ -0,0 +1,734 @@ + Ricochet Robots Game Protocol (RRGP) + Version 0.1.2 + 2003-5-31 + + Keith Packard Carl Worth + keithp@keithp.com carl@theworths.org + +Introduction + +RRGP is a network protocol for playing the Ricochet Robots game. It permits +a single server to host multiple games with named participants. The +protocol is designed so that people can play using only telnet, but it is +expected that graphical interfaces will be able to drive the protocol as +well. + +RRGP borrows ideas from other network protocols like SMTP using a +synchronous command interface. + +Document Conventions + + All commands include a response (yeah, synchronous protocols are + bad. tough) + + + + -> + + + + is one of: + + + ERROR + +1. Requests + +1.1 Connection setup + + The RRGP server has no well defined port; agreement on which port to + use must be done through some external mechanism. Once connected, + the client must identify itself: + + HELO [] + + -> + + HELO + + If the client doesn't supply , the server will compute + one and return it. + + Possible errors: INVALIDNAME + +1.2. Global commands + + 1.2.1 Listing available users + + WHO + + -> + + WHO ... + + lists connected users and the number of games they've won. + + 1.2.2. Listing available games + + GAMES + + -> + + GAMES ... + + 1.2.3. Message + + MESSAGE + + -> + + MESSAGE + + 1.2.4. Help + + HELP { } + + Displays help. If is provided, displays more + detailed help on a specific command, otherwise displays an + overview of all commands. + + 1.2.5. Quit + + QUIT + + -> + + QUIT + + 1.2.6. Version + + VERSION + + -> + + VERSION + + Negotiates version number between client and server. The server + will respond with a version no higher than the client version + number, but it may be lower. Version numbers are integers. + + This document describes protocol version 1. + +1.3. Game management commands + + 1.3.1. Listing players in a game + + PLAYERS + + -> + + PLAYERS ... + + Possible errors: NOGAME + + 1.3.2. Listing watchers of a game + + WATCHERS + + -> + + WATCERS ... + + Possible errors: NOGAME + + 1.3.3. Get game information + + GAMEINFO + + -> + + GAMEINFO