annotate src/firstfile.c @ 73562:368665ce6f35

Add support for TCP sockets. (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.
author Juanma Barranquero <lekktu@gmail.com>
date Tue, 31 Oct 2006 00:21:19 +0000
parents 3bd95f4f2941
children e90d04cd455a c5406394f567
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
19794
3f3165285c1b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1 /* Mark beginning of data space to dump as pure, for GNU Emacs.
68651
3bd95f4f2941 Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 64770
diff changeset
2 Copyright (C) 1997, 2002, 2003, 2004, 2005,
3bd95f4f2941 Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 64770
diff changeset
3 2006 Free Software Foundation, Inc.
19794
3f3165285c1b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4
3f3165285c1b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5 This file is part of GNU Emacs.
3f3165285c1b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
6
3f3165285c1b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
7 GNU Emacs is free software; you can redistribute it and/or modify
3f3165285c1b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
8 it under the terms of the GNU General Public License as published by
3f3165285c1b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
9 the Free Software Foundation; either version 2, or (at your option)
3f3165285c1b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
10 any later version.
3f3165285c1b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
11
3f3165285c1b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
12 GNU Emacs is distributed in the hope that it will be useful,
3f3165285c1b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
3f3165285c1b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3f3165285c1b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
15 GNU General Public License for more details.
3f3165285c1b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
16
3f3165285c1b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
3f3165285c1b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
18 along with GNU Emacs; see the file COPYING. If not, write to
64084
a8fa7c632ee4 Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 52401
diff changeset
19 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
a8fa7c632ee4 Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 52401
diff changeset
20 Boston, MA 02110-1301, USA. */
19794
3f3165285c1b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
21
3f3165285c1b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
22
3f3165285c1b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
23 #include <config.h>
3f3165285c1b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
24
3f3165285c1b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
25 #ifdef WINDOWSNT
3f3165285c1b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
26 /* See comments in lastfile.c. */
3f3165285c1b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
27 char my_begdata[] = "Beginning of Emacs initialized data";
3f3165285c1b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
28 char my_begbss[1]; /* Do not initialize this variable. */
3f3165285c1b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
29 static char _my_begbss[1];
3f3165285c1b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
30 char * my_begbss_static = _my_begbss;
3f3165285c1b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
31
3f3165285c1b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
32 /* Add a dummy reference to ensure emacs.obj is linked in. */
3f3165285c1b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
33 extern int initialized;
3f3165285c1b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
34 static int * dummy = &initialized;
3f3165285c1b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
35 #endif
3f3165285c1b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
36
52401
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 19794
diff changeset
37 /* arch-tag: a6c0d2dd-00c3-4ba5-95a5-9c8ab82f39b2
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 19794
diff changeset
38 (do not change this comment) */