Get rid of src/lib/gen/copy.c

The function that gave its name to this file is long gone, the file's
description is bogus, and it contains just one definition.  Move that
to ../subs/border.c, and delete the file.
This commit is contained in:
Markus Armbruster 2008-02-02 21:52:01 +01:00
parent 3d2518a724
commit 1cbb37d4fb
3 changed files with 22 additions and 61 deletions

View file

@ -38,12 +38,12 @@
#define MAPWIDTH(persec) ((WORLD_X/2) * ((persec) + 1) + 1) #define MAPWIDTH(persec) ((WORLD_X/2) * ((persec) + 1) + 1)
extern void blankfill(char *, struct range *, int);
/* src/lib/subs/bigmap.c */ /* src/lib/subs/bigmap.c */
extern int map_set(natid, coord, coord, char, int); extern int map_set(natid, coord, coord, char, int);
extern void writebmap(natid); extern void writebmap(natid);
extern void writemap(natid); extern void writemap(natid);
/* src/lib/subs/border.c */ /* src/lib/subs/border.c */
extern void blankfill(char *, struct range *, int);
extern void border(struct range *, char *, char *); extern void border(struct range *, char *, char *);
#define MAP_PLANE bit(0) /* this order must match */ #define MAP_PLANE bit(0) /* this order must match */

View file

@ -1,60 +0,0 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2008, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* ---
*
* See files README, COPYING and CREDITS in the root of the source
* tree for related information and legal notices. It is expected
* that future projects/authors will amend these files as needed.
*
* ---
*
* copy.c: Copy and return pointer to end of copied string.
*
* Known contributors to this file:
*
*/
#include <config.h>
#include "map.h"
#include "misc.h"
#include "optlist.h"
#include "xy.h"
/*
* space-fill a map or radar scan;
* null terminate
*/
void
blankfill(char *ptr, struct range *range, int size)
{
char *p;
int row;
int col;
for (row = 0; row < range->height; row++) {
col = (range->width + 1) * (size + 1) / 2 - 1;
p = ptr;
while (--col >= 0)
*p++ = ' ';
*p++ = 0;
ptr += MAPWIDTH(size);
}
}

View file

@ -38,6 +38,27 @@
#include "prototypes.h" #include "prototypes.h"
#include "xy.h" #include "xy.h"
/*
* space-fill a map or radar scan;
* null terminate
*/
void
blankfill(char *ptr, struct range *range, int size)
{
char *p;
int row;
int col;
for (row = 0; row < range->height; row++) {
col = (range->width + 1) * (size + 1) / 2 - 1;
p = ptr;
while (--col >= 0)
*p++ = ' ';
*p++ = 0;
ptr += MAPWIDTH(size);
}
}
void void
border(struct range *rp, char *prefstr, char *sep) border(struct range *rp, char *prefstr, char *sep)