Commit graph

2531 commits

Author SHA1 Message Date
404095d2fa Trim system includes. 2007-08-18 17:03:14 +00:00
ce177501ef Include config.h. 2007-08-18 16:54:37 +00:00
09cb4ca532 Portability fix: include all headers traditionally required for
select().
2007-08-18 16:28:56 +00:00
10dd9aea11 (fltelemstr, fltheadstr): Move from ship.h to sail.c. 2007-08-18 13:48:15 +00:00
198b7760d8 (exec_fd): Useless junk inherited all the way from BSD Empire 1.1.
Remove.
2007-08-18 09:24:05 +00:00
4caa4c6cc9 (setsockopt): Fix type of argument optval to conform to spec. 2007-08-18 07:00:16 +00:00
Ron Koenderink
1a3a7b9837 Add additional includes for compiling in MinGW. 2007-08-17 20:45:55 +00:00
Ron Koenderink
3c7bb12c09 Switch the !__GNUC__ with _MSC_VER to be more reflective of the
purpose.

(strptime) [_WIN32]: Add time.h for extern prototypes.
2007-08-17 20:43:32 +00:00
Ron Koenderink
01625ead8c (tcp_listen, posix_setsockopt) [_WIN32]: Move the special
SO_REUSEADDR code for _WIN32 from tcp_listen() to
posix_setsockopt().

[_WIN32] (posix_open): Switch to _sopen() for _sopen_s() as MinGW
does not support _sopen_s() yet.

[_WIN32] (posix_fd2socket): Fix typo.
2007-08-17 03:11:45 +00:00
Ron Koenderink
b892774785 Include sys/uio.h unconditionally. 2007-08-17 03:06:35 +00:00
Ron Koenderink
af64cfd491 [_WIN32] (readv, writev, iovec): New. POSIX equivalents.
(ioq_makeiov, ioqtoiov): Compile unconditionally.
(io_output): Use POSIX code unconditionally.
[_WIN32] (ioq_makebuf): Remove.
2007-08-16 21:43:20 +00:00
a9c872f006 Back out the previous revision and remove the include of sys/types.h
instead.
2007-08-16 10:41:30 +00:00
Ron Koenderink
3bdad8ce26 For w32misc.h add the POSIX equivalent include file for each
declaration.
2007-08-16 03:15:33 +00:00
Ron Koenderink
222894093d (ssize_t, pid_t) [_WIN32]: Back out the previous revision of unistd.h
and move to w32misc.h instead.  Belong into sys/types.h but we can't
fix system headers.
2007-08-16 03:03:22 +00:00
Ron Koenderink
f835548ee7 Include sys/uio.h unconditionally. 2007-08-15 02:46:08 +00:00
Ron Koenderink
6181fd10bf [_WIN32] Provide POSIX-style sys/socket.h. Use it rather than
winsock2.h.
2007-08-15 02:40:53 +00:00
Ron Koenderink
2863aba452 [_WIN32]: Remove unnecessary <io.h> for WIN32. 2007-08-15 02:18:25 +00:00
Ron Koenderink
c7f940a84e Move WIN32 equivalent function defines to w32/w32misc.h from misc.h.
Move Microsoft C compiler warning to w32/w32misc.h from misc.h.
2007-08-15 02:15:17 +00:00
Ron Koenderink
287aa9d162 (ssize_t, pid_t) [_WIN32]: Move from misc.h to POSIX's location
in unistd.h.
2007-08-15 01:48:40 +00:00
Ron Koenderink
9e1e242b4e (serverio, sendoef) [_WIN32]: For WIN32 use closesocket() instead of
close() as close() is not valid for WIN32 sockets.
2007-08-15 01:18:48 +00:00
Ron Koenderink
9c666a7423 Create w32misc.h to contain information that does not fit in Windows
equivalent include file.
(strptime) [_WIN32]: Add extern for WIN32 equivalent for strptime().
2007-08-15 01:16:26 +00:00
Ron Koenderink
7bb0a04db2 [_WIN32] (S_IRUSR, S_IWUSR, S_IXUSR, S_IRWXU, S_IRGRP, S_IWGRP)
(S_IXGRP, S_IRWXG, S_IROTH, S_IWOTH, S_IXOTH, S_IRWXO): Move from
include/misc.h to new src/lib/w32/unistd.h.
2007-08-14 03:38:18 +00:00
Ron Koenderink
4bbc3f4286 Simple POSIX I/O emulation layer to work around Windows's defective
Unix I/O:
[_WIN32] (socklen_t, accept, posix_accept, bind. posix_bind, listen)
(posix_listen, setsockopt, posix_setsockopt, shutdown, posix_shutdown)
(socket, posix_socket, close, posix_close, creat, fstat, posix_fstat)
(lseek, posix_lseek, open, posix_open, read, posix_read, write)
(posix_write, fileno, posix_fileno, fcntl, O_NONBLOCK, F_RDLCK)
(F_WRLCK, F_GETFL, F_SETFL, F_SETLK, EWOULDBLOCK, ENOTSOCK)
(flock, fsync, posix_fsync):
New.
(ef_open, io_close, io_input, io_output, io_shutdown, io_noblocking)
(player_accept): Use them to simplify.
[_WIN32] (posix_fd2socket): New.
(empth_select): Use it.
(gen_power): Use it.
2007-08-14 03:33:28 +00:00
Ron Koenderink
e7b04123a9 [_WIN32] (posix_mkdir): New.
[_WIN32] (mkdir): Use it.  Last argument is no longer ignored, which
was a bug.  Move declaration to unistd.h, which isn't quite right, but
works for us.
2007-08-14 03:11:26 +00:00
Ron Koenderink
1d438880ff Real unistd.h declares getopt() & friends. Approximate that in
src/lib/w32/unistd.h by including getopt.h.  Simplify users
2007-08-14 00:15:21 +00:00
Ron Koenderink
f11a29b326 Remove bogus _WIN32 conditional. 2007-08-11 19:54:42 +00:00
Ron Koenderink
23571862b3 Now compiled only for Windows, remove unnecessary #if. 2007-08-11 19:07:46 +00:00
Ron Koenderink
2f69a569bd (strptime) [_WIN32]: Provide missing functionality from WIN32.
Source taken from FreeBSD.
2007-08-09 03:44:52 +00:00
e7c9ca1186 (info.html/all.html): Fix to use the full 80 columns for the table.
(info.nr/all): Fix race between ls and output redirection.
2007-08-08 06:15:33 +00:00
6e3da4e1d0 Moving getopt.h to src/lib/w32/ broke the Windows build. Fix. 2007-08-08 05:27:49 +00:00
4b2afc1e95 (xufooter, xubody): Rename some variables. No functional change. 2007-08-05 18:58:36 +00:00
9394ca0630 (xundump): Use malloc() instead of calloc() for fldca and fldidx,
because the used part of these arrays is explicitely initialized by
deffld().
2007-08-05 18:52:16 +00:00
5e65a9dd3c (xufld): Clarify. 2007-08-05 18:47:51 +00:00
b72068a49b (xufldname): Don't bother to catch ... in field 1, because the check
for the required join field catches that.
2007-08-05 18:46:04 +00:00
7d88a783de (defellipsis): Set ellipsis to 1 instead of field number, because all
uses just compare to 0.  Parameter now unused, remove.  Caller
changed.
2007-08-05 18:42:24 +00:00
bfee6962fc Fix fields checks for split tables:
(caseen): Remove.
(xufldhdr, deffld): Record only fields in this part in caflds[].  This
fixes the check for duplicate fields in parts other than the first.
(cafldspp): New, to record fields in previous parts.
(xundump): Initialize and finalize it.
(xufooter): Update it.  Requires new parameter ca.  Caller changed.
(fldval_must_match): Use it to do the right thing for split arrays.
(chkflds): Adapt for changed caflds[].
(chkflds): The check for missing fields was skipped for all parts of a
split table instead of for all but the final part.
2007-08-05 18:38:37 +00:00
26d45adf8a (xufldhdr): ellipsis wasn't cleared for machine-readable input. This
broke reading machine-readable input after reading a split table
failed before seeing the last part.  Luckily, callers never tried
that.
2007-08-05 18:23:09 +00:00
6e2a666882 (xutail): Remove parameter type. Use cur_type instead. Caller
changed.
2007-08-05 17:36:01 +00:00
b8b231be42 (getobj, setnum): Move override of cur_id from getobj() to setnum().
Remove the now unused parameters of getobj().  Callers changed.
2007-08-05 17:34:24 +00:00
94324f7966 (xuheader1, xufldhdr, xutrailer, xufooter, xundump2, xutail)
(xundump1, xubody): Rename.
2007-08-05 17:25:01 +00:00
8fead20ac4 (xundump1, xundump2): Move call of xutrailer() from xundump1() to its
caller xundump2().  Make xundump1() return number of records read for
that.
2007-08-05 17:19:52 +00:00
5a8aea24f4 (xundump1): Remove parameter type. Use cur_type instead. Caller
changed.
2007-08-05 17:05:22 +00:00
b031e34738 (xuheader1, xutrailer, xundump1): Remove unused parameters. Callers
changed.
2007-08-05 17:03:07 +00:00
971515ccc9 (xundump): Count lines in a saner way: pass line number in and out.
Callers changed.
2007-08-05 16:22:41 +00:00
6498d66263 New home for stuff specific to Windows: src/lib/w32/
Move getopt.c getopt.h service.c from src/lib/gen/ there.
(lib/libw32.a): New.
(libs): Add it under Windows.
2007-08-04 05:23:39 +00:00
a1646c8aa7 (gamedir): Not all programs treat relative names the same. Document
the lossage.
2007-08-03 04:44:54 +00:00
f1094fbdc6 Doc fix. 2007-08-03 04:06:18 +00:00
1999751782 (bmaps_intersect): Simplify. No functional change. 2007-08-03 04:05:04 +00:00
Ron Koenderink
2270ea73d8 (fmttime2822) [_WIN32]: Replace localtime_s() with localtime().
Replace _snprintf_s() with _snprintf().  These secure functions are
not supported by MinGW yet.
2007-08-03 01:47:02 +00:00
5545eb4b0a (main): Use the same initial anchor as the server.
(main): Exit unsuccessfully when read_schedule() fails.
2007-08-01 18:23:51 +00:00