diff -Naurp gnome-games-1.4.0.4/Makefile.in gnome-games-1.4.0.4-cygwin/Makefile.in --- gnome-games-1.4.0.4/Makefile.in 2002-05-25 04:17:45.000000000 +0100 +++ gnome-games-1.4.0.4-cygwin/Makefile.in 2002-06-21 13:49:55.000000000 +0100 @@ -144,7 +144,7 @@ l = @l@ @CXX_PRESENT_TRUE@cxx_DIRS = gnometris xbill -SUBDIRS = intl po macros freecell gnomine same-gnome mahjongg gtali gnobots2 iagno gnotravex gnome-stones gnotski gnect $(guile_DIRS) $(cxx_DIRS) idl glines gataxx gnibbles omf-install +SUBDIRS = intl po macros freecell gnomine same-gnome mahjongg gtali gnobots2 gnotravex gnome-stones gnotski gnect $(guile_DIRS) $(cxx_DIRS) idl glines gataxx gnibbles omf-install #$(objc_DIRS) diff -Naurp gnome-games-1.4.0.4/aisleriot/Makefile.in gnome-games-1.4.0.4-cygwin/aisleriot/Makefile.in --- gnome-games-1.4.0.4/aisleriot/Makefile.in 2002-05-25 04:19:16.000000000 +0100 +++ gnome-games-1.4.0.4-cygwin/aisleriot/Makefile.in 2002-06-21 13:49:55.000000000 +0100 @@ -152,7 +152,7 @@ bin_PROGRAMS = sol sol_SOURCES = card.h cscmi.h scroll-menu.c scroll-menu.h dialog.h draw.h events.h menu.h press_data.h slot.h splash.h sol.h sol.c splash.c slot.c dialog.c cscmi.c events.c press_data.c draw.c menu.c card.c -sol_LDADD = -lgdk_imlib $(GNOME_LIBDIR) $(GNOMEUI_LIBS) ../freecell/gdk-card-image/libgdkcardimage.la $(INTLLIBS) $(GUILE_LIBS) $(GDK_PIXBUF_LIBS) +sol_LDADD = ../freecell/gdk-card-image/libgdkcardimage.la -lgdk_imlib $(GNOME_LIBDIR) $(GNOMEUI_LIBS) $(INTLLIBS) $(GUILE_LIBS) $(GDK_PIXBUF_LIBS) types_DATA = agnes.scm auld_lang_syne.scm bakers_dozen.scm bakers_game.scm beleaguered_castle.scm bristol.scm camelot.scm canfield.scm chessboard.scm clock.scm cover.scm diamond_mine.scm doublets.scm eagle_wing.scm easthaven.scm eight_off.scm elevator.scm escalator.scm first_law.scm fortress.scm fortunes.scm fourteen.scm freecell.scm gay_gordons.scm glenwood.scm golf.scm gypsy.scm helsinki.scm hopscotch.scm isabel.scm jamestown.scm jumbo.scm kansas.scm king_albert.scm klondike.scm labyrinth.scm lady_jane.scm maze.scm monte_carlo.scm neighbor.scm odessa.scm osmosis.scm peek.scm pileon.scm poker.scm quatorze.scm royal_east.scm scorpion.scm scuffle.scm seahaven.scm sir_tommy.scm sol.scm spider.scm spiderette.scm straight_up.scm streets_and_alleys.scm ten_across.scm thieves.scm thirteen.scm thumb_and_pouch.scm treize.scm union_square.scm valentine.scm westhaven.scm whitehead.scm will_o_the_wisp.scm yield.scm yukon.scm zebra.scm plait.scm diff -Naurp gnome-games-1.4.0.4/configure gnome-games-1.4.0.4-cygwin/configure --- gnome-games-1.4.0.4/configure 2002-05-25 04:17:21.000000000 +0100 +++ gnome-games-1.4.0.4-cygwin/configure 2002-06-21 13:49:55.000000000 +0100 @@ -3640,7 +3640,8 @@ EOF else $CC -o impgen impgen.c ; fi)~ $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def' - old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib' +# old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib' +old_archive_from_expsyms_cmds= # cygwin and mingw dlls have different entry points and sets of symbols # to exclude. @@ -5485,7 +5486,8 @@ old_postuninstall_cmds=$lt_old_postunins old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds +#old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds +old_archive_from_expsyms_cmds= # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds diff -Naurp gnome-games-1.4.0.4/gnect/src/connect4.c gnome-games-1.4.0.4-cygwin/gnect/src/connect4.c --- gnome-games-1.4.0.4/gnect/src/connect4.c 2001-12-20 13:24:43.000000000 +0000 +++ gnome-games-1.4.0.4-cygwin/gnect/src/connect4.c 2002-06-21 13:49:55.000000000 +0100 @@ -1,419 +1,419 @@ -/* -*-mode:c; c-style:k&r; c-basic-offset:4; -*- */ - - -/**************************************************************************** - * * - * Velena Source Code V1.0 * - * Written by Giuliano Bertoletti * - * Based on the knowledged approach of Louis Victor Allis * - * Copyright (C) 1996-97 by Giuliano Bertoletti & GBE 32241 Software PR * - * * - **************************************************************************** - - Portable engine version. - read the README file for further informations. - - ============================================================================ - - Changes have been made to this code for inclusion with Gnect. It is - released under the GNU General Public License with Giuliano's approval. - The original and complete Velena Engine source code can be found at: - - http://www.ce.unipr.it/~gbe/velena.html - -*/ - - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "connect4.h" -#include "pnsearch.h" -#include "proto.h" - -#include "config.h" -#include "main.h" -#include "gnect.h" - - -#define BLKSIZE 16384 /* Buffer size for I/O */ -#define PLAYER1 0 -#define PLAYER2 1 - - -extern gint debugging; /* gnect.c */ - - -struct board *brd; - - - - -void fatal_error(char *str) -{ - ERROR_PRINT("Velena Engine: %s\n", str); - gnect_cleanup(1); -} - - - -int my_random(unsigned short maxval) -{ - /* range: 0..maxval-1 */ - return( gnect_get_random_num(maxval) - 1 ); -} - - - -long fileln(FILE *f) -{ - long int save_pos, file_size; - - save_pos = ftell(f); - if(save_pos == -1) - return -1L; - fseek(f,0L,SEEK_END); - file_size = ftell(f); - fseek(f, save_pos,SEEK_SET); - - return file_size; -} - - - -short check_solution_groups(struct board *board) -{ - short x, y, z, q, c, answer = YES; - - for (y = 0; y < BOARDY && answer; y++) { - for (x = 0; x < BOARDX && answer; x++) { - for (z = 0; z < board->solvable_groups->sqpnt[ELM(x,y)] && answer; z++) { - answer = NO; - c = board->solvable_groups->square[ELM(x, y)][z]; - for (q = 0; q < TILES; q++) { - if (*board->groups[c][q] == ELM(x, y)) { - answer = YES; - } - } - } - } - } - return(answer); -} - - -/* Initialize the program data structures, it reads and builds (if needed) - * the opening book. - */ - -void init_prg(struct board *board) -{ - long size,len; - FILE *h1; - short x; - char *bookdata = g_strdup("/usr/share/gnect/" WHITE_BOOK); /* FIXME */ - - - if (!gnect_file_exists(bookdata)) { - ERROR_PRINT("required file not found (%s)\n", bookdata); - gnect_cleanup(1); - } - - brd = board; - - board->wins[PLAYER1] = 0; - board->wins[PLAYER2] = 0; - board->draws = 0; - board->lastguess = 0; - board->bestguess = MAXMEN; - board->lastwin = EMPTY; - - board->white_lev = 0; /* Human */ - board->black_lev = 3; /* Computer-Strong */ - board->videotype = CHARS; - board->enablegr = NO; - board->autotest = NO; - - for(x = 0; x < 3; x++) { - board->rule[x]=0L; - } - - board->oracle_guesses = 0; - - - h1=fopen(bookdata, "rb"); - if(!h1) { - ERROR_PRINT("could not open required file (%s)\n", bookdata); - gnect_cleanup(1); - } - - size = fileln(h1); - if (size%14 != 0) { - fatal_error("White opening book is corrupted"); - } - - board->wbposit = size/14; - - board->white_book = (unsigned char *)malloc(size); - if(!board->white_book) { - fatal_error("Not enough memory to allocate opening book"); - } - - len = 0; /* We read all the position from disk */ - while(size > 0) { /* each position takes 14 bytes of storage */ - fread(&board->white_book[len], 1, 14, h1); - len += 14; - size -= 14; - } - - fclose(h1); - - board->bbposit=0; -} - - - -void initboard(struct board *board) -{ - short x, y, i, j, p; - - /* randomize(); */ /* this is done in gnect.c:main */ - - for (i = 0; i < 10; i++) { - board->instances[i] = 0L; - } - - /* Groups initializations */ - - /* Step one. Horizontal lines. */ - - i = 0; - for (y = 0; y < BOARDY; y++) { - for (x = 0; x < BOARDX-3; x++) { - board->groups[i][0] = &board->square[ELM(x+0,y)]; - board->groups[i][1] = &board->square[ELM(x+1,y)]; - board->groups[i][2] = &board->square[ELM(x+2,y)]; - board->groups[i][3] = &board->square[ELM(x+3,y)]; - - board->xplace[i][0] = x; - board->xplace[i][1] = x+1; - board->xplace[i][2] = x+2; - board->xplace[i][3] = x+3; - - board->yplace[i][0] = y; - board->yplace[i][1] = y; - board->yplace[i][2] = y; - board->yplace[i][3] = y; - - i++; - } - } - - /* Step two. Vertical lines */ - - for (y = 0; y < BOARDY-3; y++) { - for (x = 0; x < BOARDX; x++) { - board->groups[i][0] = &board->square[ELM(x,y+0)]; - board->groups[i][1] = &board->square[ELM(x,y+1)]; - board->groups[i][2] = &board->square[ELM(x,y+2)]; - board->groups[i][3] = &board->square[ELM(x,y+3)]; - - board->xplace[i][0] = x; - board->xplace[i][1] = x; - board->xplace[i][2] = x; - board->xplace[i][3] = x; - - board->yplace[i][0] = y+0; - board->yplace[i][1] = y+1; - board->yplace[i][2] = y+2; - board->yplace[i][3] = y+3; - - i++; - } - } - - /* Step three. Diagonal (north east) lines */ - - for (y = 0; y < BOARDY-3; y++) { - for (x = 0; x < BOARDX-3; x++) { - board->groups[i][0] = &board->square[ELM(x+0,y+0)]; - board->groups[i][1] = &board->square[ELM(x+1,y+1)]; - board->groups[i][2] = &board->square[ELM(x+2,y+2)]; - board->groups[i][3] = &board->square[ELM(x+3,y+3)]; - - board->xplace[i][0] = x+0; - board->xplace[i][1] = x+1; - board->xplace[i][2] = x+2; - board->xplace[i][3] = x+3; - - board->yplace[i][0] = y+0; - board->yplace[i][1] = y+1; - board->yplace[i][2] = y+2; - board->yplace[i][3] = y+3; - - i++; - } - } - - /* Step four. Diagonal (south east) lines */ - - for (y = 3; y < BOARDY; y++) { - for (x = 0; x < BOARDX-3; x++) { - board->groups[i][0] = &board->square[ELM(x+0,y-0)]; - board->groups[i][1] = &board->square[ELM(x+1,y-1)]; - board->groups[i][2] = &board->square[ELM(x+2,y-2)]; - board->groups[i][3] = &board->square[ELM(x+3,y-3)]; - - board->xplace[i][0] = x+0; - board->xplace[i][1] = x+1; - board->xplace[i][2] = x+2; - board->xplace[i][3] = x+3; - - board->yplace[i][0] = y-0; - board->yplace[i][1] = y-1; - board->yplace[i][2] = y-2; - board->yplace[i][3] = y-3; - - i++; - } - } - - if (i != GROUPS) { - fatal_error("Implementation error!"); - } - - for (x = 0; x < 64; x++) { - board->solvable_groups->sqpnt[x] = 0; - for (y = 0; y < 16; y++) { - board->solvable_groups->square[x][y] = -1; - } - } - - for (x = 0; x < BOARDX; x++) { - for (y = 0; y < BOARDY; y++) { - board->square[ELM(x,y)] = ELM(x, y); - } - } - - for (i = 0; i < GROUPS; i++) { - for (j = 0; j < TILES; j++) { - p = *board->groups[i][j]; - board->solvable_groups->square[p][board->solvable_groups->sqpnt[p]++] = i; - } - } - - if (!check_solution_groups(board)) { - fatal_error("Implementation error!"); - } - - /* Here we set all out squares to a default value to detect problems */ - - for (i = 0; i < 8; i++) { - board->square[ELM(7,i)] = FULL; - board->square[ELM(i,6)] = board->square[ELM(i,7)] = FULL; - } - - board->stack[7] = FULL; - - for (y = 0; y < BOARDY; y++) { - for (x = 0; x < BOARDX; x++) { - board->square[ELM(x,y)] = EMPTY; - } - } - - for (x = 0; x < BOARDX; x++) { - board->stack[x] = 0; - } - - board->turn = WHITE; - board->filled = 0; - board->cpu = 0x01; - - return; -} - - - -void initTitle(void) -{ - g_print("\nVelena Engine %s; revision %s\n", SEARCH_ENGINE_VERSION, __DATE__); - g_print("\nAI engine written by Giuliano Bertoletti\n"); - g_print("Based on the knowledged approach of Victor Allis\n"); - g_print("Copyright (C) 1996-97 Giuliano Bertoletti "); - g_print("and GBE 32241 Software PR.\n"); - g_print("All rights reserved.\n\n"); -} - - - -struct board *veleng_init(void) -{ - short x; - struct board *board; - - /* Here we initialize our environment and the call - * command_line_input in file cmdline.c to process data from the - * outside world. - */ - - - initTitle(); - - fight(NO); - - brd = NULL; - board = (struct board *)malloc(sizeof(struct board)); - if(!board) { - fatal_error("Cannot allocate memory!"); - } - - board->solvable_groups = (struct solvable_groups *)malloc(sizeof(struct solvable_groups)); - if(!board->solvable_groups) { - fatal_error("Cannot allocate memory!"); - } - - board->debug = 0; - - init_prg(board); /* Initialize data structures */ - - for (x = 0; x < ALLOC_SOLUTIONS; x++) { - board->solution[x] = (struct solution *)malloc(sizeof(struct solution)); - if (!board->solution[x]) { - fatal_error("Not enough memory for solutions"); - } - } - - board->usegraphics = NO; - - return(board); -} - - - -void veleng_free(struct board *board) -{ - int x; - - - DEBUG_PRINT(1, "veleng_free\n"); - - if (board != NULL) { - - for (x = 0; x < ALLOC_SOLUTIONS; x++) { - if(board->solution[x] != NULL) { - free(board->solution[x]); - } - } - - free(board->solvable_groups); - free(board); - - } - -} +/* -*-mode:c; c-style:k&r; c-basic-offset:4; -*- */ + + +/**************************************************************************** + * * + * Velena Source Code V1.0 * + * Written by Giuliano Bertoletti * + * Based on the knowledged approach of Louis Victor Allis * + * Copyright (C) 1996-97 by Giuliano Bertoletti & GBE 32241 Software PR * + * * + **************************************************************************** + + Portable engine version. + read the README file for further informations. + + ============================================================================ + + Changes have been made to this code for inclusion with Gnect. It is + released under the GNU General Public License with Giuliano's approval. + The original and complete Velena Engine source code can be found at: + + http://www.ce.unipr.it/~gbe/velena.html + +*/ + + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "connect4.h" +#include "pnsearch.h" +#include "proto.h" + +#include "config.h" +#include "main.h" +#include "gnect.h" + + +#define BLKSIZE 16384 /* Buffer size for I/O */ +#define PLAYER1 0 +#define PLAYER2 1 + + +extern gint debugging; /* gnect.c */ + + +struct board *brd; + + + + +void fatal_error(char *str) +{ + ERROR_PRINT("Velena Engine: %s\n", str); + gnect_cleanup(1); +} + + + +int my_random(unsigned short maxval) +{ + /* range: 0..maxval-1 */ + return( gnect_get_random_num(maxval) - 1 ); +} + + + +long fileln(FILE *f) +{ + long int save_pos, file_size; + + save_pos = ftell(f); + if(save_pos == -1) + return -1L; + fseek(f,0L,SEEK_END); + file_size = ftell(f); + fseek(f, save_pos,SEEK_SET); + + return file_size; +} + + + +short check_solution_groups(struct board *board) +{ + short x, y, z, q, c, answer = YES; + + for (y = 0; y < BOARDY && answer; y++) { + for (x = 0; x < BOARDX && answer; x++) { + for (z = 0; z < board->solvable_groups->sqpnt[ELM(x,y)] && answer; z++) { + answer = NO; + c = board->solvable_groups->square[ELM(x, y)][z]; + for (q = 0; q < TILES; q++) { + if (*board->groups[c][q] == ELM(x, y)) { + answer = YES; + } + } + } + } + } + return(answer); +} + + +/* Initialize the program data structures, it reads and builds (if needed) + * the opening book. + */ + +void init_prg(struct board *board) +{ + long size,len; + FILE *h1; + short x; + char *bookdata = g_strdup(GNECT_DATA_DIR "gnect/" WHITE_BOOK); /* FIXME */ + + + if (!gnect_file_exists(bookdata)) { + ERROR_PRINT("required file not found (%s)\n", bookdata); + gnect_cleanup(1); + } + + brd = board; + + board->wins[PLAYER1] = 0; + board->wins[PLAYER2] = 0; + board->draws = 0; + board->lastguess = 0; + board->bestguess = MAXMEN; + board->lastwin = EMPTY; + + board->white_lev = 0; /* Human */ + board->black_lev = 3; /* Computer-Strong */ + board->videotype = CHARS; + board->enablegr = NO; + board->autotest = NO; + + for(x = 0; x < 3; x++) { + board->rule[x]=0L; + } + + board->oracle_guesses = 0; + + + h1=fopen(bookdata, "rb"); + if(!h1) { + ERROR_PRINT("could not open required file (%s)\n", bookdata); + gnect_cleanup(1); + } + + size = fileln(h1); + if (size%14 != 0) { + fatal_error("White opening book is corrupted"); + } + + board->wbposit = size/14; + + board->white_book = (unsigned char *)malloc(size); + if(!board->white_book) { + fatal_error("Not enough memory to allocate opening book"); + } + + len = 0; /* We read all the position from disk */ + while(size > 0) { /* each position takes 14 bytes of storage */ + fread(&board->white_book[len], 1, 14, h1); + len += 14; + size -= 14; + } + + fclose(h1); + + board->bbposit=0; +} + + + +void initboard(struct board *board) +{ + short x, y, i, j, p; + + /* randomize(); */ /* this is done in gnect.c:main */ + + for (i = 0; i < 10; i++) { + board->instances[i] = 0L; + } + + /* Groups initializations */ + + /* Step one. Horizontal lines. */ + + i = 0; + for (y = 0; y < BOARDY; y++) { + for (x = 0; x < BOARDX-3; x++) { + board->groups[i][0] = &board->square[ELM(x+0,y)]; + board->groups[i][1] = &board->square[ELM(x+1,y)]; + board->groups[i][2] = &board->square[ELM(x+2,y)]; + board->groups[i][3] = &board->square[ELM(x+3,y)]; + + board->xplace[i][0] = x; + board->xplace[i][1] = x+1; + board->xplace[i][2] = x+2; + board->xplace[i][3] = x+3; + + board->yplace[i][0] = y; + board->yplace[i][1] = y; + board->yplace[i][2] = y; + board->yplace[i][3] = y; + + i++; + } + } + + /* Step two. Vertical lines */ + + for (y = 0; y < BOARDY-3; y++) { + for (x = 0; x < BOARDX; x++) { + board->groups[i][0] = &board->square[ELM(x,y+0)]; + board->groups[i][1] = &board->square[ELM(x,y+1)]; + board->groups[i][2] = &board->square[ELM(x,y+2)]; + board->groups[i][3] = &board->square[ELM(x,y+3)]; + + board->xplace[i][0] = x; + board->xplace[i][1] = x; + board->xplace[i][2] = x; + board->xplace[i][3] = x; + + board->yplace[i][0] = y+0; + board->yplace[i][1] = y+1; + board->yplace[i][2] = y+2; + board->yplace[i][3] = y+3; + + i++; + } + } + + /* Step three. Diagonal (north east) lines */ + + for (y = 0; y < BOARDY-3; y++) { + for (x = 0; x < BOARDX-3; x++) { + board->groups[i][0] = &board->square[ELM(x+0,y+0)]; + board->groups[i][1] = &board->square[ELM(x+1,y+1)]; + board->groups[i][2] = &board->square[ELM(x+2,y+2)]; + board->groups[i][3] = &board->square[ELM(x+3,y+3)]; + + board->xplace[i][0] = x+0; + board->xplace[i][1] = x+1; + board->xplace[i][2] = x+2; + board->xplace[i][3] = x+3; + + board->yplace[i][0] = y+0; + board->yplace[i][1] = y+1; + board->yplace[i][2] = y+2; + board->yplace[i][3] = y+3; + + i++; + } + } + + /* Step four. Diagonal (south east) lines */ + + for (y = 3; y < BOARDY; y++) { + for (x = 0; x < BOARDX-3; x++) { + board->groups[i][0] = &board->square[ELM(x+0,y-0)]; + board->groups[i][1] = &board->square[ELM(x+1,y-1)]; + board->groups[i][2] = &board->square[ELM(x+2,y-2)]; + board->groups[i][3] = &board->square[ELM(x+3,y-3)]; + + board->xplace[i][0] = x+0; + board->xplace[i][1] = x+1; + board->xplace[i][2] = x+2; + board->xplace[i][3] = x+3; + + board->yplace[i][0] = y-0; + board->yplace[i][1] = y-1; + board->yplace[i][2] = y-2; + board->yplace[i][3] = y-3; + + i++; + } + } + + if (i != GROUPS) { + fatal_error("Implementation error!"); + } + + for (x = 0; x < 64; x++) { + board->solvable_groups->sqpnt[x] = 0; + for (y = 0; y < 16; y++) { + board->solvable_groups->square[x][y] = -1; + } + } + + for (x = 0; x < BOARDX; x++) { + for (y = 0; y < BOARDY; y++) { + board->square[ELM(x,y)] = ELM(x, y); + } + } + + for (i = 0; i < GROUPS; i++) { + for (j = 0; j < TILES; j++) { + p = *board->groups[i][j]; + board->solvable_groups->square[p][board->solvable_groups->sqpnt[p]++] = i; + } + } + + if (!check_solution_groups(board)) { + fatal_error("Implementation error!"); + } + + /* Here we set all out squares to a default value to detect problems */ + + for (i = 0; i < 8; i++) { + board->square[ELM(7,i)] = FULL; + board->square[ELM(i,6)] = board->square[ELM(i,7)] = FULL; + } + + board->stack[7] = FULL; + + for (y = 0; y < BOARDY; y++) { + for (x = 0; x < BOARDX; x++) { + board->square[ELM(x,y)] = EMPTY; + } + } + + for (x = 0; x < BOARDX; x++) { + board->stack[x] = 0; + } + + board->turn = WHITE; + board->filled = 0; + board->cpu = 0x01; + + return; +} + + + +void initTitle(void) +{ + g_print("\nVelena Engine %s; revision %s\n", SEARCH_ENGINE_VERSION, __DATE__); + g_print("\nAI engine written by Giuliano Bertoletti\n"); + g_print("Based on the knowledged approach of Victor Allis\n"); + g_print("Copyright (C) 1996-97 Giuliano Bertoletti "); + g_print("and GBE 32241 Software PR.\n"); + g_print("All rights reserved.\n\n"); +} + + + +struct board *veleng_init(void) +{ + short x; + struct board *board; + + /* Here we initialize our environment and the call + * command_line_input in file cmdline.c to process data from the + * outside world. + */ + + + initTitle(); + + fight(NO); + + brd = NULL; + board = (struct board *)malloc(sizeof(struct board)); + if(!board) { + fatal_error("Cannot allocate memory!"); + } + + board->solvable_groups = (struct solvable_groups *)malloc(sizeof(struct solvable_groups)); + if(!board->solvable_groups) { + fatal_error("Cannot allocate memory!"); + } + + board->debug = 0; + + init_prg(board); /* Initialize data structures */ + + for (x = 0; x < ALLOC_SOLUTIONS; x++) { + board->solution[x] = (struct solution *)malloc(sizeof(struct solution)); + if (!board->solution[x]) { + fatal_error("Not enough memory for solutions"); + } + } + + board->usegraphics = NO; + + return(board); +} + + + +void veleng_free(struct board *board) +{ + int x; + + + DEBUG_PRINT(1, "veleng_free\n"); + + if (board != NULL) { + + for (x = 0; x < ALLOC_SOLUTIONS; x++) { + if(board->solution[x] != NULL) { + free(board->solution[x]); + } + } + + free(board->solvable_groups); + free(board); + + } + +} diff -Naurp gnome-games-1.4.0.4/gnome-stones/Makefile.in gnome-games-1.4.0.4-cygwin/gnome-stones/Makefile.in --- gnome-games-1.4.0.4/gnome-stones/Makefile.in 2002-05-25 04:19:11.000000000 +0100 +++ gnome-games-1.4.0.4-cygwin/gnome-stones/Makefile.in 2002-06-21 13:50:15.000000000 +0100 @@ -197,6 +197,7 @@ GZIP_ENV = --best SOURCES = $(gnome_stones_SOURCES) OBJECTS = $(gnome_stones_OBJECTS) +all install: libmain.a all: all-redirect .SUFFIXES: .SUFFIXES: .S .c .lo .o .obj .s @@ -277,9 +278,16 @@ distclean-libtool: maintainer-clean-libtool: -gnome-stones$(EXEEXT): $(gnome_stones_OBJECTS) $(gnome_stones_DEPENDENCIES) +libmain.a: gnome-stones$(EXEEXT) +gnome-stones$(EXEEXT): $(gnome_stones_OBJECTS) $(gnome_stones_DEPENDENCIES) gnome-stones.def @rm -f gnome-stones$(EXEEXT) - $(LINK) $(gnome_stones_LDFLAGS) $(gnome_stones_OBJECTS) $(gnome_stones_LDADD) $(LIBS) +# $(LINK) $(gnome_stones_LDFLAGS) $(gnome_stones_OBJECTS) $(gnome_stones_LDADD) $(LIBS) + gcc $(gnome_stones_LDFLAGS) -Wl,--base-file,gnome-stones.base $(gnome_stones_OBJECTS) $(gnome_stones_LDADD) $(LIBS) + dlltool --base-file gnome-stones.base --input-def gnome-stones.def --output-exp gnome-stones.exp + gcc $(gnome_stones_LDFLAGS) -Wl,--base-file,gnome-stones.base,gnome-stones.exp $(gnome_stones_OBJECTS) $(gnome_stones_LDADD) $(LIBS) + dlltool --base-file gnome-stones.base --input-def gnome-stones.def --output-exp gnome-stones.exp + gcc $(gnome_stones_LDFLAGS) -Wl,gnome-stones.exp -o $@ $(gnome_stones_OBJECTS) $(gnome_stones_LDADD) $(LIBS) + dlltool --dllname $@ --input-def gnome-stones.def --output-lib libmain.a $(gnome_stones_OBJECTS) install-CavesDATA: $(Caves_DATA) @$(NORMAL_INSTALL) diff -Naurp gnome-games-1.4.0.4/gnome-stones/gnome-stones.def gnome-games-1.4.0.4-cygwin/gnome-stones/gnome-stones.def --- gnome-games-1.4.0.4/gnome-stones/gnome-stones.def 1970-01-01 00:00:00.000000000 +0000 +++ gnome-games-1.4.0.4-cygwin/gnome-stones/gnome-stones.def 2002-06-21 13:49:55.000000000 +0100 @@ -0,0 +1,47 @@ +EXPORTS +object_register +object_find_object_by_name +object_get_image +object_get_pixbuf_image +object_get_fullname +object_context_new +object_context_free +object_context_set_private_data +object_context_private_data +object_context_set_option +object_context_get_string_option +object_context_get_bool_option +object_context_get_int_option +object_context_get_float_option +gstones_signal +cave_new +cave_free +cave_add_object +cave_remove_object +cave_object_removable +cave_set_player +cave_iterate +cave_toggle_pause_mode +cave_player_die +cave_start +cave_emit_signal +cave_time_to_frames +cave_set_entry +cave_get_image +cave_get_pixbuf_image +cave_get_string_object_option +cave_get_bool_object_option +cave_get_int_object_option +cave_set_object_option +game_new +game_free +game_add_plugin +gstones_game_load +gstones_cave_load +player_new +player_free +player_inc_score +player_inc_lives +player_set_diamonds +player_set_time +player_set_max_time diff -Naurp gnome-games-1.4.0.4/gnome-stones/object.c gnome-games-1.4.0.4-cygwin/gnome-stones/object.c --- gnome-games-1.4.0.4/gnome-stones/object.c 2001-07-08 10:00:27.000000000 +0100 +++ gnome-games-1.4.0.4-cygwin/gnome-stones/object.c 2002-06-21 13:50:34.000000000 +0100 @@ -97,7 +97,7 @@ plugin_load (const gchar *filename) plugin->handle= g_module_open (filename, 0); if (!plugin->handle) { - printf ("Unable to open module file: %s\n", g_module_error()); + printf ("Unable to open module file: %s %s\n", filename, g_module_error()); g_free (plugin); return NULL; } @@ -134,8 +134,13 @@ plugin_load_plugins_in_dir (const gchar while ((e = readdir (d)) != NULL) { +#ifndef __CYGWIN__ if ((strlen (e->d_name) > 3) && (strncmp (e->d_name + strlen (e->d_name) - 3, ".so", 3) == 0)) +#else + if ((strlen (e->d_name) > 4) && + (strncmp (e->d_name + strlen (e->d_name) - 4, ".dll", 4) == 0)) +#endif { char *objects_name; diff -Naurp gnome-games-1.4.0.4/gnome-stones/objects/Makefile.in gnome-games-1.4.0.4-cygwin/gnome-stones/objects/Makefile.in --- gnome-games-1.4.0.4/gnome-stones/objects/Makefile.in 2002-05-25 04:19:11.000000000 +0100 +++ gnome-games-1.4.0.4-cygwin/gnome-stones/objects/Makefile.in 2002-06-21 13:50:50.000000000 +0100 @@ -257,9 +257,11 @@ maintainer-clean-libtool: libgnome-stones.la: $(libgnome_stones_la_OBJECTS) $(libgnome_stones_la_DEPENDENCIES) $(LINK) -rpath $(objectdir) $(libgnome_stones_la_LDFLAGS) $(libgnome_stones_la_OBJECTS) $(libgnome_stones_la_LIBADD) $(LIBS) + PREFIX=$(prefix) DLDIR=":" sh $(top_srcdir)/mkdll.sh $@ ../libmain.a $$(glib-config --libs) libgnomekoban.la: $(libgnomekoban_la_OBJECTS) $(libgnomekoban_la_DEPENDENCIES) $(LINK) -rpath $(objectdir) $(libgnomekoban_la_LDFLAGS) $(libgnomekoban_la_OBJECTS) $(libgnomekoban_la_LIBADD) $(LIBS) + PREFIX=$(prefix) DLDIR=":" sh $(top_srcdir)/mkdll.sh $@ ../libmain.a $$(glib-config --libs) tags: TAGS diff -Naurp gnome-games-1.4.0.4/gnotski/Makefile.in gnome-games-1.4.0.4-cygwin/gnotski/Makefile.in --- gnome-games-1.4.0.4/gnotski/Makefile.in 2002-05-25 04:19:13.000000000 +0100 +++ gnome-games-1.4.0.4/gnotski-cygwin/Makefile.in 2002-07-09 15:24:37.000000000 +0100 @@ -136,7 +136,7 @@ XPM_LIBS = @XPM_LIBS@ ZVT_LIBS = @ZVT_LIBS@ l = @l@ -scoredir = $(DESTDIR)$(localstatedir)/games +scoredir = $(localstatedir)/games pixmapdir = $(datadir)/pixmaps Gamesdir = $(datadir)/gnome/apps/Games @@ -433,66 +433,66 @@ mostlyclean distclean maintainer-clean install-data-local: -$(mkinstalldirs) $(DESTDIR)$(scoredir) -chgrp games $(DESTDIR)$(bindir)/gnotski && chmod 2111 $(DESTDIR)$(bindir)/gnotski - -touch $(scoredir)/gnotski.1.scores - -chown games.games $(scoredir)/gnotski.1.scores - -chmod 664 $(scoredir)/gnotski.1.scores - -touch $(scoredir)/gnotski.2.scores - -chown games.games $(scoredir)/gnotski.2.scores - -chmod 664 $(scoredir)/gnotski.2.scores - -touch $(scoredir)/gnotski.3.scores - -chown games.games $(scoredir)/gnotski.3.scores - -chmod 664 $(scoredir)/gnotski.3.scores - -touch $(scoredir)/gnotski.4.scores - -chown games.games $(scoredir)/gnotski.4.scores - -chmod 664 $(scoredir)/gnotski.4.scores - -touch $(scoredir)/gnotski.5.scores - -chown games.games $(scoredir)/gnotski.5.scores - -chmod 664 $(scoredir)/gnotski.5.scores - -touch $(scoredir)/gnotski.6.scores - -chown games.games $(scoredir)/gnotski.6.scores - -chmod 664 $(scoredir)/gnotski.6.scores - -touch $(scoredir)/gnotski.7.scores - -chown games.games $(scoredir)/gnotski.7.scores - -chmod 664 $(scoredir)/gnotski.7.scores - -touch $(scoredir)/gnotski.11.scores - -chown games.games $(scoredir)/gnotski.11.scores - -chmod 664 $(scoredir)/gnotski.11.scores - -touch $(scoredir)/gnotski.12.scores - -chown games.games $(scoredir)/gnotski.12.scores - -chmod 664 $(scoredir)/gnotski.12.scores - -touch $(scoredir)/gnotski.13.scores - -chown games.games $(scoredir)/gnotski.13.scores - -chmod 664 $(scoredir)/gnotski.13.scores - -touch $(scoredir)/gnotski.14.scores - -chown games.games $(scoredir)/gnotski.14.scores - -chmod 664 $(scoredir)/gnotski.14.scores - -touch $(scoredir)/gnotski.15.scores - -chown games.games $(scoredir)/gnotski.15.scores - -chmod 664 $(scoredir)/gnotski.15.scores - -touch $(scoredir)/gnotski.16.scores - -chown games.games $(scoredir)/gnotski.16.scores - -chmod 664 $(scoredir)/gnotski.16.scores - -touch $(scoredir)/gnotski.17.scores - -chown games.games $(scoredir)/gnotski.17.scores - -chmod 664 $(scoredir)/gnotski.17.scores - -touch $(scoredir)/gnotski.21.scores - -chown games.games $(scoredir)/gnotski.21.scores - -chmod 664 $(scoredir)/gnotski.21.scores - -touch $(scoredir)/gnotski.22.scores - -chown games.games $(scoredir)/gnotski.22.scores - -chmod 664 $(scoredir)/gnotski.22.scores - -touch $(scoredir)/gnotski.23.scores - -chown games.games $(scoredir)/gnotski.23.scores - -chmod 664 $(scoredir)/gnotski.23.scores - -touch $(scoredir)/gnotski.24.scores - -chown games.games $(scoredir)/gnotski.24.scores - -chmod 664 $(scoredir)/gnotski.24.scores - -touch $(scoredir)/gnotski.25.scores - -chown games.games $(scoredir)/gnotski.25.scores - -chmod 664 $(scoredir)/gnotski.25.scores - -touch $(scoredir)/gnotski.26.scores - -chown games.games $(scoredir)/gnotski.26.scores - -chmod 664 $(scoredir)/gnotski.26.scores + -touch $(DESTDIR)$(scoredir)/gnotski.1.scores + -chown games.games $(DESTDIR)$(scoredir)/gnotski.1.scores + -chmod 664 $(DESTDIR)$(scoredir)/gnotski.1.scores + -touch $(DESTDIR)$(scoredir)/gnotski.2.scores + -chown games.games $(DESTDIR)$(scoredir)/gnotski.2.scores + -chmod 664 $(DESTDIR)$(scoredir)/gnotski.2.scores + -touch $(DESTDIR)$(scoredir)/gnotski.3.scores + -chown games.games $(DESTDIR)$(scoredir)/gnotski.3.scores + -chmod 664 $(DESTDIR)$(scoredir)/gnotski.3.scores + -touch $(DESTDIR)$(scoredir)/gnotski.4.scores + -chown games.games $(DESTDIR)$(scoredir)/gnotski.4.scores + -chmod 664 $(DESTDIR)$(scoredir)/gnotski.4.scores + -touch $(DESTDIR)$(scoredir)/gnotski.5.scores + -chown games.games $(DESTDIR)$(scoredir)/gnotski.5.scores + -chmod 664 $(DESTDIR)$(scoredir)/gnotski.5.scores + -touch $(DESTDIR)$(scoredir)/gnotski.6.scores + -chown games.games $(DESTDIR)$(scoredir)/gnotski.6.scores + -chmod 664 $(DESTDIR)$(scoredir)/gnotski.6.scores + -touch $(DESTDIR)$(scoredir)/gnotski.7.scores + -chown games.games $(DESTDIR)$(scoredir)/gnotski.7.scores + -chmod 664 $(DESTDIR)$(scoredir)/gnotski.7.scores + -touch $(DESTDIR)$(scoredir)/gnotski.11.scores + -chown games.games $(DESTDIR)$(scoredir)/gnotski.11.scores + -chmod 664 $(DESTDIR)$(scoredir)/gnotski.11.scores + -touch $(DESTDIR)$(scoredir)/gnotski.12.scores + -chown games.games $(DESTDIR)$(scoredir)/gnotski.12.scores + -chmod 664 $(DESTDIR)$(scoredir)/gnotski.12.scores + -touch $(DESTDIR)$(scoredir)/gnotski.13.scores + -chown games.games $(DESTDIR)$(scoredir)/gnotski.13.scores + -chmod 664 $(DESTDIR)$(scoredir)/gnotski.13.scores + -touch $(DESTDIR)$(scoredir)/gnotski.14.scores + -chown games.games $(DESTDIR)$(scoredir)/gnotski.14.scores + -chmod 664 $(DESTDIR)$(scoredir)/gnotski.14.scores + -touch $(DESTDIR)$(scoredir)/gnotski.15.scores + -chown games.games $(DESTDIR)$(scoredir)/gnotski.15.scores + -chmod 664 $(DESTDIR)$(scoredir)/gnotski.15.scores + -touch $(DESTDIR)$(scoredir)/gnotski.16.scores + -chown games.games $(DESTDIR)$(scoredir)/gnotski.16.scores + -chmod 664 $(DESTDIR)$(scoredir)/gnotski.16.scores + -touch $(DESTDIR)$(scoredir)/gnotski.17.scores + -chown games.games $(DESTDIR)$(scoredir)/gnotski.17.scores + -chmod 664 $(DESTDIR)$(scoredir)/gnotski.17.scores + -touch $(DESTDIR)$(scoredir)/gnotski.21.scores + -chown games.games $(DESTDIR)$(scoredir)/gnotski.21.scores + -chmod 664 $(DESTDIR)$(scoredir)/gnotski.21.scores + -touch $(DESTDIR)$(scoredir)/gnotski.22.scores + -chown games.games $(DESTDIR)$(scoredir)/gnotski.22.scores + -chmod 664 $(DESTDIR)$(scoredir)/gnotski.22.scores + -touch $(DESTDIR)$(scoredir)/gnotski.23.scores + -chown games.games $(DESTDIR)$(scoredir)/gnotski.23.scores + -chmod 664 $(DESTDIR)$(scoredir)/gnotski.23.scores + -touch $(DESTDIR)$(scoredir)/gnotski.24.scores + -chown games.games $(DESTDIR)$(scoredir)/gnotski.24.scores + -chmod 664 $(DESTDIR)$(scoredir)/gnotski.24.scores + -touch $(DESTDIR)$(scoredir)/gnotski.25.scores + -chown games.games $(DESTDIR)$(scoredir)/gnotski.25.scores + -chmod 664 $(DESTDIR)$(scoredir)/gnotski.25.scores + -touch $(DESTDIR)$(scoredir)/gnotski.26.scores + -chown games.games $(DESTDIR)$(scoredir)/gnotski.26.scores + -chmod 664 $(DESTDIR)$(scoredir)/gnotski.26.scores # 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. diff -Naurp gnome-games-1.4.0.4/mkdll.sh gnome-games-1.4.0.4-cygwin/mkdll.sh --- gnome-games-1.4.0.4/mkdll.sh 1970-01-01 00:00:00.000000000 +0000 +++ gnome-games-1.4.0.4-cygwin/mkdll.sh 2002-06-21 13:49:55.000000000 +0100 @@ -0,0 +1,99 @@ +#!/bin/sh + +# script to generate dll from libtool-generated static archive (.la file) +# invoke with: +# mkdll.sh +# eg: +# mkdll.sh libtest.la -L/usr/local/lib -llocal + +# defaults to using gcc for libraries written in C. +# set the CC env var to use a different compiler driver: eg +# export CC=g++ +# for C++ libraries + +# defaults to using /usr/local as the installation PREFIX +# override this by setting the PREFIX env var: eg +# export PREFIX=/opt/gnome + +archive=$1 +test -f $archive || { echo $(basename $0): $archive not found; exit 1; } + +module=$(echo $(basename $archive) | sed -e 's,^lib,,' -e 's,.la$,,') + +shift +dependency_libs="$@" + +test -n "$CC" || CC=gcc +prefix=${PREFIX:=/usr/local} +case "$DLDIR" in + :) dldir= + ;; + "") dldir=../bin/ + ;; + *) dldir=$DLDIR + ;; +esac +case "$DLPREFIX" in + :) dlprefix= + ;; + "") dlprefix=cyg + ;; + *) dlprefix=$DLPREFIX + ;; +esac +case "$LIBPREFIX" in + :) libprefix= + ;; + "") libprefix=lib + ;; + *) libprefix=$LIBPREFIX + ;; +esac + +# get the static library name +# first look in the .la archive +old_lib=$(sed -ne '/^old_library=/ s,^old_library='\''\(.*\)'\''.*$,\1,p' .libs/$archive) +# if not there, use default name +test -n "$old_lib" || old_lib=${libprefix}${module}.a + + + +# update the archive with the dll and import lib name; fix install dir; remove relink command +# (${prefix}/lib is hard-coded here - edit it if necessary) +libdir=${prefix}/lib +if sed -e 's,^dlname='\'\'',dlname='\'${dlprefix}${module}.dll\'',' \ + -e 's,^library_names='\'\'',library_names='\'${libprefix}${module}.dll.a\'',' \ + -e 's,^libdir='\'\'',libdir='\'$libdir\'',' \ + -e 's,^relink_command=.*$,,' \ + .libs/$archive > .libs/${archive}.tmp +then cat .libs/${archive}.tmp > .libs/${archive} +fi +rm -f .libs/${archive}.tmp + +# update the install archive if it exists +if [ -f .libs/${archive}i ] ; then + if sed -e 's,^dlname='\'\'',dlname='\'${dldir}${dlprefix}${module}.dll\'',' \ + -e 's,^library_names='\'\'',library_names='\'${libprefix}${module}.dll.a\'',' \ + -e 's,^relink_command=.*$,,' \ + .libs/${archive}i > .libs/${archive}i.tmp + then cat .libs/${archive}i.tmp > .libs/${archive}i + fi + rm -f .libs/${archive}i.tmp +fi + + +# report the link command to stdout +eval echo $CC -shared -o .libs/${dlprefix}${module}.dll -Wl,--out-implib=.libs/${libprefix}${module}.dll.a \ +-Wl,--export-all-symbols -Wl,--whole-archive .libs/$old_lib -Wl,--no-whole-archive ${dependency_libs} + +# do the link command - if it fails, remove archive so make knows to re-build it +eval $CC -shared -o .libs/${dlprefix}${module}.dll -Wl,--out-implib=.libs/${libprefix}${module}.dll.a -Wl,--export-all-symbols \ +-Wl,--whole-archive .libs/$old_lib -Wl,--no-whole-archive ${dependency_libs} || { rm -f $archive; false; } +ret=$? + +# copy the .dll.a file to .dll.aT to keep libtool happy +rm -f .libs/${libprefix}${module}.dll.aT +ln .libs/${libprefix}${module}.dll.a .libs/${libprefix}${module}.dll.aT + +echo ret = $ret +exit $ret diff -Naurp gnome-games-1.4.0.4/xbill/Makefile.in gnome-games-1.4.0.4-cygwin/xbill/Makefile.in --- gnome-games-1.4.0.4/xbill/Makefile.in 2002-05-25 04:19:20.000000000 +0100 +++ gnome-games-1.4.0.4-cygwin/xbill/Makefile.in 2002-06-21 13:49:55.000000000 +0100 @@ -141,7 +141,7 @@ SUBDIRS = pixmaps cursors # This is where the high score file goes ... scoredir = $(localstatedir)/games -INCLUDES = $(GNOME_INCLUDEDIR) -DGNOMELOCALEDIR=\""$(datadir)/locale"\" +INCLUDES = $(GNOME_INCLUDEDIR) -DGNOMELOCALEDIR=\""$(datadir)/locale"\" -I$(prefix)/include bin_PROGRAMS = gnome-xbill gnome_xbill_SOURCES = Bucket.cc Bucket.h Cable.cc Cable.h Computer.cc Computer.h Game.cc Game.h Horde.cc Horde.h Library.cc Library.h MCursor.cc MCursor.h Monster.cc Monster.h Network.cc Network.h Picture.cc Picture.h Spark.cc Spark.h Strings.h UI.cc UI.h objects.h x11-gtk.cc x11.h