#ifdef WINDOWSNT
-/* config.h defines these, which disables sockets altogether! */
+/* ms-w32.h defines these, which disables sockets altogether! */
# undef _WINSOCKAPI_
# undef _WINSOCK_H
return window_app;
}
-/*
- execvp wrapper for Windows. Quotes arguments with embedded spaces.
+/* execvp wrapper for Windows. Quotes arguments with embedded spaces.
This is necessary due to the broken implementation of exec* routines in
the Microsoft libraries: they concatenate the arguments together without
quoting special characters, and pass the result to CreateProcess, with
predictably bad results. By contrast, POSIX execvp passes the arguments
- directly into the argv array of the child process.
-*/
+ directly into the argv array of the child process. */
+
int
w32_execvp (const char *path, char **argv)
{
exit (EXIT_SUCCESS);
}
-/*
- Try to run a different command, or --if no alternate editor is
- defined-- exit with an errorcode.
- Uses argv, but gets it from the global variable main_argv.
-*/
+/* Try to run a different command, or --if no alternate editor is
+ defined-- exit with an errorcode.
+ Uses argv, but gets it from the global variable main_argv. */
+
static _Noreturn void
fail (void)
{
/* Socket used to communicate with the Emacs server process. */
HSOCKET emacs_socket = 0;
-/* On Windows, the socket library was historically separate from the standard
- C library, so errors are handled differently. */
+/* On Windows, the socket library was historically separate from the
+ standard C library, so errors are handled differently. */
+
static void
sock_err_message (const char *function_name)
{
/* The inverse of quote_argument. Removes quoting in string STR by
- modifying the string in place. Returns STR. */
+ modifying the string in place. Returns STR. */
static char *
unquote_argument (char *str)
#endif /* WINDOWSNT */
\f
-/*
- * Read the information needed to set up a TCP comm channel with
- * the Emacs server: host, port, and authentication string.
- */
+/* Read the information needed to set up a TCP comm channel with
+ the Emacs server: host, port, and authentication string. */
+
static int
get_server_config (const char *config_file, struct sockaddr_in *server,
char *authentication)
message (FALSE, "%s: connected to remote socket at %s\n",
progname, inet_ntoa (server.sin_addr));
- /*
- * Open up an AF_INET socket
- */
+ /* Open up an AF_INET socket. */
if ((s = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0)
{
sock_err_message ("socket");
return INVALID_SOCKET;
}
- /*
- * Set up the socket
- */
+ /* Set up the socket. */
if (connect (s, (struct sockaddr *) &server, sizeof server) < 0)
{
sock_err_message ("connect");
setsockopt (s, SOL_SOCKET, SO_LINGER, (char *) &l_arg, sizeof l_arg);
- /*
- * Send the authentication
- */
+ /* Send the authentication. */
auth_string[AUTH_KEY_LENGTH] = '\0';
send_to_emacs (s, "-auth ");
going to sleep. Normally the suspend is initiated by Emacs via
server-handle-suspend-tty, but if the server gets out of sync with
reality, we may get a SIGTSTP on C-z. Handling this signal and
- notifying Emacs about it should get things under control again. */
+ notifying Emacs about it should get things under control again. */
static void
handle_sigtstp (int signalnum)
HSOCKET s;
struct sockaddr_un server;
- /*
- * Open up an AF_UNIX socket in this person's home directory
- */
-
+ /* Open up an AF_UNIX socket in this person's home directory. */
if ((s = socket (AF_UNIX, SOCK_STREAM, 0)) < 0)
{
message (TRUE, "%s: socket: %s\n", progname, strerror (errno));
return FALSE;
}
-/*
- * Search for a window of class "Emacs" and owned by a process with
- * process id = emacs_pid. If found, allow it to grab the focus.
- */
+/* Search for a window of class "Emacs" and owned by a process with
+ process id = emacs_pid. If found, allow it to grab the focus. */
+
void
w32_give_focus (void)
{