(decode_options): Don't get EMACS_SERVER_FILE here, it could override command
line options.
(decode_options) [! NO_SOCKETS_IN_FILE_SYSTEM]: Don't parse "-s" option.
(fail): Don't check for missing arguments, it is now done in set_socket.
(file_name_absolute_p): New function (loosely based on the one in fileio.c).
(initialize_sockets): Don't check for duplicate loading of Winsock.
(get_server_config): Only try relative paths in the default directory locations.
(set_tcp_socket): Don't call INITIALIZE(). Warn when connecting to a remote
server.
(set_socket): Call INITIALIZE(). Search explicit command-line arguments, then
environment variable EMACS_SERVER_FILE, then implicit socket paths, before
trying the alternate editor.
(main): Use file_name_absolute_p.
[!WINDOWSNT]: Include <netinet/in.h> if available.
[HAVE_SOCKETS]: Also require HAVE_INET_SOCKETS.
(IOCTL, IOCTL_BOOL_ARG): Remove.
(set_tcp_socket): Don't set the socket in blocking mode. Remove c_arg.
[!WINDOWSNT] <top level>: Include <netinet/in.h> and <sys/ioctl.h>.
(INVALID_SOCKET): Define.
(initialize_sockets): Put #endif at the right place.
(set_local_socket): Use progname, not argv[0].
(SEND_STRING, SEND_QUOTED, HSOCKET, CLOSE_SOCKET, IOCTL, INITIALIZE): New
macros.
(IOCTL_BOOL_ARG): New typedef.
(server_file): New global variable.
(longopts): New option --server-file.
(decode_options): Process new option --server-file and environment variable
EMACS_SERVER_FILE.
(print_help_and_exit): Document new option.
(fail): If no connection available and no alternate editor, suggest using
options to make them explicit.
(AUTH_KEY_LENGTH, SEND_BUFFER_SIZE): New constants.
(send_buffer, sblen): New variables.
(send_to_emacs): New function to buffer output and send it with send().
(quote_file_name): Use SEND_STRING.
(close_winsock, initialize_sockets): New functions to load and unload Winsock.
(get_server_config, set_tcp_socket): New functions to create and set up TCP
sockets.
(set_local_socket): New function to create and set up Unix socket (code moved
from previous implementation).
(set_socket): New function to chose between TCP and Unix sockets.
(main): Use SEND_STRING and SEND_QUOTED. Most code moved to set_local_socket.
Use set_socket. Get answers from server.el with recv(), not file stream
functions.
It's XEmacs, not Xemacs: change all the occurences.
[ETAGS_REGEXPS]: Now is unconditionally defined.
[LONG_OPTIONS]: Changed to NO_LONG_OPTIONS, which is undefined.
(Objc_suffixes): Suggest using --lang=c for full help.
(C_entries): Initialise savetoken to 0 to shut up the compiler.