(at_minimum, blocksig, emp_bitinit, filelogerror, iceil, ifloor,
mapdsq, mask, signame, strscan, sys_siglist, typed_wire, unblocksig): Unused, remove. (add_airport, add_to_fired_queue, air_damage, anti_torp, best_path, bitinit2, blankrow, bmnxtsct, bp_init, build_mission_list, build_mission_list_type, buildeff, candchrg, canshoot, cantorp, cede_sect, cede_ship, checksect, client_cmd, coun_cmd, deity_build_land, divide, do_conv, do_defdam, do_demo, do_desi, do_mob_land, do_mob_plane, do_mob_sect, do_mob_ship, do_prod, docountry, doland, doplane, doship, dosupport, dotsprintf, dounit, empth_start, enlist, errcheck, filereport, find_airport, find_escorts, findcondition, fire_dchrg, fire_torp, fltp_to_list, get_minimum, getin, goodsect, grab_sect, grab_ship, grow_people, growfood, in_addr, infect_people, init_mchr, init_pchr, init_plchr, is_engineer, itemname, kill_cmd, landrepair, limit_level, list_cmd, lupgr, materials_charge, materials_cost, meltitems, mission_pln_arm, mission_pln_sel, move_map, nat_cap, num_units, outid, pass_cmd, perform_mission, pinflak_planedamage, play_cmd, pln_equip, prexpense, print_res, prplanes, prunits, pupgr, quiet_bigdef, quit_cmd, radmap2, retreat_land1, retreat_ship1, s_commod, sanc_cmd, sarg_getrange, scuttle_it, scuttle_land, set_target, share_incr, shiprepair, shp_check_mines, shp_check_nav, shp_check_one_mines, shp_hit_mine, shp_interdict, shp_mess, sort_lookup_list, starvation, supgr, swap, take_casualties, trunc_people, upd_buildeff, upd_land, upd_ship, use_ammo, user_cmd): Change linkage to static.
This commit is contained in:
parent
f883ed1620
commit
2fe312adac
58 changed files with 273 additions and 693 deletions
|
@ -36,16 +36,16 @@ LIB = $(SRCDIR)/lib/libgen.a
|
|||
NTLIB = $(SRCDIR)\lib\libgen.lib
|
||||
|
||||
OBJS = atoip.o atopi.o bit.o chance.o copy.o disassoc.o dtable.o \
|
||||
emp_config.o getstarg.o getstring.o hpux.o iceil.o inet.o io.o \
|
||||
emp_config.o getstarg.o getstring.o hpux.o inet.o io.o \
|
||||
io_mask.o ioqueue.o lock.o mapdist.o minmax.o numstr.o onearg.o \
|
||||
parse.o plur.o queue.o round.o same.o scthash.o signal.o \
|
||||
strdup.o strscan.o vsprintf.o
|
||||
parse.o plur.o queue.o round.o same.o scthash.o \
|
||||
strdup.o vsprintf.o
|
||||
|
||||
NTOBJS = atoip.obj atopi.obj bit.obj chance.obj copy.obj disassoc.obj \
|
||||
dtable.obj emp_config.obj getstarg.obj getstring.obj hpux.obj iceil.obj \
|
||||
dtable.obj emp_config.obj getstarg.obj getstring.obj hpux.obj \
|
||||
inet.obj io.obj io_mask.obj ioqueue.obj lock.obj mapdist.obj minmax.obj \
|
||||
numstr.obj onearg.obj parse.obj plur.obj queue.obj round.obj same.obj \
|
||||
scthash.obj signal.obj strdup.obj strscan.obj vsprintf.obj
|
||||
scthash.obj strdup.obj vsprintf.obj
|
||||
|
||||
all: $(LIB)
|
||||
|
||||
|
|
|
@ -1,52 +0,0 @@
|
|||
/*
|
||||
* Empire - A multi-player, client/server Internet based war game.
|
||||
* Copyright (C) 1986-2000, 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 the "LEGAL", "LICENSE", "CREDITS" and "README" files for all the
|
||||
* related information and legal notices. It is expected that any future
|
||||
* projects/authors will amend these files as needed.
|
||||
*
|
||||
* ---
|
||||
*
|
||||
* iceil.c: integer ceiling/floor functions
|
||||
*
|
||||
* Known contributors to this file:
|
||||
*
|
||||
*/
|
||||
|
||||
#include "gen.h"
|
||||
|
||||
int
|
||||
iceil(double arg)
|
||||
{
|
||||
register int i;
|
||||
|
||||
i = arg;
|
||||
return (i >= arg ? i : i + 1);
|
||||
}
|
||||
|
||||
int
|
||||
ifloor(double arg)
|
||||
{
|
||||
register int i;
|
||||
|
||||
i = arg;
|
||||
return (i <= arg ? i : i - 1);
|
||||
}
|
|
@ -33,7 +33,6 @@
|
|||
|
||||
/*
|
||||
* mapdist returns (integer) distance between two sectors.
|
||||
* mapdsq returns the square of the distance -- more efficient.
|
||||
*/
|
||||
|
||||
#include "misc.h"
|
||||
|
@ -107,12 +106,3 @@ mapdist(int x1, int y1, int x2, int y2)
|
|||
return (dx - dy) / 2 + dy;
|
||||
return dy;
|
||||
}
|
||||
|
||||
int
|
||||
mapdsq(int x1, int y1, int x2, int y2)
|
||||
{
|
||||
int sq;
|
||||
|
||||
sq = mapdist(x1, y1, x2, y2);
|
||||
return sq * sq;
|
||||
}
|
||||
|
|
|
@ -1,105 +0,0 @@
|
|||
/*
|
||||
* Empire - A multi-player, client/server Internet based war game.
|
||||
* Copyright (C) 1986-2000, 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 the "LEGAL", "LICENSE", "CREDITS" and "README" files for all the
|
||||
* related information and legal notices. It is expected that any future
|
||||
* projects/authors will amend these files as needed.
|
||||
*
|
||||
* ---
|
||||
*
|
||||
* sig.c: block and unblock signals for critical sections
|
||||
*
|
||||
* Known contributors to this file:
|
||||
* Doug Hay, 1998
|
||||
* Steve McClure, 1998
|
||||
*/
|
||||
|
||||
#include "misc.h"
|
||||
#include "gen.h"
|
||||
#include <signal.h>
|
||||
|
||||
u_int mask;
|
||||
|
||||
void
|
||||
blocksig(void)
|
||||
{
|
||||
#if !defined(_WIN32)
|
||||
mask = sigsetmask(0xffffffff);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
unblocksig(void)
|
||||
{
|
||||
#if !defined(_WIN32)
|
||||
sigsetmask(mask);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef sys5
|
||||
const s_char *sys_siglist[] = {
|
||||
"no signal",
|
||||
"interrupt",
|
||||
"quit",
|
||||
"illegal instruction",
|
||||
"trace trap",
|
||||
"IOT instruction",
|
||||
"system crash imminent",
|
||||
"floating point exception",
|
||||
"kill",
|
||||
"bus error",
|
||||
"segmentation violation",
|
||||
"bad argument to system call",
|
||||
"write on a pipe with no one to read it",
|
||||
"alarm clock",
|
||||
"software termination",
|
||||
"user defined signal 1",
|
||||
"user defined signal 2",
|
||||
"death of a child",
|
||||
"power-fail restart",
|
||||
"asychronous i/o",
|
||||
"PTY read/write",
|
||||
"I/O intervention required",
|
||||
"monitor mode granted",
|
||||
"monitor mode retracted",
|
||||
"sound ack",
|
||||
"data pending",
|
||||
};
|
||||
#else
|
||||
#if (!defined __ppc__) && (!defined linux) && (!defined FBSD) && (!defined __linux__)
|
||||
/* linux and osx declare sys_siglist in signal.h */
|
||||
extern s_char *sys_siglist[];
|
||||
#endif /* linux */
|
||||
#endif /* sys5 */
|
||||
|
||||
const s_char *
|
||||
signame(int sig)
|
||||
{
|
||||
#ifdef POSIX_SIGNALS
|
||||
if (sig <= 0 || sig > _sys_nsig)
|
||||
return "bad signal";
|
||||
return _sys_siglist[sig];
|
||||
#else /* POSIX_SIGNALS */
|
||||
if (sig <= 0 || sig > NSIG)
|
||||
return "bad signal";
|
||||
return sys_siglist[sig];
|
||||
#endif /* POSIX_SIGNALS */
|
||||
}
|
|
@ -1,57 +0,0 @@
|
|||
/*
|
||||
* Empire - A multi-player, client/server Internet based war game.
|
||||
* Copyright (C) 1986-2000, 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 the "LEGAL", "LICENSE", "CREDITS" and "README" files for all the
|
||||
* related information and legal notices. It is expected that any future
|
||||
* projects/authors will amend these files as needed.
|
||||
*
|
||||
* ---
|
||||
*
|
||||
* strscan.c: scan a string for any occurence of another string
|
||||
*
|
||||
* Known contributors to this file:
|
||||
* Steve McClure, 2000
|
||||
*/
|
||||
|
||||
#ifdef Rel4
|
||||
#include <string.h>
|
||||
#endif /* Rel4 */
|
||||
#include <stdio.h>
|
||||
#include "misc.h"
|
||||
|
||||
int
|
||||
strscan(s_char *target, s_char *string)
|
||||
{
|
||||
int i, n, delta;
|
||||
|
||||
if ((string == NULL) || (target == NULL))
|
||||
return (1);
|
||||
n = strlen(target);
|
||||
delta = strlen(string);
|
||||
if (delta < n)
|
||||
return (1);
|
||||
delta -= n;
|
||||
for (i = 0; i <= delta; i++) {
|
||||
if (!strncmp(target, &(string[i]), n))
|
||||
return (0);
|
||||
}
|
||||
return (1);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue