* ../etc/gnuserv.README relative to the directory containing this file)
*/
-#if 0
-/* Hand-munged RCS header */
-static char rcsid [] = "!Header: gnuclient.c,v 2.2 95/12/12 01:39:21 wing nene !";
+#ifdef CYGWIN
+extern void cygwin_conv_to_posix_path(const char *path, char *posix_path);
#endif
#include "gnuserv.h"
+
+char gnuserv_version[] = "gnuclient version " GNUSERV_VERSION;
+
#include "getopt.h"
#include <stdio.h>
signal(SIGCONT, tell_emacs_to_resume);
#endif
- connect_type = make_connection (NULL, (u_short) 0, &s);
+ connect_type = make_connection (NULL, 0, &s);
sprintf(buffer,"(gnuserv-eval '(resume-pid-console %d))", (int)getpid());
send_string(s, buffer);
{
if (cp == NULL)
{ /* haven't calculated it yet */
-#ifdef BSD
- if (getwd (cwd) == 0)
-#else /* !BSD */
+#ifdef HAVE_GETCWD
if (getcwd (cwd,MAXPATHLEN) == NULL)
-#endif /* !BSD */
+#else
+ if (getwd (cwd) == 0)
+#endif /* HAVE_GETCWD */
{
perror (progname);
fprintf (stderr, "%s: unable to get current working directory\n",
/* fullpath - returned full pathname */
/* filename - filename to expand */
{
- int len;
+#ifdef CYGWIN
+ char cygwinFilename[MAXPATHLEN+1];
+#endif
+ int len;
fullpath[0] = '\0';
+#ifdef CYGWIN
+ /*
+ If we're in cygwin, just convert it and let the unix stuff handle it.
+ */
+ cygwin_conv_to_posix_path(filename, cygwinFilename);
+ filename = cygwinFilename;
+#endif
+
if (filename[0] && filename[0] == '/')
{
/* Absolute (unix-style) pathname. Do nothing */
strcat (fullpath, filename);
}
-#ifdef CYGWIN
- else if (filename[0] && filename[0] == '\\' &&
- filename[1] && filename[1] == '\\')
- {
- /* This path includes the server name (something like
- "\\server\path"), so we assume it's absolute. Do nothing to
- it. */
- strcat (fullpath, filename);
- }
- else if (filename[0] &&
- filename[1] && filename[1] == ':' &&
- filename[2] && filename[2] == '\\')
- {
- /* Absolute pathname with drive letter. Convert "<drive>:"
- to "//<drive>/". */
- strcat (fullpath, "//");
- strncat (fullpath, filename, 1);
- strcat (fullpath, &filename[2]);
- }
-#endif
else
{
/* Assume relative Unix style path. Get the current directory
char *path;
int rflg = 0; /* pathname given on cmdline */
char *portarg;
- u_short port = 0; /* port to server */
+ unsigned short port = 0; /* port to server */
#endif /* INTERNET_DOMAIN_SOCKETS */
#ifdef SYSV_IPC
struct msgbuf *msgp; /* message */
#if defined(INTERNET_DOMAIN_SOCKETS)
connect_type = make_connection (hostarg, port, &s);
#else
- connect_type = make_connection (NULL, (u_short) 0, &s);
+ connect_type = make_connection (NULL, 0, &s);
#endif
sprintf (command, "(gnuserv-eval%s '(progn ", quick ? "-quickly" : "");
send_string (s, command);
#if defined(INTERNET_DOMAIN_SOCKETS)
connect_type = make_connection (hostarg, port, &s);
#else
- connect_type = make_connection (NULL, (u_short) 0, &s);
+ connect_type = make_connection (NULL, 0, &s);
#endif
sprintf (command, "(gnuserv-eval%s '(progn ", quick ? "-quickly" : "");
send_string (s, command);
#if defined(INTERNET_DOMAIN_SOCKETS)
connect_type = make_connection (hostarg, port, &s);
#else
- connect_type = make_connection (NULL, (u_short) 0, &s);
+ connect_type = make_connection (NULL, 0, &s);
#endif
send_string (s, "(gnuserv-eval '(emacs-pid))");
send_string (s, EOT_STR);
#if defined(INTERNET_DOMAIN_SOCKETS)
connect_type = make_connection (hostarg, port, &s);
#else
- connect_type = make_connection (NULL, (u_short) 0, &s);
+ connect_type = make_connection (NULL, 0, &s);
#endif
#ifdef INTERNET_DOMAIN_SOCKETS
}
else /* !suppress_windows_system */
{
- if (display)
+ if (0)
+ ;
+#ifdef HAVE_X_WINDOWS
+ else if (display)
sprintf (command, "(gnuserv-edit-files '(x %s) '(",
clean_string (display));
+#endif
+#ifdef HAVE_GTK
+ else if (display)
+ strcpy (command, "(gnuserv-edit-files '(gtk nil) '(");
+#endif
#ifdef HAVE_MS_WINDOWS
else
sprintf (command, "(gnuserv-edit-files '(mswindows nil) '(");