(opt_UPDATESCHED): Remove nooption UPDATESCHED. It had no effect on
the actual update, only on the update command. Believed to be broken
since Empire2.
(PP_MAIN, PP_UPDATE, PP_SHUTDOWN, PP_SCHED, PP_TIMESTAMP, PP_PLAYER)
(PP_ACCEPT, PP_KILLIDLE): Move from player.h to empthread.h and turn
into enumeration constants.
Support for IPv6:
(tcp_listen, player_addrlen): New. IPv4-only code factored out of
player_init().
(player_init): Use them.
(player_accept): Address family independence.
(tcp_connect): New.
(main): Use it.
(hostaddr, hostconnect, hostport): Internal linkage.
(EMPTH_LWP, EMPTH_POSIX, EMPTH_W32): Define in config.h instead of
compiler command line. Don't bother to conditionalize code in .c
files that are only compiled when their thread package is used.
(_EMPTH_LWP, EMPTH_LWP, _EMPTH_POSIX, EMPTH_POSIX, _EMPTH_WIN32)
(EMPTH_W32): Identifiers beginning with an underscore and an uppercase
letter are reserved for any use. Rename.
(lwpInitSelect): The code to query the system's limit on file
descriptors was not portable. Simply use FD_SETSIZE instead. The
lower of the two applies, so this wastes storage if the system's limit
is significantly below FD_SETSIZE. Not an issue, as FD_SETSIZE is
fairly small.
(lwpSleepFd): Return if fd is too large. Returning isn't nice,
but better than the buffer overruns in the old code.
(lwpSelect): Member nfile unused, remove.
Ron Koenderink [Mon, 26 Dec 2005 03:53:21 +0000 (03:53 +0000)]
(player_new, player_accept, update_wait, market_update) [_WIN32]:
Move assignment of hostaddr and hostname from player_new() to
player_accept(). This solves the necessary of adding the socket include
file to prototypes.h for player_new(). The socket include file creates
a namespace conflict for WIN32.
(drop): A mining mission targeting land called pln_dropoff() instead
of pln_mine(). pln_dropoff() happens to do pretty much the right
thing, but...
(pln_mine): Refuse to mine land.
Flatten info directory. This undoes the move to one subdirectory per
chapter, which was done during Empire 2. The structure doesn't buy us
much, as the info name space is flat, and it complicates makefiles.
Overhaul info.pl:
- It now wants to run in the root of the build tree.
- Information on source files and subjects is now stored in makefiles,
thus info.pl no longer picks up random junk from the file system.
- Clean up Perl anachronisms, in particular use subroutine arguments and
results rather than global variables where convenient.
- Change format of diagnostics to the common format used by GNU tools,
so that Emacs and the like can parse it.
- Catch missing .SA.
- When creating a new subject file, cowardly refuse to overwrite an
existing file.
- Subject files contain topics sorted by chapter, then by name. The
order of chapters used to depend on how Perl sorts hash keys. Fix
it.
Replace the build process. The new one requires GNU Make, Autoconf
and Autoconf macros that come with Automake. It supports multiple
separate builds of the same source tree, and updates dependencies
automatically. Targets info, html, install, install-html, uninstall
and dist are not yet implemented.
System configuration is now automatic. Previously, you had to choose
one of several canned system configurations, defined in Make.sysdefs.
Currently, system configuration always uses UCONTEXT for LWP, and
chooses LWP only if its requirements are met.
Feature configuration changed: instead of editing build.conf (further
processed by doconfig), you pass arguments to configure. Note that
build.conf settings that can be overridden in econfig have no
configure equivalent; just edit econfig instead.
Because generated headers complicate makefiles, fold gamesdef.h into
its users: path.c and ipglob.c become path.c.in and ipglob.c.in,
constants.c, vers.c, options.h simply hardcode defaults (most of them
are run-time configurable).
Call the client empire instead of emp_client. This matches what the
old standalone build did.
Ron Koenderink [Sun, 18 Dec 2005 15:16:52 +0000 (15:16 +0000)]
(shp_nav_one_sector, mchr[], ship_chr_flags[], Ship-types, Sector-types):
Add M_CANAL flag to indicate which ships can navigate a canal
in a big city. Remove the hard code values for canal from
shp_nav_one_sector() for which ships can navigate a canal.
Set M_CANAL flag in ship_chr_flags[] to match the hard
coding in shp_nav_one_sector().
Update Ship-types.t with new canal flag.
Update Sector-types.t to indicate that cities have canals.
(lwpNewContext) [MAKECONTEXT_SP_HIGH]: Work around makecontext()
lossage.
(IRIX5CFLAGS, SOLCFLAGS): Define MAKECONTEXT_SP_HIGH. This is wrong
for Solaris 10.
Redesign interface to machine-dependent code to cleanse lwp.c of
machine-dependencies:
(lwpNewContext): New, factored out of lwpCreate().
(lwpSwitchContext): New, factored out of lwpReschedule().
(LWP_EXTRASTACK, STKALIGN, lwpInitContext, lwpSave, lwpRestore): Move
to arch.c. Remove for UCONTEXT, else static linkage unless macro or
AIX32.
(lwpReschedule): Skip lwpStatus() when not actually switching.
(LwpStackGrowsDown): New.
(lwpInitSystem): Initialize it.
(lwpStackCheck, lwpStackCheckUsed): Use it.
(lwpProc): Members lowmark and himark are confusing, replace by
ustack, usize.
(lwpCreate): Initialize them.
(lwpStackCheckInit, lwpStackCheck, lwpStackCheckUsed): Rewrite using
them. lwpStackCheckUsed() was off by LWP_REDZONE when stack grows
down.
(lwpDestroy): Don't bother to clear memory to be freed.
(lwpCreate) [UCONTEXT]: ss_sp is the (base) address of the stack area,
not the initial stack pointer. Fix. ss_size was wrong as well.
Amazing that this ever worked.
(lwpCreate): Used to allocate one byte more than necessary. The fix
won't save memory (malloc() will add the byte back), it's just clearer
this way.
(lwpCreate): Clean up computation of sp. Rename parameter size to
stacksz.
(lwpCreate): Always compute newp->lowmark and newp->highmark from sp,
not from s. Old code misaligned newp->himark for stacks growing
upward when stack size argument wasn't aligned.
(lwpProc, lwpSem): Declare as incomplete type in include/lwp.h. Move
complete declaration to src/lib/lwp/lwpint.h.
(lwpQueue): Move to src/lib/lwp/lwpint.h.
(empth_main, empth_flags): New.
(empth_init): Initialize them.
(empth_create, empth_exit): Use them instead of lwpProc members.
Remove LWP code for targets we no longer support: VAX/MIPS Ultrix
(dropped in Make.sysdefs rev. 1.12), 386 USL/Unixware (unclear, long
ago), 386BSD (never been?)