Commit graph

132 commits

Author SHA1 Message Date
f3e85c2f70 Coding style, comments, spelling... 2006-05-26 18:46:50 +00:00
0d842c47f7 Purge the register keyword. 2006-05-21 13:18:57 +00:00
cd73a47dfa Remove superflous casts and parenthesis. 2006-05-21 12:24:30 +00:00
cee8e126a2 Remove declaration that should have been removed in rev. 1.9. Doc
fix.  register purge.
2006-04-30 13:20:48 +00:00
8f998de170 Remove dead code. 2006-04-30 08:43:28 +00:00
0c8c169f88 (s_char): Remove. Use signed char for small integers, plain char for
characters.
2006-04-29 16:25:17 +00:00
a988b907fc s_char purge directed by compiler warnings. 2006-04-29 06:41:45 +00:00
6fee3f4535 (CANT_REACH): New. Use it instead of CANT_HAPPEN() where possible.
(oops): Cope with NULL argument passed by CANT_REACH().
2006-04-17 17:36:07 +00:00
7d5a6b817e (iop): Remove unused members assoc, notify.
(io_open): Remove unused parameters assoc, notify.  Caller changed.
2006-03-29 19:19:47 +00:00
a77a8c3abd (emp_config): Failed to call set_dirs() when default econfig file
doesn't exist.
2006-03-29 13:14:55 +00:00
3aea505aa7 Cosmetics. 2006-03-27 19:50:38 +00:00
21bf6b41d4 Use NULL instead of (FOO *)0, it's easier to read. 2006-03-23 20:48:49 +00:00
Ron Koenderink
2147583a9e (set_dirs) [_WIN32]: Add the ability to deal with Windows
file and directory names.
2006-02-21 20:15:55 +00:00
d69dfc2b09 (set_dirs): New, factored out of emp_config(). Also fix for relative
file name argument.
2006-02-19 18:36:36 +00:00
b4161cd7e2 (mchr, plchr, lchr, nchr): Move initializer to new builtin config
files ship.config, plane.config, land.config, nuke.config.
(empfile): Declare the new config files.
(install, installdirs): Install them.
(builtins): New make variable.
2006-02-19 09:15:46 +00:00
ac0263d2ae (emp_config): Non-portable strndup() crept into rev. 1.33. Replace by
portable code.
2006-02-18 16:48:23 +00:00
3a9f9f6b3e (print_config): When km_comment starts with '#', don't prepend "\n#". 2006-02-18 16:12:50 +00:00
e4865d473e (configdir): New, to be used for loading configuration tables.
(emp_config): Set it to econfig's directory.
2006-02-18 12:43:17 +00:00
4515b84c59 COPYING duplicates information from README. Remove. Move GPL from
LICENSE to COPYING, because that's where it usually is.  Update all
the references to these files.
2006-01-21 19:48:41 +00:00
Ron Koenderink
04a8b84592 (ship_bomb, deli, do_demo, fuel, grin, look_ship)
(ltend, multifire, quite_bigdef, mine, landmine)
(do_loan, prod, printdiff, sell, sona, stre)
(tend, fire_dchrg, vers, work, ac_planedamage)
(ac_shipflak, ask_off, get_mine_dsupport, att_fight)
(ask_move_in_off, detonate, sd, land_gun)
(land_unitgun, lnd_fort_interdiction, lnd_fortify)
(perform_mission, pln_mine, pln_mobcost)
(retreat_ship1, retreat_land1, shp_sweep)
(shp_fort_interdiction, shp_missle_defense)
(new_work, growfood, upd_land, land_repair)
(get_materials, do_mob_ship, do_mob_land)
(load_it, unload_it, prod_plane, produce)
(guerrilla, upd_buildeff, spread_fallout)
(upd_ship, ship_repair, min, dmin, MIN):
Remove min() and dmin() functions and replace
with a MIN macro in misc.h.  Remove local MIN
macros and use the new one in misc.h.  This
change removes the need for the special
case for _WIN32.

(fuel, look_ship, multifire, mission, sona)
(plane_sona, ef_open, player_accept, player_main)
(ac_dog, att_get_combat, calc_mobcost)
(ask_move_in_off, intelligence_report)
(build_mission_list_type, perform_mission)
(show_mission, use_supply, dodistribute)
(allocate_memory, max, dmax, MAX):
Remove max() and dmax() functions and replace
with a MAX macro in misc.h.  Remove local MAX
macros and use the new one in misc.h.  This
change removes the need for the special
case for _WIN32.
2006-01-12 14:23:55 +00:00
3e400c018c Update copyright notice. 2006-01-05 13:36:57 +00:00
Ron Koenderink
eec6fe6207 (service_ctrl_handler) [_WIN32]: Add static declaration.
Fix logerror format to "lu" for GetLastError().
2006-01-01 20:41:45 +00:00
Ron Koenderink
940d35a71a (tcp_listen) [_WIN32]: Move the undef NS_ALL to after include winsock2.h.
The undef is present to prevent namespace conflict the selector code.
2006-01-01 20:38:21 +00:00
Ron Koenderink
0b37d8f508 (tcp_listen) [_WIN32]: Add the WIN32 include files for accessing
the socket functions.

(tcp_listen): Add prototypes.h to verify the extern prototype.
2006-01-01 20:27:24 +00:00
Ron Koenderink
8a25029c75 (disassoc) [_WIN32]: Add #ifndef _WIN32 around disassoc() as
WIN32 does not use it and does not support fork().
2006-01-01 19:29:12 +00:00
19d88af312 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.
2005-12-28 18:50:08 +00:00
3aebb68ee7 Include config.h. 2005-12-27 18:04:19 +00:00
ade510f787 Turn options into ordinary econfig keys:
(configkeys): Add options.
(KM_OPTION): New.
(vers): Find options in configkeys[] instead of Options[].
(xdump): Remove xdump opt syntax.
(xdopt): Remove.
(emp_config, print_config): Remove option special case.
(option_list, Options, setoption): Remove.
2005-12-25 10:32:50 +00:00
a98626df2d 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.
2005-12-20 20:25:35 +00:00
edaa05b8cb (fillcache, do_write, io_input, io_output): Portability fix: always
check both EAGAIN and EWOULDBLOCK.  These are distinct on some
systems, e.g. HP-UX.
(io_output) [hpux]: Used to treat all errors as EWOULDBLOCK.  This
looks like a inept attempt to `fix' the above.  Remove.
2005-11-22 20:28:18 +00:00
Ron Koenderink
3d68c0a0da (plurize): Fix the max. string length calculation for the 'y' case.
It was off by one because 'y' is removed from the string.
2005-11-19 12:11:09 +00:00
Ron Koenderink
94a0f81f24 (plurize): Change variable name max_len to size to improve readability. 2005-11-14 19:01:36 +00:00
Ron Koenderink
58133fe575 (plurize): Fix initial length check to check for zero length of buf
not non-zero lengths of buf.

(plurize): Change variable name size to len to improve readability.
2005-11-14 18:11:46 +00:00
Ron Koenderink
d581485d32 (plurize): Fix the strncat() len parameter to prevent an overflow of buf.
(numstr, esplur, splur, iesplur, plurize): Move the prototype defintions from
misc.h to prototypes.h.  Remove unneccessary headers in plur.c.
2005-11-13 23:18:37 +00:00
Ron Koenderink
fdcbb5912d (budg): Create the capital/city name from the d_name field instead of
hard coding the strings.

(plurize): New.
2005-11-13 21:23:44 +00:00
Ron Koenderink
613a9c52db (install_service): Use the compiled in default for location of econfig
when the -e is not specified while creating a service.
2005-11-05 20:05:38 +00:00
a6a87af6ed (disassoc): Rewrite for POSIX, return status. Caller changed.
Problems with the old code:
* Insufficient error checking.
* It used TIOCNOTTY (obsolete BSDism) to get rid of the controlling
  tty, except for hpux || Rel4, where it attempted to use the POSIX
  way, but screwed up.
* It left file descriptors 0, 1, 2 in a somewhat weird state.
2005-10-25 18:42:03 +00:00
a2ae5ebe5e [NOSTRDUP]: Drop support for systems without strdup(). First commit
was incomplete.
2005-10-23 08:37:38 +00:00
7041932ae2 (ioq_destroy) [aix, NeXT]: Remove special case, which leaked memory,
because freeing it didn't work at some time.  Well, it either works
now, or we'll find out what's wrong.
2005-10-22 18:28:11 +00:00
e24ade039f (io_open, io_noblocking): FNDELAY is long obsolete, use O_NONBLOCK. 2005-10-22 10:18:07 +00:00
09b0b83971 (IO_CONN, io_conn, IOQ_BUFSIZE, MAXIOV, LND_NOTANY, plur)
(techfactfire, reltech, P_DISTING, PLN_MAXDEF, filetruncate, sct_init)
(nxtsctp, AN_SAILDIR, UDTIMES_MAX, BLITZTIME): Unused, remove.
2005-09-30 19:51:32 +00:00
57332088a5 (io_output): Remove a redundant check. 2005-08-30 18:27:49 +00:00
Ron Koenderink
a7fa7dee30 (io_output_all,update_main,update_wait): Do not block on writing when
aborting commands for an update.  Move update_pending to the start of
the update sequence where the commands are aborted.
2005-08-21 17:17:38 +00:00
380b063f9c Remove some redundant parenthesis; no functional change. 2005-07-23 19:48:35 +00:00
124ce4a398 (io_write): Use IO_NOWAIT rather than 0. No functional change. 2005-06-25 17:24:13 +00:00
71e164ed30 Document, in particular use of UTF-8. Simplify code in a couple of
places, but no functional changes.
2005-06-13 19:02:49 +00:00
ac671d25e4 (parse): Support 127 arguments instead of 100, to match
player->argp[].  Assign complete argument vector.  This should make
buffer overruns blatantly obvious.

(parse): Don't bother checking SPACE argument, just crash.  It is
extremely unlikely that such a programming error wouldn't be
discovered by even them most superficial testing.
2005-06-13 09:33:54 +00:00
9ee7a02be8 (emp_config): Buffers passed to parse() were too small. econfig file
could overrun them.  Closes #899546.
2005-06-13 09:18:14 +00:00
4f59fc9967 Remove a bunch of redundant casts. 2005-06-12 06:31:48 +00:00
3a060d6056 [_WIN32] (loc_StripDels): Remove. Different behavior depending on the
platform is evil, and line editing is none of the server's business
anyway.  If your client can't deal with the delete key, well, here's a
nickel, kid, get yourself a better computer.
2005-06-11 16:44:01 +00:00