Index: engine/gnugo.h
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/gnugo.h,v
retrieving revision 1.120
diff -u -p -r1.120 gnugo.h
--- engine/gnugo.h	28 Sep 2005 21:52:04 -0000	1.120
+++ engine/gnugo.h	1 Oct 2005 10:46:34 -0000
@@ -85,33 +85,18 @@ const char *result_to_string(int result)
 
 
 void gnugo_clear_board(int boardsize);
-void gnugo_set_komi(float new_komi);
-void gnugo_add_stone(int i, int j, int color);
-void gnugo_remove_stone(int i, int j);
-int  gnugo_is_pass(int i, int j);
 void gnugo_play_move(int i, int j, int color);
-int  gnugo_undo_move(int n);
 int  gnugo_play_sgfnode(SGFNode *node, int to_move);
 int  gnugo_play_sgftree(SGFNode *root, int *until, SGFNode **curnode);
-int  gnugo_is_legal(int i, int j, int color);
-int  gnugo_is_suicide(int i, int j, int color);
 
-int  gnugo_placehand(int handicap);
 int  gnugo_sethand(int handicap, SGFNode *root);
-void gnugo_recordboard(SGFNode *node);
 
 float gnugo_genmove(int *i, int *j, int color, int *resign);
 
 int  gnugo_attack(int m, int n, int *i, int *j);
 int  gnugo_find_defense(int m, int n, int *i, int *j);
 
-void  gnugo_who_wins(int color, FILE *outfile);
 float gnugo_estimate_score(float *upper, float *lower);
-
-float gnugo_get_komi(void);
-void  gnugo_get_board(int b[MAX_BOARD][MAX_BOARD]);
-int   gnugo_get_boardsize(void);
-int   gnugo_get_move_number(void);
 
 /* ================================================================ */
 /*                           Game handling                          */
Index: engine/interface.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/interface.c,v
retrieving revision 1.55
diff -u -p -r1.55 interface.c
--- engine/interface.c	28 Sep 2005 21:52:04 -0000	1.55
+++ engine/interface.c	1 Oct 2005 10:46:34 -0000
@@ -74,38 +74,6 @@ gnugo_clear_board(int boardsize)
 #endif
 }
 
-/* Set the komi */
-
-void
-gnugo_set_komi(float new_komi)
-{
-  komi = new_komi;
-}
-
-/* Place a stone on the board */
-
-void
-gnugo_add_stone(int i, int j, int color)
-{
-  add_stone(POS(i, j), color);
-}
-
-/* Remove a stone from the board */
-
-void
-gnugo_remove_stone(int i, int j)
-{
-  remove_stone(POS(i, j));
-}
-
-/* Return true if (i,j) is PASS_MOVE */
-
-int
-gnugo_is_pass(int i, int j)
-{
-  return is_pass(POS(i, j));
-}
-
 /* Play a move and start the clock */
 
 void
@@ -122,16 +90,6 @@ gnugo_play_move(int i, int j, int color)
   clock_push_button(color);
 }
 
-/* Undo n permanent moves. Returns 1 if successful and 0 if it fails.
- * If n moves cannot be undone, no move is undone.
- */
-
-int
-gnugo_undo_move(int n)
-{
-  return undo_move(n);
-}
-
 
 /*
  * Perform the moves and place the stones from the SGF node on the 
@@ -149,13 +107,13 @@ gnugo_play_sgfnode(SGFNode *node, int to
     case SGFAB:
       /* A black stone. */
       get_moveXY(prop, &i, &j, board_size);
-      gnugo_add_stone(i, j, BLACK);
+      add_stone(POS(i, j), BLACK);
       break;
 
     case SGFAW:
       /* A white stone. */
       get_moveXY(prop, &i, &j, board_size);
-      gnugo_add_stone(i, j, WHITE);
+      add_stone(POS(i, j), WHITE);
       break;
 
     case SGFPL:
@@ -202,12 +160,12 @@ gnugo_play_sgftree(SGFNode *root, int *u
       switch (prop->name) {
       case SGFAB:
 	get_moveXY(prop, &i, &j, board_size);
-	gnugo_add_stone(i, j, BLACK);
+	add_stone(POS(i, j), BLACK);
 	break;
 
       case SGFAW:
 	get_moveXY(prop, &i, &j, board_size);
-	gnugo_add_stone(i, j, WHITE);
+	add_stone(POS(i, j), WHITE);
 	break;
 
       case SGFPL:
@@ -238,38 +196,6 @@ gnugo_play_sgftree(SGFNode *root, int *u
 }
 
 
-/* Interface to is_legal(). */
-int
-gnugo_is_legal(int i, int j, int color)
-{
-  return is_legal(POS(i, j), color);
-}
-
-
-/* Interface to is_suicide(). */
-int
-gnugo_is_suicide(int i, int j, int color)
-{
-  return is_suicide(POS(i, j), color);
-}
-
-
-/* Interface to placehand. Sets up handicap stones and
- * returns the number of placed handicap stones. */
-int
-gnugo_placehand(int handicap)
-{
-  return place_fixed_handicap(handicap);
-}
-
-
-/* Interface to sgffile_recordboard */
-void
-gnugo_recordboard(SGFNode *root)
-{
-  sgffile_recordboard(root);
-}
-
 /* Interface to placehand. Sets up handicap stones and
  * returns the number of placed handicap stones, updating the sgf file.
  */
@@ -332,14 +258,6 @@ gnugo_find_defense(int m, int n, int *i,
 }
 
 
-/* Interface to who_wins */
-void
-gnugo_who_wins(int color, FILE *outfile)
-{
-  who_wins(color, outfile);
-}
-
-
 /* Put upper and lower score estimates into *upper, *lower and
  * return the average. A positive score favors white. In computing
  * the upper bound, CRITICAL dragons are awarded to white; in
@@ -358,39 +276,6 @@ gnugo_estimate_score(float *upper, float
 }
 
 
-/* Accessor functions for internal board state. */
-
-/* Report the komi. */
-
-float
-gnugo_get_komi()
-{
-  return komi;
-}
-
-/* Place the board into the b array */
-
-void
-gnugo_get_board(int b[MAX_BOARD][MAX_BOARD])
-{
-  int i, j;
-  for (i = 0; i < board_size; i++)
-    for (j = 0; j < board_size; j++)
-      b[i][j] = BOARD(i, j);
-}
-
-int
-gnugo_get_boardsize()
-{
-  return board_size;
-}
-
-int
-gnugo_get_move_number()
-{
-  return movenum;
-}
-
 /* ================================================================ */
 /*                             Gameinfo                             */
 /* ================================================================ */
@@ -401,12 +286,12 @@ gnugo_get_move_number()
  */
 
 void
-gameinfo_clear(Gameinfo *ginfo, int boardsize, float komi)
+gameinfo_clear(Gameinfo *ginfo, int boardsize, float new_komi)
 {
   ginfo->handicap = 0;
   
   gnugo_clear_board(boardsize);
-  gnugo_set_komi(komi);
+  komi = new_komi;
   ginfo->to_move = BLACK;
   sgftree_clear(&ginfo->game_record);
 
@@ -450,7 +335,6 @@ gameinfo_load_sgfheader(Gameinfo *gamein
 {
   int bsize;
   int handicap;
-  float komi;
   
   if (!sgfGetIntProperty(head, "SZ", &bsize))
     bsize = 19;
@@ -458,7 +342,6 @@ gameinfo_load_sgfheader(Gameinfo *gamein
     komi = 5.5;
   
   gnugo_clear_board(bsize);
-  gnugo_set_komi(komi);
   
   if (!sgfGetIntProperty(head, "HA", &handicap) || handicap < 0)
     /* Handicap stones should appear as AW, AB properties in the sgf file. */
@@ -505,7 +388,6 @@ gameinfo_play_sgftree_rot(Gameinfo *game
 			  const char *untilstr, int orientation)
 {
   int bs, handicap;
-  float komi;
   int next = BLACK;
   
   int untilm = -1, untiln = -1;
@@ -520,7 +402,6 @@ gameinfo_play_sgftree_rot(Gameinfo *game
   if (!sgfGetIntProperty(tree->root, "SZ", &bs))
     bs = 19;
   gnugo_clear_board(bs);
-  gnugo_set_komi(komi);
 
   /* Now we can safely parse the until string (which depends on board size). */
   if (untilstr) {
@@ -575,7 +456,7 @@ gameinfo_play_sgftree_rot(Gameinfo *game
 	  gprintf("Illegal SGF! attempt to add a stone at occupied point %m\n",
 		  i, j);
 	else
-	  gnugo_add_stone(i, j, BLACK);
+	  add_stone(POS(i, j), BLACK);
 	break;
 	      
       case SGFAW:
@@ -585,7 +466,7 @@ gameinfo_play_sgftree_rot(Gameinfo *game
 	  gprintf("Illegal SGF! attempt to add a stone at occupied point %m\n",
 		  i, j);
 	else
-	  gnugo_add_stone(i, j, WHITE);
+	  add_stone(POS(i, j), WHITE);
 	break;
 	      
       case SGFPL:
Index: interface/play_ascii.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/interface/play_ascii.c,v
retrieving revision 1.58
diff -u -p -r1.58 play_ascii.c
--- interface/play_ascii.c	12 Jun 2005 12:22:44 -0000	1.58
+++ interface/play_ascii.c	1 Oct 2005 10:46:34 -0000
@@ -444,7 +444,7 @@ init_sgf(Gameinfo *ginfo)
       		   level, chinese_rules);
   sgfOverwritePropertyInt(sgftree.root, "HA", ginfo->handicap);
   if (ginfo->handicap > 0)
-    gnugo_recordboard(sgftree.root);
+    sgffile_recordboard(sgftree.root);
 }
 
 
@@ -513,7 +513,7 @@ do_move(Gameinfo *gameinfo, char *comman
     return 0;
   }
   
-  if (!gnugo_is_legal(i, j, gameinfo->to_move)) {
+  if (!is_legal(POS(i, j), gameinfo->to_move)) {
     printf("\nIllegal move: %s", command);
     return 0;
   }
@@ -592,7 +592,7 @@ play_ascii(SGFTree *tree, Gameinfo *game
     if (gameinfo->handicap == 0)
       gameinfo->to_move = BLACK;
     else {
-      gameinfo->handicap = gnugo_placehand(gameinfo->handicap);
+      gameinfo->handicap = place_fixed_handicap(gameinfo->handicap);
       gameinfo->to_move = WHITE;
     }
     sgf_initialized = 0;
@@ -709,7 +709,7 @@ do_play_ascii(Gameinfo *gameinfo)
 	  /* Init board. */
 	  gnugo_clear_board(sz);
 	  /* In case max handicap changes on smaller board. */
-	  gameinfo->handicap = gnugo_placehand(gameinfo->handicap);
+	  gameinfo->handicap = place_fixed_handicap(gameinfo->handicap);
 	  sgfOverwritePropertyInt(sgftree.root, "SZ", sz);
 	  sgfOverwritePropertyInt(sgftree.root, "HA", gameinfo->handicap);
 	  break;
@@ -732,7 +732,7 @@ do_play_ascii(Gameinfo *gameinfo)
 	  gnugo_clear_board(board_size);
 	  /* Place stones on board but don't record sgf 
 	   * in case we change more info. */
-	  gameinfo->handicap = gnugo_placehand(num);
+	  gameinfo->handicap = place_fixed_handicap(num);
 	  printf("\nSet handicap to %d\n", gameinfo->handicap);
           gameinfo->to_move = (gameinfo->handicap ? WHITE : BLACK);
 	  break;
@@ -866,7 +866,7 @@ do_play_ascii(Gameinfo *gameinfo)
 
 	case UNDO:
 	case CMD_BACK:
-	  if (gnugo_undo_move(1)) {
+	  if (undo_move(1)) {
             sgftreeAddComment(&sgftree, "undone");
 	    sgftreeBack(&sgftree);
 	    gameinfo->to_move = OTHER_COLOR(gameinfo->to_move);
@@ -1031,7 +1031,7 @@ ascii_endgame(Gameinfo *gameinfo, int re
   int state = 0;
 
   if (reason == 0) {		/* Two passes, game is over. */
-    gnugo_who_wins(gameinfo->computer_player, stdout);
+    who_wins(gameinfo->computer_player, stdout);
     printf("\nIf you disagree, we may count the game together.\n");
 
     sgftreeWriteResult(&sgftree, (white_score + black_score)/2.0, 1);
@@ -1166,7 +1166,7 @@ ascii_count(Gameinfo *gameinfo)
       }
     }
   }
-  gnugo_who_wins(gameinfo->computer_player, stdout);
+  who_wins(gameinfo->computer_player, stdout);
 }
 
 
Index: interface/play_gmp.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/interface/play_gmp.c,v
retrieving revision 1.31
diff -u -p -r1.31 play_gmp.c
--- interface/play_gmp.c	12 Jun 2005 09:34:14 -0000	1.31
+++ interface/play_gmp.c	1 Oct 2005 10:46:34 -0000
@@ -57,10 +57,10 @@ play_gmp(Gameinfo *gameinfo, int simplif
     mycolor = 0;
 
   sgftree_clear(&sgftree);
-  sgftreeCreateHeaderNode(&sgftree, gnugo_get_boardsize(), gnugo_get_komi());
+  sgftreeCreateHeaderNode(&sgftree, board_size, komi);
 
   ge = gmp_create(0, 1);
-  TRACE("board size=%d\n", gnugo_get_boardsize());
+  TRACE("board size=%d\n", board_size);
 
   /* 
    * The specification of the go modem protocol doesn't even discuss
@@ -68,11 +68,11 @@ play_gmp(Gameinfo *gameinfo, int simplif
    * command line, keep it. Otherwise, its value will be 0.0 and we
    * use 5.5 in an even game, 0.5 otherwise.
    */
-  if (gnugo_get_komi() == 0.0) {
+  if (komi == 0.0) {
     if (gameinfo->handicap == 0)
-      gnugo_set_komi(5.5);
+      komi = 5.5;
     else
-      gnugo_set_komi(0.5);
+      komi = 0.5;
   }
 
   if (!simplified) {
@@ -84,7 +84,7 @@ play_gmp(Gameinfo *gameinfo, int simplif
   }
   else {
     gmp_startGame(ge, board_size, gameinfo->handicap,
-		  gnugo_get_komi(), chinese_rules, mycolor, 1);
+		  komi, chinese_rules, mycolor, 1);
   }
 
   do {
@@ -105,17 +105,17 @@ play_gmp(Gameinfo *gameinfo, int simplif
   gnugo_clear_board(gmp_size(ge));
 
   /* Let's pretend GMP knows about komi in case something will ever change. */
-  gnugo_set_komi(gmp_komi(ge));
+  komi = gmp_komi(ge);
 
 #if ORACLE
   if (metamachine && oracle_exists)
     oracle_clear_board(gnugo_get_boardsize());
 #endif
 
-  sgfOverwritePropertyInt(sgftree.root, "SZ", gnugo_get_boardsize());
+  sgfOverwritePropertyInt(sgftree.root, "SZ", board_size);
 
-  TRACE("size=%d, handicap=%d, komi=%f\n", gnugo_get_boardsize(),
-	gameinfo->handicap, gnugo_get_komi());
+  TRACE("size=%d, handicap=%d, komi=%f\n", board_size,
+	gameinfo->handicap, komi);
 
   if (gameinfo->handicap)
     to_move = WHITE;
@@ -132,7 +132,7 @@ play_gmp(Gameinfo *gameinfo, int simplif
   }
 
   gameinfo->computer_player = mycolor;
-  sgf_write_header(sgftree.root, 1, get_random_seed(), gnugo_get_komi(),
+  sgf_write_header(sgftree.root, 1, get_random_seed(), komi,
 		   level, chinese_rules);
   gameinfo->handicap = gnugo_sethand(gameinfo->handicap, sgftree.root);
   sgfOverwritePropertyInt(sgftree.root, "HA", gameinfo->handicap);
@@ -156,7 +156,7 @@ play_gmp(Gameinfo *gameinfo, int simplif
 	assert(j > 0);
 	
 	for (k = 0; k < j; k++) {
-	  if (!gnugo_undo_move(1)) {
+	  if (!undo_move(1)) {
 	    fprintf(stderr, "GNU Go: play_gmp UNDO: can't undo %d moves\n",
 		    j - k);
 	    break;
@@ -190,7 +190,7 @@ play_gmp(Gameinfo *gameinfo, int simplif
       gnugo_play_move(i, j, mycolor);
       sgffile_add_debuginfo(sgftree.lastnode, move_value);
       
-      if (gnugo_is_pass(i, j)) {
+      if (is_pass(POS(i, j))) {
 	/* pass */
         sgftreeAddPlay(&sgftree, to_move, -1, -1);
 	gmp_sendPass(ge);
Index: interface/play_solo.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/interface/play_solo.c,v
retrieving revision 1.37
diff -u -p -r1.37 play_solo.c
--- interface/play_solo.c	12 Jun 2005 09:34:14 -0000	1.37
+++ interface/play_solo.c	1 Oct 2005 10:46:34 -0000
@@ -43,7 +43,6 @@ play_solo(Gameinfo *gameinfo, int moves)
   float move_value;
   double t1, t2;
   int save_moves = moves;
-  int boardsize = gnugo_get_boardsize();
 
   struct stats_data totalstats;
   int total_owl_count = 0;
@@ -57,20 +56,20 @@ play_solo(Gameinfo *gameinfo, int moves)
   int n = 6 + 2*gg_rand()%5;
   int i, j;
 
-  gnugo_set_komi(5.5);
+  komi = 5.5;
 
   sgftree_clear(&sgftree);
-  sgftreeCreateHeaderNode(&sgftree, gnugo_get_boardsize(), gnugo_get_komi());
+  sgftreeCreateHeaderNode(&sgftree, board_size, komi);
   sgf_write_header(sgftree.root, 1, get_random_seed(), 5.5,
                    level, chinese_rules);
  
   /* Generate some random moves. */
-  if (boardsize > 6) {
+  if (board_size > 6) {
     do {
       do {
-	i = (gg_rand() % 4) + (gg_rand() % (boardsize - 4));
-	j = (gg_rand() % 4) + (gg_rand() % (boardsize - 4));
-      } while (!gnugo_is_legal(i, j, gameinfo->to_move));
+	i = (gg_rand() % 4) + (gg_rand() % (board_size - 4));
+	j = (gg_rand() % 4) + (gg_rand() % (board_size - 4));
+      } while (!is_legal(POS(i, j), gameinfo->to_move));
 
       gnugo_play_move(i, j, gameinfo->to_move);
       sgftreeAddPlay(&sgftree, gameinfo->to_move, i, j);
@@ -111,7 +110,7 @@ play_solo(Gameinfo *gameinfo, int moves)
   t2 = gg_cputime();
   
   /* Two passes and it's over. (EMPTY == BOTH) */
-  gnugo_who_wins(EMPTY, stdout);
+  who_wins(EMPTY, stdout);
 
   {
     float score = gnugo_estimate_score(NULL, NULL);
Index: interface/play_test.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/interface/play_test.c,v
retrieving revision 1.21
diff -u -p -r1.21 play_test.c
--- interface/play_test.c	12 Jun 2005 09:34:14 -0000	1.21
+++ interface/play_test.c	1 Oct 2005 10:46:34 -0000
@@ -124,7 +124,6 @@ replay_node(SGFNode *node, int color_to_
   SGFProperty *move_prop = NULL; /* remember if we see a move property */
   int color; /* color of move to be made at this node. */
   
-  int boardsize = gnugo_get_boardsize();
   int m, n; /* Move from file. */
   int i, j; /* Move generated by GNU Go. */
 
@@ -138,13 +137,15 @@ replay_node(SGFNode *node, int color_to_
     switch (sgf_prop->name) {
     case SGFAB:
       /* add black */
-      gnugo_add_stone(get_moveX(sgf_prop, boardsize),
-		      get_moveY(sgf_prop, boardsize), BLACK);
+      add_stone(POS(get_moveX(sgf_prop, board_size),
+		    get_moveY(sgf_prop, board_size)),
+                BLACK);
       break;
     case SGFAW:
       /* add white */
-      gnugo_add_stone(get_moveX(sgf_prop, boardsize),
-		      get_moveY(sgf_prop, boardsize), WHITE);
+      add_stone(POS(get_moveX(sgf_prop, board_size),
+		    get_moveY(sgf_prop, board_size)),
+                WHITE);
       break;
     case SGFB:
     case SGFW:
@@ -157,8 +158,8 @@ replay_node(SGFNode *node, int color_to_
   if (!move_prop)
     return;
 
-  m = get_moveX(move_prop, boardsize);
-  n = get_moveY(move_prop, boardsize);
+  m = get_moveX(move_prop, board_size);
+  n = get_moveY(move_prop, board_size);
   color = (move_prop->name == SGFW) ? WHITE : BLACK;
 
   if (color == color_to_replay || color_to_replay == GRAY) {
@@ -173,11 +174,11 @@ replay_node(SGFNode *node, int color_to_
 	printf("GNU Go resigns ");
       else {
 	mprintf("GNU Go plays %m ", i, j);
-	if (!gnugo_is_pass(i, j))
+	if (!is_pass(POS(i, j)))
 	  printf("(%.2f) ", potential_moves[POS(i, j)]);
       }
       mprintf("- Game move %m ", m, n);
-      if (!gnugo_is_pass(m, n) && potential_moves[POS(m, n)] > 0.0)
+      if (!is_pass(POS(m, n)) && potential_moves[POS(m, n)] > 0.0)
 	printf("(%.2f) ", potential_moves[POS(m, n)]);
       printf("\n");
 
@@ -190,15 +191,15 @@ replay_node(SGFNode *node, int color_to_
       if (resign)
 	gg_snprintf(buf, 127, "GNU Go resigns - Game move %s (%.2f)",
 		    location_to_string(POS(m, n)),
-		    gnugo_is_pass(m, n)
+		    is_pass(POS(m, n))
 		    && potential_moves[POS(m, n)] < 0.0 ?
 			0 : potential_moves[POS(m, n)]);
       else {      
 	gg_snprintf(buf, 127, "GNU Go plays %s (%.2f) - Game move %s (%.2f)",
 		    location_to_string(POS(i, j)),
-		    gnugo_is_pass(i, j) ? 0 : potential_moves[POS(i, j)],
+		    is_pass(POS(i, j)) ? 0 : potential_moves[POS(i, j)],
 		    location_to_string(POS(m, n)),
-		    gnugo_is_pass(m, n)
+		    is_pass(POS(m, n))
 		    && potential_moves[POS(m, n)] < 0.0 ?
 			0 : potential_moves[POS(m, n)]);
 	sgfCircle(node, i, j);
@@ -207,7 +208,7 @@ replay_node(SGFNode *node, int color_to_
     else
       gg_snprintf(buf, 127, "GNU Go plays the same move %s (%.2f)",
                  location_to_string(POS(i, j)),
-                 gnugo_is_pass(i, j) ? 0 : potential_moves[POS(i, j)]);
+                 is_pass(POS(i, j)) ? 0 : potential_moves[POS(i, j)]);
     sgfAddComment(node, buf);
     sgffile_add_debuginfo(node, 0.0);
   }
