44 |
char *getenv (), *getwd (); |
char *getenv (), *getwd (); |
45 |
char *getcwd (); |
char *getcwd (); |
46 |
|
|
|
/* This is defined with -D from the compilation command, |
|
|
which extracts it from ../lisp/version.el. */ |
|
|
|
|
47 |
#ifndef VERSION |
#ifndef VERSION |
48 |
#define VERSION "unspecified" |
#define VERSION "unspecified" |
49 |
#endif |
#endif |
128 |
|
|
129 |
case 'V': |
case 'V': |
130 |
printf ("emacsclient %s\n", VERSION); |
printf ("emacsclient %s\n", VERSION); |
131 |
exit (0); |
exit (EXIT_SUCCESS); |
132 |
break; |
break; |
133 |
|
|
134 |
case 'H': |
case 'H': |
137 |
|
|
138 |
default: |
default: |
139 |
fprintf (stderr, "Try `%s --help' for more information\n", progname); |
fprintf (stderr, "Try `%s --help' for more information\n", progname); |
140 |
exit (1); |
exit (EXIT_FAILURE); |
141 |
break; |
break; |
142 |
} |
} |
143 |
} |
} |
163 |
Editor to fallback to if the server is not running\n\ |
Editor to fallback to if the server is not running\n\ |
164 |
\n\ |
\n\ |
165 |
Report bugs to bug-gnu-emacs@gnu.org.\n", progname); |
Report bugs to bug-gnu-emacs@gnu.org.\n", progname); |
166 |
exit (0); |
exit (EXIT_SUCCESS); |
167 |
} |
} |
168 |
|
|
169 |
/* In NAME, insert a & before each &, each space, each newline, and |
/* In NAME, insert a & before each &, each space, each newline, and |
218 |
if (result == NULL) |
if (result == NULL) |
219 |
{ |
{ |
220 |
perror ("malloc"); |
perror ("malloc"); |
221 |
exit (1); |
exit (EXIT_FAILURE); |
222 |
} |
} |
223 |
return result; |
return result; |
224 |
} |
} |
240 |
} |
} |
241 |
else |
else |
242 |
{ |
{ |
243 |
exit (1); |
exit (EXIT_FAILURE); |
244 |
} |
} |
245 |
} |
} |
246 |
|
|
311 |
{ |
{ |
312 |
fprintf (stderr, "%s: file name or argument required\n", progname); |
fprintf (stderr, "%s: file name or argument required\n", progname); |
313 |
fprintf (stderr, "Try `%s --help' for more information\n", progname); |
fprintf (stderr, "Try `%s --help' for more information\n", progname); |
314 |
exit (1); |
exit (EXIT_FAILURE); |
315 |
} |
} |
316 |
|
|
317 |
/* |
/* |
353 |
{ |
{ |
354 |
fprintf (stderr, "%s: socket-name %s too long", |
fprintf (stderr, "%s: socket-name %s too long", |
355 |
argv[0], socket_name); |
argv[0], socket_name); |
356 |
exit (1); |
exit (EXIT_FAILURE); |
357 |
} |
} |
358 |
|
|
359 |
/* See if the socket exists, and if it's owned by us. */ |
/* See if the socket exists, and if it's owned by us. */ |
388 |
{ |
{ |
389 |
fprintf (stderr, "%s: socket-name %s too long", |
fprintf (stderr, "%s: socket-name %s too long", |
390 |
argv[0], socket_name); |
argv[0], socket_name); |
391 |
exit (1); |
exit (EXIT_FAILURE); |
392 |
} |
} |
393 |
|
|
394 |
sock_status = socket_status (server.sun_path); |
sock_status = socket_status (server.sun_path); |
519 |
} |
} |
520 |
fprintf (out, " "); |
fprintf (out, " "); |
521 |
} |
} |
522 |
|
|
523 |
fprintf (out, "\n"); |
fprintf (out, "\n"); |
524 |
fflush (out); |
fflush (out); |
525 |
|
|
526 |
/* Maybe wait for an answer. */ |
/* Maybe wait for an answer. */ |
527 |
if (nowait) |
if (nowait) |
528 |
return 0; |
return EXIT_SUCCESS; |
529 |
|
|
530 |
if (!eval) |
if (!eval) |
531 |
{ |
{ |
547 |
printf ("\n"); |
printf ("\n"); |
548 |
fflush (stdout); |
fflush (stdout); |
549 |
|
|
550 |
return 0; |
return EXIT_SUCCESS; |
551 |
} |
} |
552 |
|
|
553 |
#endif /* HAVE_SOCKETS */ |
#endif /* HAVE_SOCKETS */ |
569 |
|
|
570 |
/* arch-tag: f39bb9c4-73eb-477e-896d-50832e2ca9a7 |
/* arch-tag: f39bb9c4-73eb-477e-896d-50832e2ca9a7 |
571 |
(do not change this comment) */ |
(do not change this comment) */ |
572 |
|
|
573 |
|
/* emacsclient.c ends here */ |