with `EXIT_SUCCESS'. Likewise, replace 1 with `EXIT_FAILURE'.
(main): Use `EXIT_SUCCESS' or `EXIT_FAILURE' for return value.
+2004-05-09 Thien-Thi Nguyen <ttn@gnu.org>
+
+ * cvtmail.c: Throughout, replace 0 destined for `exit' arg
+ with `EXIT_SUCCESS'. Likewise, replace 1 with `EXIT_FAILURE'.
+ (main): Use `EXIT_SUCCESS' or `EXIT_FAILURE' for return value.
+
+ * ebrowse.c, emacsclient.c, emacsserver.c, fakemail.c,
+ hexl.c, make-docfile.c, movemail.c, profile.c, sorted-doc.c,
+ test-distrib.c, yow.c: Likewise.
+
2004-05-08 Thien-Thi Nguyen <ttn@gnu.org>
* etags.c: [VMS] Include lib$routines.h.
*
* In order to get rmail to read the messages, the resulting file must
* be mv'ed to ~/mbox, and then have rmail invoked on them.
- *
+ *
* Author: Larry Kolodney, 1985
*/
}
}
fclose (mddf);
- fclose (mfilef);
- return 0;
+ fclose (mfilef);
+ return EXIT_SUCCESS;
}
void
char *s1, *s2;
{
error (s1, s2);
- exit (1);
+ exit (EXIT_FAILURE);
}
void
{
fprintf (stderr, "cvtmail: ");
perror (s);
- exit (1);
+ exit (EXIT_FAILURE);
}
char *
fatal ("virtual memory exhausted", 0);
return result;
}
+
+/* cvmtmail.c ends here */
Author: Gerd Moellmann <gerd@gnu.org>
Maintainer: FSF
-
+
This file is part of GNU Emacs.
GNU Emacs is free software; you can redistribute it and/or modify
#define BUFFER_POS() (in - inbuffer)
-/* If current lookahead is CSTRING, the following points to the
+/* If current lookahead is CSTRING, the following points to the
first character in the string constant. Used for recognizing
extern "C". */
if (p == NULL)
{
yyerror ("out of memory", NULL);
- exit (1);
+ exit (EXIT_FAILURE);
}
return p;
}
if (p == NULL)
{
yyerror ("out of memory", NULL);
- exit (1);
+ exit (EXIT_FAILURE);
}
return p;
}
{
lnk = (struct link *) xmalloc (sizeof *lnk);
lnk2 = (struct link *) xmalloc (sizeof *lnk2);
-
+
lnk->sym = sub;
lnk->next = p;
case SC_FRIEND:
list = &cls->friends;
break;
-
+
case SC_TYPE:
list = &cls->types;
break;
-
+
case SC_STATIC:
list = var ? &cls->static_vars : &cls->static_fns;
break;
-
+
default:
list = var ? &cls->vars : &cls->fns;
break;
a bit set giving additional information about the member (see the
F_* defines). */
-void
+void
add_global_decl (name, regexp, pos, hash, var, sc, flags)
char *name, *regexp;
int pos;
case SC_FRIEND:
list = &cls->friends;
break;
-
+
case SC_TYPE:
list = &cls->types;
break;
-
+
case SC_STATIC:
list = var ? &cls->static_vars : &cls->static_fns;
break;
-
+
default:
list = var ? &cls->vars : &cls->fns;
break;
struct sym *context;
{
struct sym *p = NULL;
-
+
for (p = all_namespaces; p; p = p->next)
{
if (streq (p->name, name) && (p->namesp == context))
return p;
}
-
+
/* Find namespace alias with name NAME. If not found return NULL. */
size * sizeof *namespace_stack);
namespace_stack_size = size;
}
-
+
namespace_stack[namespace_sp++] = current_namespace;
current_namespace = p;
}
struct sym *p;
{
int len;
-
+
if (p->namesp)
sym_scope_1 (p->namesp);
ensure_scope_buffer_room (len + 1);
strcat (scope_buffer, p->name);
scope_buffer_len += len;
-
+
if (HAS_FLAG (p->flags, F_TEMPLATE))
{
ensure_scope_buffer_room (3);
strcat (scope_buffer, "<>");
scope_buffer_len += 2;
}
-
+
return scope_buffer;
}
scope_buffer_size = 1024;
scope_buffer = (char *) xmalloc (scope_buffer_size);
}
-
+
*scope_buffer = '\0';
scope_buffer_len = 0;
-
+
if (p->namesp)
sym_scope_1 (p->namesp);
{
fputs (CLASS_STRUCT, fp);
PUTSTR (root->name, fp);
-
+
/* Print scope, if any. */
if (root->namesp)
PUTSTR (sym_scope (root), fp);
else
PUTSTR (NULL, fp);
-
+
/* Print flags. */
fprintf (fp, "%u", root->flags);
PUTSTR (root->filename, fp);
add_define (yytext, regexp, pos);
}
}
-
+
while (c && (c != '\n' || in_comment || in_string))
{
if (c == '\\')
}
else if (c == '"')
in_string = !in_string;
-
+
if (c == '\n')
INCREMENT_LINENO;
{
in = inbuffer;
yyline = 1;
-
+
if (yytext == NULL)
{
int size = 256;
case '{':
close = '}';
break;
-
+
case '(':
close = ')';
break;
-
+
case '<':
close = '>';
break;
-
+
case '[':
close = ']';
break;
-
+
default:
abort ();
}
{
switch (LA1)
{
- /* Skip over grouping parens or parameter lists in parameter
+ /* Skip over grouping parens or parameter lists in parameter
declarations. */
case '(':
skip_matching ();
{
char *last_id;
unsigned ident_type_hash = 0;
-
+
parse_qualified_param_ident_or_type (&last_id);
if (last_id)
{
case DOUBLE: case ENUM: case FLOAT: case INT:
case LONG: case SHORT: case SIGNED: case STRUCT:
case UNION: case UNSIGNED: case VOLATILE: case WCHAR:
- case ELLIPSIS:
+ case ELLIPSIS:
type_seen = 1;
hash = (hash << 1) ^ LA1;
MATCH ();
if (LOOKING_AT (')'))
{
MATCH ();
-
+
if (LOOKING_AT (CONST))
{
/* We can overload the same function on `const' */
case EXPLICIT:
SET_FLAG (flags, F_EXPLICIT);
goto typeseen;
-
+
case MUTABLE:
SET_FLAG (flags, F_MUTABLE);
goto typeseen;
{
regexp = matching_regexp ();
pos = BUFFER_POS ();
-
+
if (cls != NULL)
{
if (type_seen || !paren_seen)
add_member_decl (cls, id, regexp, pos, hash, 0, sc, vis, 0);
}
}
-
+
MATCH ();
print_info ();
}
parse_classname ()
{
struct sym *last_class = NULL;
-
+
while (LOOKING_AT (IDENT))
{
last_class = add_sym (yytext, last_class);
skip_matching ();
SET_FLAG (last_class->flags, F_TEMPLATE);
}
-
+
if (!LOOKING_AT (DCOLON))
break;
-
+
MATCH ();
}
static char *id = NULL;
char *s;
int len;
-
+
MATCH ();
if (LOOKING_AT2 (NEW, DELETE))
s = token_string (LA1);
MATCH ();
-
+
len = strlen (s) + 10;
if (len > id_size)
{
{
strcat (id, "[");
MATCH ();
-
+
if (LOOKING_AT (']'))
{
strcat (id, "]");
char *id = NULL;
size_t id_size = 0;
int enter = 0;
-
+
while (LOOKING_AT (IDENT))
{
int len = strlen (yytext) + 1;
settings. */
if ((tag != CLASS && !f_structs) || (nested && !f_nested_classes))
current = NULL;
- else
+ else
{
current = add_sym (yytext, containing);
current->pos = BUFFER_POS ();
{
switch (LA1)
{
- case VIRTUAL: case PUBLIC: case PROTECTED: case PRIVATE:
+ case VIRTUAL: case PUBLIC: case PROTECTED: case PRIVATE:
MATCH ();
break;
sc = SC_TYPE;
MATCH ();
break;
-
+
case STATIC:
sc = SC_STATIC;
MATCH ();
else
add_global_defn (id, regexp, pos, 0, 1, sc, flags);
}
-
+
MATCH ();
print_info ();
}
for (;;)
{
char *prev_in = in;
-
+
switch (LA1)
{
case NAMESPACE:
{
char *namespace_name = xstrdup (yytext);
MATCH ();
-
+
if (LOOKING_AT ('='))
{
struct link *qna = match_qualified_namespace_alias ();
if (qna)
register_namespace_alias (namespace_name, qna);
-
+
if (skip_to (';') == ';')
MATCH ();
}
{
/* This is `extern "C"'. */
MATCH ();
-
+
if (LOOKING_AT ('{'))
{
MATCH ();
SET_FLAG (flags, F_EXTERNC);
}
break;
-
+
case TEMPLATE:
MATCH ();
SKIP_MATCHING_IF ('<');
case '}':
return 0;
-
+
default:
declaration (flags);
flags = start_flags;
{
char *start = path_list;
struct search_path *p;
-
+
while (*path_list && *path_list != PATH_LIST_SEPARATOR)
++path_list;
-
+
p = (struct search_path *) xmalloc (sizeof *p);
p->path = (char *) xmalloc (path_list - start + 1);
memcpy (p->path, start, path_list - start);
static int buffer_size;
struct search_path *path;
int flen = strlen (file) + 1; /* +1 for the slash */
-
+
filename = xstrdup (file);
for (path = search_path; path && fp == NULL; path = path->next)
buffer_size = max (len + 1, 2 * buffer_size);
buffer = (char *) xrealloc (buffer, buffer_size);
}
-
+
strcpy (buffer, path->path);
strcat (buffer, "/");
strcat (buffer, file);
fp = fopen (buffer, "r");
}
-
+
/* Try the original file name. */
if (fp == NULL)
fp = fopen (file, "r");
if (fp == NULL)
yyerror ("cannot open", NULL);
-
+
return fp;
}
int error;
{
puts (USAGE);
- exit (error ? 1 : 0);
+ exit (error ? EXIT_FAILURE : EXIT_SUCCESS);
}
printf ("ebrowse %s\n", VERSION);
puts ("Copyright (C) 1992-1999, 2000, 2001 Free Software Foundation, Inc.");
puts ("This program is distributed under the same terms as Emacs.");
- exit (0);
+ exit (EXIT_SUCCESS);
}
char *file;
{
FILE *fp;
-
+
fp = open_file (file);
if (fp)
- {
+ {
int nread, nbytes;
/* Give a progress indication if needed. */
inbuffer_size = nread + READ_CHUNK_SIZE + 1;
inbuffer = (char *) xrealloc (inbuffer, inbuffer_size);
}
-
+
nbytes = fread (inbuffer + nread, 1, READ_CHUNK_SIZE, fp);
if (nbytes <= 0)
break;
buffer[i++] = c;
}
-
+
if (c == EOF && i == 0)
return NULL;
-
+
if (i == buffer_size)
{
buffer_size = max (100, buffer_size * 2);
case 'p':
info_position = atoi (optarg);
break;
-
+
case 'n':
f_nested_classes = 0;
break;
case 'x':
f_regexps = 0;
break;
-
+
/* Add the name of a file containing more input files. */
case 'f':
if (n_input_files == input_filenames_size)
yyerror ("error getting size of file `%s'", out_filename);
else if (rc == 0)
yyerror ("file `%s' is empty", out_filename);
-
+
fclose (fp);
}
-
+
yyout = fopen (out_filename, f_append ? "a" : "w");
if (yyout == NULL)
{
yyerror ("cannot open output file `%s'", out_filename);
- exit (1);
+ exit (EXIT_FAILURE);
}
}
for (i = 0; i < n_input_files; ++i)
{
FILE *fp = fopen (input_filenames[i], "r");
-
+
if (fp == NULL)
yyerror ("cannot open input file `%s'", input_filenames[i]);
else
if (yyout != stdout)
fclose (yyout);
- return 0;
+ return EXIT_SUCCESS;
}
-
/* ebrowse.c ends here. */
#include <../src/config.h>
#undef signal
-#include <ctype.h>
+#include <ctype.h>
#include <stdio.h>
#include <getopt.h>
#ifdef HAVE_UNISTD_H
break;
alternate_editor = getenv ("ALTERNATE_EDITOR");
-
+
switch (opt)
{
case 0:
/* If getopt returns 0, then it has already processed a
long-named option. We should do nothing. */
break;
-
+
case 'a':
alternate_editor = optarg;
break;
-
+
case 'n':
nowait = 1;
break;
case 'V':
fprintf (stderr, "emacsclient %s\n", VERSION);
- exit (1);
+ exit (EXIT_FAILURE);
break;
case 'H':
progname);
fprintf (stderr,
"Report bugs to bug-gnu-emacs@gnu.org.\n");
- exit (1);
+ exit (EXIT_FAILURE);
}
/* Return a copy of NAME, inserting a &
}
*q++ = 0;
-
+
return copy;
}
if (result == NULL)
{
perror ("malloc");
- exit (1);
+ exit (EXIT_FAILURE);
}
return result;
}
}
else
{
- exit (1);
+ exit (EXIT_FAILURE);
}
}
-
+
\f
#if !defined (HAVE_SOCKETS) && !defined (HAVE_SYSVIPC)
if (argc - optind < 1)
print_help_and_exit ();
- /*
+ /*
* Open up an AF_UNIX socket in this person's home directory
*/
perror ("socket");
fail (argc, argv);
}
-
+
server.sun_family = AF_UNIX;
{
our euid. If so, look for a socket based on the UID
associated with the name. This is reminiscent of the logic
that init_editfns uses to set the global Vuser_full_name. */
-
+
char *user_name = (char *) getenv ("LOGNAME");
if (!user_name)
user_name = (char *) getenv ("USER");
-
+
if (user_name)
{
struct passwd *pw = getpwnam (user_name);
}
}
}
-
+
switch (sock_status)
{
case 1:
fail (argc, argv);
}
break;
-
+
case 2:
/* `stat' failed */
if (errno == ENOENT)
the first line we read will actually be the output we just sent.
We can't predict whether that will happen, so if it does, we
detect it by recognizing `Client: ' at the beginning. */
-
+
while (str = fgets (string, BUFSIZ, in))
printf ("%s", str);
if ((homedir = getenv ("HOME")) == NULL)
{
fprintf (stderr, "%s: No home directory\n", argv[0]);
- exit (1);
+ exit (EXIT_FAILURE);
}
strcpy (buf, homedir);
#ifndef HAVE_LONG_FILE_NAMES
{
fprintf (stderr, "%s: ", argv[0]);
perror ("msgget");
- exit (1);
+ exit (EXIT_FAILURE);
}
/* Determine working dir, so we can prefix it to all the arguments. */
/* Maybe wait for an answer. */
if (nowait)
- return 0;
+ return EXIT_SUCCESS;
printf ("Waiting for Emacs...");
fflush (stdout);
printf ("\n");
if (*buf)
printf ("%s\n", buf);
- exit (0);
+ exit (EXIT_SUCCESS);
}
#endif /* HAVE_SYSVIPC */
}
#endif /* ! HAVE_STRERROR */
+
+/* emacsclient.c ends here */
{
fprintf (stderr, "Sorry, the Emacs server is supported only on systems\n");
fprintf (stderr, "with Berkeley sockets or System V IPC.\n");
- exit (1);
+ exit (EXIT_FAILURE);
}
#else /* HAVE_SOCKETS or HAVE_SYSVIPC */
char *s1, *s2;
{
error (s1, s2);
- exit (1);
+ exit (EXIT_FAILURE);
}
/* Like malloc but get fatal error if memory is exhausted. */
if (openfiles == 0)
abort ();
- /*
+ /*
* Open up an AF_UNIX socket in this person's home directory
*/
if ((s = socket (AF_UNIX, SOCK_STREAM, 0)) < 0)
{
perror_1 ("socket");
- exit (1);
+ exit (EXIT_FAILURE);
}
server.sun_family = AF_UNIX;
if (unlink (server.sun_path) == -1 && errno != ENOENT)
{
perror_1 ("unlink");
- exit (1);
+ exit (EXIT_FAILURE);
}
-#else
+#else
if ((homedir = getenv ("HOME")) == NULL)
fatal_error ("No home directory\n");
if (bind (s, (struct sockaddr *) &server, strlen (server.sun_path) + 2) < 0)
{
perror_1 ("bind");
- exit (1);
+ exit (EXIT_FAILURE);
}
/* Only this user can send commands to this Emacs. */
if (stat (server.sun_path, &statbuf) < 0)
{
perror_1 ("bind");
- exit (1);
+ exit (EXIT_FAILURE);
}
chmod (server.sun_path, statbuf.st_mode & 0600);
if (listen (s, 5) < 0)
{
perror_1 ("listen");
- exit (1);
+ exit (EXIT_FAILURE);
}
/* Disable sigpipes in case luser kills client... */
fflush (infile);
/* If command is close, close connection to client. */
- if (strncmp (code, "Close:", 6) == 0)
- if (infd > 2)
+ if (strncmp (code, "Close:", 6) == 0)
+ if (infd > 2)
{
fclose (infile);
close (infd);
}
continue;
- }
+ }
}
}
if (s == -1)
{
perror_1 ("msgget");
- exit (1);
+ exit (EXIT_FAILURE);
}
/* Fork so we can close connection even if parent dies */
msgctl (s, IPC_RMID, 0);
if (p > 0)
kill (p, SIGKILL);
- exit (0);
+ exit (EXIT_SUCCESS);
}
signal (SIGTERM, msgcatch);
signal (SIGINT, msgcatch);
if (kill (p, 0) < 0)
{
msgctl (s, IPC_RMID, 0);
- exit (0);
+ exit (EXIT_SUCCESS);
}
sleep (10);
}
msgp->mtype = 1;
msgsnd (s, msgp, strlen (msgp->mtext) + 1, 0);
}
- exit (1);
+ exit (EXIT_FAILURE);
}
/* In the process c1,
continue;
#endif
perror_1 ("msgrcv");
- exit (1);
+ exit (EXIT_FAILURE);
}
else
{
{
fprintf (stderr, "%s", "Error: ");
fprintf (stderr, string);
- exit (1);
+ exit (EXIT_FAILURE);
}
#endif /* HAVE_SOCKETS or HAVE_SYSVIPC */
+
+/* emacsserver.c ends here */
struct header_record *previous;
};
typedef struct header_record *header;
-
+
struct stream_record
{
FILE *handle;
char *s1, *s2;
{
error (s1, s2);
- exit (1);
+ exit (EXIT_FAILURE);
}
/* Like malloc but get fatal error if memory is exhausted. */
}
/* Read a line of text from `stream' into `linebuffer'.
- * Return the length of the line.
+ * Return the length of the line.
*/
long
no_problems = (no_problems &&
((*rem->action) (rem->handle) == 0));
the_streams = ((stream_list) NULL);
- return (no_problems ? 0 : 1);
+ return (no_problems ? EXIT_SUCCESS : EXIT_FAILURE);
}
void
*where = '\0';
return;
}
-\f
+\f
/* Read lines from the input until we get a blank line.
Create a list of `header' objects, one for each header field,
each of which points to a list of `line_list' objects,
one for each line in that field.
Continuation lines are grouped in the headers they continue. */
-
+
header
read_header ()
{
if (next_line == ((line_list *) NULL))
{
/* Not a valid header */
- exit (1);
+ exit (EXIT_FAILURE);
}
*next_line = new_list ();
(*next_line)->string = alloc_string (length);
command_line = alloc_string (name_length + args_size (the_header));
strcpy (command_line, mail_program_name);
parse_header (the_header, &command_line[name_length]);
-
+
the_pipe = popen (command_line, "w");
if (the_pipe == ((FILE *) NULL))
fatal ("cannot open pipe to real mailer");
#endif /* not MSDOS */
#endif /* not BSD 4.2 (or newer) */
+
+/* fakemail.c ends here */
** <filename> dump filename
** - (as filename == stdin)
*/
-
+
while (*argv && *argv[0] == '-' && (*argv)[1])
{
/* A switch! */
fclose (fp);
} while (*argv != NULL);
- return 0;
+ return EXIT_SUCCESS;
}
void
usage ()
{
fprintf (stderr, "usage: %s [-de] [-iso]\n", progname);
- exit (1);
+ exit (EXIT_FAILURE);
}
+
+/* hexl.c ends here */
char *s1, *s2;
{
error (s1, s2);
- exit (1);
+ exit (EXIT_FAILURE);
}
/* Like malloc but get fatal error if memory is exhausted. */
if (j == i)
err_count += scan_file (argv[i]);
}
-#ifndef VMS
- exit (err_count > 0);
-#endif /* VMS */
- return err_count > 0;
+ return (err_count > 0 ? EXIT_FAILURE : EXIT_SUCCESS);
}
/* Read file FILENAME and output its doc strings to outfile. */
When we find that, we save it for the following defining-form,
and we use that instead of reading a doc string within that defining-form.
- For defvar, defconst, and fset we skip to the docstring with a kludgy
+ For defvar, defconst, and fset we skip to the docstring with a kludgy
formatting convention: all docstrings must appear on the same line as the
- initial open-paren (the one in column zero) and must contain a backslash
+ initial open-paren (the one in column zero) and must contain a backslash
and a newline immediately after the initial double-quote. No newlines
must appear between the beginning of the form and the first double-quote.
For defun, defmacro, and autoload, we know how to skip over the
arglist, but the doc string must still have a backslash and newline
- immediately after the double quote.
+ immediately after the double quote.
The only source files that must follow this convention are preloaded
uncompiled ones like loaddefs.el and bindings.el; aside
from that, it is always the .elc file that we look at, and they are no
if (! buffer[0])
fprintf (stderr, "## expected a symbol, got '%c'\n", c);
-
+
skip_white (infile);
}
c1 = c;
c = getc (infile);
}
-
+
/* If two previous characters were " and \,
this is a doc string. Otherwise, there is none. */
if (c2 != '"' || c1 != '\\')
c1 = c;
c = getc (infile);
}
-
+
/* If two previous characters were " and \,
this is a doc string. Otherwise, there is none. */
if (c2 != '"' || c1 != '\\')
c1 = c;
c = getc (infile);
}
-
+
/* If two previous characters were " and \,
this is a doc string. Otherwise, there is none. */
if (c2 != '"' || c1 != '\\')
fclose (infile);
return 0;
}
+
+/* make-docfile.c ends here */
* "po:username". This will cause movemail to open a connection to
* a pop server running on $MAILHOST (environment variable). Movemail
* must be setuid to root in order to work with POP.
- *
+ *
* New module: popmail.c
* Modified routines:
* main - added code within #ifdef MAIL_USE_POP; added setuid (getuid ())
- * after POP code.
+ * after POP code.
* New routines in movemail.c:
* get_errmsg - return pointer to system error message
*
preserve_mail++;
break;
default:
- exit(1);
+ exit (EXIT_FAILURE);
}
}
""
#endif
);
- exit (1);
+ exit (EXIT_FAILURE);
}
inname = argv[optind];
pfatal_with_name (inname);
}
-
+
{
char buf[1024];
if (spool_name)
mailunlock ();
#endif
- exit (0);
+ exit (EXIT_SUCCESS);
}
wait (&status);
if (!WIFEXITED (status))
- exit (1);
+ exit (EXIT_FAILURE);
else if (WRETCODE (status) != 0)
exit (WRETCODE (status));
#endif /* ! DISABLE_DIRECT_ACCESS */
- return 0;
+ return EXIT_SUCCESS;
}
#ifdef MAIL_USE_MAILLOCK
if (delete_lockname)
unlink (delete_lockname);
error (s1, s2, 0);
- exit (1);
+ exit (EXIT_FAILURE);
}
/* Print error message. `s1' is printf control string, `s2' and `s3'
if (! server)
{
error ("Error connecting to POP server: %s", pop_error, 0);
- return (1);
+ return EXIT_FAILURE;
}
if (pop_stat (server, &nmsgs, &nbytes))
{
error ("Error getting message count from POP server: %s", pop_error, 0);
- return (1);
+ return EXIT_FAILURE;
}
if (!nmsgs)
{
pop_close (server);
- return (0);
+ return EXIT_SUCCESS;
}
mbfi = open (outfile, O_WRONLY | O_CREAT | O_EXCL, 0666);
{
pop_close (server);
error ("Error in open: %s, %s", strerror (errno), outfile);
- return (1);
+ return EXIT_FAILURE;
}
fchown (mbfi, getuid (), -1);
error ("Error in fdopen: %s", strerror (errno), 0);
close (mbfi);
unlink (outfile);
- return (1);
+ return EXIT_FAILURE;
}
if (reverse_order)
{
error (Errmsg, 0, 0);
close (mbfi);
- return (1);
+ return EXIT_FAILURE;
}
mbx_delimit_end (mbf);
fflush (mbf);
error ("Error in fflush: %s", strerror (errno), 0);
pop_close (server);
close (mbfi);
- return (1);
+ return EXIT_FAILURE;
}
}
if (fsync (mbfi) < 0)
{
error ("Error in fsync: %s", strerror (errno), 0);
- return (1);
+ return EXIT_FAILURE;
}
#endif
if (close (mbfi) == -1)
{
error ("Error in close: %s", strerror (errno), 0);
- return (1);
+ return EXIT_FAILURE;
}
if (! preserve)
{
error ("Error from POP server: %s", pop_error, 0);
pop_close (server);
- return (1);
+ return EXIT_FAILURE;
}
}
if (pop_quit (server))
{
error ("Error from POP server: %s", pop_error, 0);
- return (1);
+ return EXIT_FAILURE;
}
-
- return (0);
+
+ return EXIT_SUCCESS;
}
int
line++;
len--;
}
- if (fwrite (line, 1, len, mbf) != len)
+ if (fwrite (line, 1, len, mbf) != len)
return (NOTOK);
if (fputc (0x0a, mbf) == EOF)
return (NOTOK);
}
#endif /* ! HAVE_STRERROR */
+
+/* movemail.c ends here */
get_time ()
{
if (watch_not_started)
- exit (1); /* call reset_watch first ! */
+ exit (EXIT_FAILURE); /* call reset_watch first ! */
EMACS_GET_TIME (TV2);
EMACS_SUB_TIME (TV2, TV2, TV1);
sprintf (time_string, "%lu.%06lu", (unsigned long)EMACS_SECS (TV2), (unsigned long)EMACS_USECS (TV2));
puts (get_time ());
break;
case 'q':
- exit (0);
+ exit (EXIT_SUCCESS);
}
/* Anything remaining on the line is ignored. */
while (c != '\n' && c != EOF)
c = getchar ();
}
- exit (1);
+ exit (EXIT_FAILURE);
}
/* profile.c ends here */
/* Give this program DOCSTR.mm.nn as standard input and it outputs to
standard output a file of texinfo input containing the doc strings.
-
+
Copyright (C) 1989, 1992, 1994, 1996, 1999, 2000, 2001
Free Software Foundation Inc.
You should have received a copy of the GNU General Public License
along with GNU Emacs; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
-
+
This version sorts the output by function name. */
#include "config.h"
char *s1, *s2;
{
error (s1, s2);
- exit (1);
+ exit (EXIT_FAILURE);
}
/* Like malloc but get fatal error if memory is exhausted. */
{
"WAITING", "BEG_NAME", "NAME_GET", "BEG_DESC", "DESC_GET"
};
-
+
int
main ()
{
DOCSTR *docs; /* chain of allocated DOCSTRS */
char buf[512]; /* line buffer */
-
+
while (1) /* process one char at a time */
{
/* this char from the DOCSTR file */
bp = buf;
state = DESC_GET;
}
-
+
/* process gets */
if (state == NAME_GET || state == DESC_GET)
printf ("@bye\n");
}
- return 0;
+ return EXIT_SUCCESS;
}
+
+/* sorted-doc.c ends here */
If you change it, you will make that program fail.\n";
char buf[300];
-
+
/* Like `read' but keeps trying until it gets SIZE bytes or reaches eof. */
int
cool_read (fd, buf, size)
exit (2);
}
close (fd);
-#ifdef VMS
- exit (1); /* On VMS, success is 1. */
-#endif
- return (0);
+ return EXIT_SUCCESS;
}
+
+/* test-distrib.c ends here */
/*
* yow.c
- *
+ *
* Print a quotation from Zippy the Pinhead.
* Qux <Kaufman-David@Yale> March 6, 1986
*
* This file is in the public domain because the author published it
* with no copyright notice before the US signed the Bern Convention.
- *
+ *
* With dynamic memory allocation.
*/
if ((fp = fopen(file, "r")) == NULL) {
fprintf(stderr, "yow: ");
perror(file);
- exit(1);
+ exit(EXIT_FAILURE);
}
/* initialize random seed */
setup_yow(fp);
yow(fp);
fclose(fp);
- return 0;
+ return EXIT_SUCCESS;
}
static long len = -1;
header_len = ftell(fp);
if (header_len > AVG_LEN)
header_len -= AVG_LEN; /* allow the first quotation to appear */
-
+
if (fseek(fp, 0L, 2) == -1) {
perror("yow");
- exit(1);
+ exit(EXIT_FAILURE);
}
len = ftell(fp) - header_len;
}
offset = rand() % len + header_len;
if (fseek(fp, offset, 0) == -1) {
perror("yow");
- exit(1);
+ exit(EXIT_FAILURE);
}
/* Read until SEP, read next line, print it.
buf[i++] = c;
while ((c = getc(fp)) != SEP && c != EOF) {
buf[i++] = c;
-
+
if (i == bufsize-1) {
/* Yow! Is this quotation too long yet? */
bufsize *= 2;
printf("%s\n", buf);
}
+/* yow.c ends here */