Commit graph

39 commits

Author SHA1 Message Date
73e25ff21e Update copyright notice 2010-01-19 08:40:17 +01:00
518c8d6fbf Empty out and remove sysdep_w32.c sysdep_w32.h
Not much remains in sysdep_w32.c, and it's mostly for main.c.  Move
that there, and the rest to misc.h.
2009-12-05 15:19:37 +01:00
dfb6620203 Autoconfigure use of terminfo
New configure --with-terminfo.  Before, terminfo was assumed to be
available everywhere but on Windows.
2009-04-19 15:42:19 +02:00
e049ad6a56 Declare getsose() & friends in one place 2009-04-19 15:25:45 +02:00
8cbcfefda1 Clean up useless declarations
Commit fbf9f15b removed SO, SE, but left their declarations behind.
Ditto commit 3aea20e1 for bigcity_dchr, and commit 08b94556 for
player_kill_idle.

Commit afa65c8f accidentally added a declaration for xedit().
2009-03-28 13:04:48 +01:00
35ef345ecb Update copyright notice 2009-02-08 09:33:18 +01:00
d702068457 Fix trailing whitespace 2008-09-17 21:31:40 -04:00
db02dda32f Update copyright notice 2008-01-19 10:15:37 +01:00
225f0f5132 (parseid): New, factored out of recvline() and recv_output().
(recvline, recv_output): Use it.
2007-12-14 07:44:12 +00:00
Ron Koenderink
f082ef9fa6 (w32_getpw, w32_socket, w32_connect, w32_recv, w32_send,
w32_writev_socket, w32_close_socket, getpass, w32_openfd,
w32_openhandle, w32_readv_handle, w32_close_handle,
sysdep_init, sysdep_stdin_init, w32_select, w32_signal_handler,
sigaction, stdin_read_thread, w32_ring_from_file_to_bounce_buf)
[_WIN32]: New w32 equivalent functions for POSIX functions.
(recvline, sendcmd, tcp_connect, hostconnect, getpass,
main, intr, play, ring_to_file, ring_from_file, doexecute,
doredir) [_WIN32]: Use new WIN32 equivalent functions.
(main) [_WIN32]: Add sysdep_init() to support system dependent
initialization for equivalence functions.
(play) [_WIN32]: Add sysdef_stdin_init() to support system
dependent initialization for reading stdin.
(recv_input, play) [_WIN32]: Replace the calls to ring_to_file()
and select() with WIN32 specific enhanced versions.

Makefile.in: update dependencies with new files.
Make.mk: Add using of getopt.c and getopt.h
from src/lib/w32 directory.  Add getopt.c and getopt.h
to tar for client.
2007-12-11 22:00:25 +00:00
2dbc45eff7 Flaws in the Empire protocol make redirections within execute next to
impossible to implement correctly, and nested execute practically
useless (#116377).  Catch and refuse those:
(executing): New.
(doexecute, prompt): Set and clear it.
(redir_authorized): Reject if set.
(doexecute, play): Don't signal doexecute() failure through input_fd,
because that screws up up when we're executing already.  Increment
send_eof in doexecute() instead.
(send_eof): External linkage.
2007-11-28 07:10:27 +00:00
8b7d0b915d Rewrite much of client's playing phase code:
(EOF_COOKIE, INTR_COOKIE, input_fd, send_intr, recv_output)
(recv_input, intr, play): New playing phase code.  No native Windows
support yet.  Sends just one EOF cookie on EOF on standard input
instead of up to three.  Old servers (before recvclient.c rev. 1.16)
fail to terminate the session when they receive an EOF cookie at an
argument prompt.  The session then hangs; use SIGINT to get out.  No
longer blocks on sending input, which could deadlock the session.
Closes #827090.  Fixes error handling for select().  Fixes race
condition that could cause server output to be discarded on EOF on
standard input.
(main): Replace old playing phase code by a call to play().
(intr, sock, interrupt, handleintr): Replaced by play(), remove.
[_WIN32] (hStdIn): Ditto.
(auxfp): New.
(servercmd, prompt, doexecute): Remove parameter auxfi, use auxfp.
(eight_bit_clean): Move to servcmd.c.
(servercmd): Work on a single non-C_DATA line instead of getting lines
from an ioqueue.
(servercmd, output, screen, outch): Deal with all ids in servercmd()
rather than some there and some in output().  Don't treat C_NOECHO,
C_ABORT, C_CMDERR, C_BADCMD specially.  Fix C_FLASH and C_EXIT to
ignore redirections; they used to ignore them only for some parts.
Replace output() by outch(), fold screen into outch().
(servercmd): Truncate long prompts and telegram infos to prevent
buffer overflow.
(prompt): Use new parameters code, prompt, teles instead of global
variables mode, the_prompt, num_teles.
(num_teles, the_prompt, mode, nbtu, nmin): Remove.
(prompt): Don't write an empty line before argument prompts to auxfp.
(servercmd): Don't strip newline from redirections and execute,
doredir(), dopipe() and doexecute() need it now.
(doredir, dopipe, doexecute): Use new seen_input() instead of gettag().
(doexecute): Set input_fd and leave reading the script file to play().
(serverio, termio, sendeof): Replaced by play(), remove.
(LBUF_LEN_MAX, lbuf, lbuf_init, lbuf_len, lbuf_full, lbuf_line)
(lbuf_putc): New.
(RING_SIZE, ring, ring_init, ring_len, ring_space, ring_peek)
(ring_getc, ring_putc, ring_putm, ring_discard, ring_search)
(ring_from_file, ring_to_file): New.
(clear_recent_input, save_input, seen_input): New.
(MAX): New.
(ioqueue, io, ioq_init, ioq_dequeue, ioq_read, ioq_write, ioq_qsize)
(ioq_drain, ioq_gets, ioqtobuf, enqueuecc, dequeuecc): Unused, remove.
(QEMPTY, qelem, insque, remque, initque): Unused, remove.
(tagstruct, taglist, io_init, gettag): Unused, remove.
2007-11-17 14:17:38 +00:00
b631cf944f (saveargv): Lame attempt at protecting users who foolishly specify
passwords on the command line.  Antisocially zaps the complete command
line, not just the password.  Remove, at least for now.
(main): Update accordingly.
2007-11-16 20:27:09 +00:00
63bdc89835 Update copyright notice. 2007-01-09 19:09:31 +00:00
e42053d928 Break inclusion cycle: prototypes.h and commands.h included each
other.  Ensure headers in include/ can be included in any order
(except for econfig-spec.h, which is special).  New header types.h to
help avoid inclusion cycles.  Sort include directives.  Remove some
superflous includes.
2006-07-10 06:37:23 +00:00
7aaf8f26b3 (coord): Unused & inappropriate, remove. 2006-07-10 04:57:03 +00:00
2ae6be9af6 (num_teles, redir_fp, pipe_fp, exec_fd, sendeof, prompt, command)
(ac_intercept, all_missiles, ac_planedamage, ac_doflak, ac_landflak)
(ac_shipflak, ac_fireflak, can_fly, do_evade, att_calcodds)
(emp_setbitmap, lnd_hit_mine, conditions, get_wp, daemonize): Internal
linkage.
2006-05-20 13:54:45 +00:00
Ron Koenderink
1a539f9128 (main) [_WIN32]: Upgrade to winsock version 2.
Remove version 1.1 include files.
2006-02-05 15:47:13 +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
3e400c018c Update copyright notice. 2006-01-05 13:36:57 +00:00
fa52e6944d Normalize inclusion guards: use NAME_H for name.h. Some headers
lacked them, others used reserved identifiers.
2005-12-29 10:16:01 +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
87ace6afe4 (handleintr): Move to main.c. Internal linkage. Remove empty
handle.c
(interrupt): Internal linkage.

(interrupt): Use proper type for access from signal handler.
(intr): Don't increment to set, it's unobvious and it could overflow.
2005-12-28 16:16:41 +00:00
Ron Koenderink
8b934d615b (hStdIn) [_WIN32]: Add extern to declaration. 2005-12-25 00:51:55 +00:00
Ron Koenderink
02693bb59b (prompt,dopipe) [_WIN32]: Enable the pipe capability. 2005-07-23 21:44:00 +00:00
fbf9f15bbb (getsose): Port from obsolete termcap to terminfo. The old code
manually stripped off padding, which is evil.  The new code does
nothing when the stdout is not connected to a terminal.
(SO, smso, SE, rmso): Rename, static linkage.
(putso, putse): New.
(screen): Use it.
2005-06-04 13:03:16 +00:00
7ef7aa83b8 Client UTF-8 support.
(login): New parameter utf8.  If set, request option utf-8 from
server.
(expect, recvline): Split recvline() out of expect().  Replace or
remove some unhelpful diagnostics.
(eight_bit_clean): New.
(screen): If eight_bit_clean is set, highlighting is switched with
SO/SI.  Else characters with MSB set are highlighted.
(main): New option -u to request UTF-8 and set eight_bit_clean.
2005-05-27 17:00:25 +00:00
801d32783d (sendcmd): Change argument cmd to string. Callers changed.
(fnlist, fn, USER, COUN, QUIT, PASS, PLAY, LIST, CMD, CTLD, KILL):
Unused, remove.
2005-05-26 13:18:58 +00:00
345ad3dfe0 Update copyright notice. 2005-03-16 22:03:16 +00:00
Marc Olzheim
6a99690e4e Get rid of "s_char", "register" and 0 used instead of NULL in the
client source.  No functional changes.
2005-03-15 21:47:41 +00:00
fac342ed49 Update copyright notice. 2004-09-07 15:07:16 +00:00
4dc46b1810 (fnlist): Move from misc.h to fnlist.h, where it belongs and has
complete type.
2004-02-24 18:34:25 +00:00
e7811102a3 Declare tags.c variables in tags.h. Declare stuff with external
linkage that is not in any other header in misc.h.  Remove some
redundant declarations elsewhere.
(prompt, doredir, dopipe, doexecute, output, screen, parsedelay):
Static linkage.
2004-02-20 08:22:28 +00:00
4ce5f988d0 Portability fixes: don't declare library functions, include
appropriate headers.  Also remove some unused declarations.
2004-01-15 13:43:50 +00:00
64afd7747b (index, rindex): Obsolete BSDisms; remove. Use standard strchr() and
strrchr() instead.
(setbuffer): Obsolete BSDism, unused; remove.
2004-01-08 18:15:13 +00:00
d0feb8570a (copy, atopi, same): Remove, use strcpy(), atoi(), strcmp(). Callers
changed.  Remove empty source files.
2004-01-08 10:20:44 +00:00
d8cb7c48f0 Cosmetics. 2003-12-17 21:26:26 +00:00
9b7adfbecc Indented with src/scripts/indent-emp. 2003-09-02 20:48:48 +00:00
d8b7fdfae1 Import of Empire 4.2.12 2003-08-23 12:23:04 +00:00