* lib-src/update-game-score.c: Convert function definitions to standard C.
* lib-src/sorted-doc.c:
* lib-src/profile.c:
* lib-src/pop.c:
* lib-src/movemail.c:
* lib-src/make-docfile.c:
* lib-src/hexl.c:
* lib-src/fakemail.c:
* lib-src/etags.c:
* lib-src/ebrowse.c:
* lib-src/digest-doc.c:
* lib-src/b2m.c: Likewise.
+2010-07-03 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * update-game-score.c: Convert function definitions to standard C.
+ * sorted-doc.c:
+ * profile.c:
+ * pop.c:
+ * movemail.c:
+ * make-docfile.c:
+ * hexl.c:
+ * fakemail.c:
+ * etags.c:
+ * ebrowse.c:
+ * digest-doc.c:
+ * b2m.c: Likewise.
+
2010-07-02 Dan Nicolaescu <dann@ics.uci.edu>
* make-docfile.c (xmalloc, xrealloc, concat, readline, fatal):
char *buffer;
};
-extern char *strtok();
+extern char *strtok(char *, const char *);
long *xmalloc (unsigned int size);
long *xrealloc (char *ptr, unsigned int size);
extern int optind;
int
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
logical labels_saved, printing, header, first, last_was_blank_line;
time_t ltoday;
* concatenate those of s1, s2, s3.
*/
char *
-concat (s1, s2, s3)
- char *s1, *s2, *s3;
+concat (char *s1, char *s2, char *s3)
{
int len1 = strlen (s1), len2 = strlen (s2), len3 = strlen (s3);
char *result = xnew (len1 + len2 + len3 + 1, char);
* which is the length of the line including the newline, if any.
*/
long
-readline (linebuffer, stream)
- struct linebuffer *linebuffer;
- register FILE *stream;
+readline (struct linebuffer *linebuffer, register FILE *stream)
{
char *buffer = linebuffer->buffer;
register char *p = linebuffer->buffer;
* Like malloc but get fatal error if memory is exhausted.
*/
long *
-xmalloc (size)
- unsigned int size;
+xmalloc (unsigned int size)
{
long *result = (long *) malloc (size);
if (result == NULL)
}
long *
-xrealloc (ptr, size)
- char *ptr;
- unsigned int size;
+xrealloc (char *ptr, unsigned int size)
{
long *result = (long *) realloc (ptr, size);
if (result == NULL)
}
void
-fatal (message)
- char *message;
+fatal (char *message)
{
fprintf (stderr, "%s: %s\n", progname, message);
exit (EXIT_FAILURE);
#endif
int
-main ()
+main (void)
{
register int ch;
register int notfirst = 0;
int globals (int);
void yyerror (char *, char *);
void usage (int) NO_RETURN;
-void version () NO_RETURN;
+void version (void) NO_RETURN;
\f
name and line number. */
void
-yyerror (format, s)
- char *format, *s;
+yyerror (char *format, char *s)
{
fprintf (stderr, "%s:%d: ", filename, yyline);
fprintf (stderr, format, s);
available. */
void *
-xmalloc (nbytes)
- int nbytes;
+xmalloc (int nbytes)
{
void *p = malloc (nbytes);
if (p == NULL)
/* Like realloc but print an error and exit if out of memory. */
void *
-xrealloc (p, sz)
- void *p;
- int sz;
+xrealloc (void *p, int sz)
{
p = realloc (p, sz);
if (p == NULL)
available.. If S is null, return null. */
char *
-xstrdup (s)
- char *s;
+xstrdup (char *s)
{
if (s)
s = strcpy (xmalloc (strlen (s) + 1), s);
special symbol for globals (`*Globals*'). */
void
-init_sym ()
+init_sym (void)
{
global_symbols = add_sym (GLOBALS_NAME, NULL);
}
create a new symbol and set it to default values. */
struct sym *
-add_sym (name, nested_in_class)
- char *name;
- struct sym *nested_in_class;
+add_sym (char *name, struct sym *nested_in_class)
{
struct sym *sym;
unsigned h;
/* Add links between superclass SUPER and subclass SUB. */
void
-add_link (super, sub)
- struct sym *super, *sub;
+add_link (struct sym *super, struct sym *sub)
{
struct link *lnk, *lnk2, *p, *prev;
found or null if not found. */
struct member *
-find_member (cls, name, var, sc, hash)
- struct sym *cls;
- char *name;
- int var, sc;
- unsigned hash;
+find_member (struct sym *cls, char *name, int var, int sc, unsigned int hash)
{
struct member **list;
struct member *p;
F_* defines). */
void
-add_member_decl (cls, name, regexp, pos, hash, var, sc, vis, flags)
- struct sym *cls;
- char *name;
- char *regexp;
- int pos;
- unsigned hash;
- int var;
- int sc;
- int vis;
- int flags;
+add_member_decl (struct sym *cls, char *name, char *regexp, int pos, unsigned int hash, int var, int sc, int vis, int flags)
{
struct member *m;
F_* defines). */
void
-add_member_defn (cls, name, regexp, pos, hash, var, sc, flags)
- struct sym *cls;
- char *name;
- char *regexp;
- int pos;
- unsigned hash;
- int var;
- int sc;
- int flags;
+add_member_defn (struct sym *cls, char *name, char *regexp, int pos, unsigned int hash, int var, int sc, int flags)
{
struct member *m;
if it is non-null. POS is the position in the file. */
void
-add_define (name, regexp, pos)
- char *name, *regexp;
- int pos;
+add_define (char *name, char *regexp, int pos)
{
add_global_defn (name, regexp, pos, 0, 1, SC_FRIEND, F_DEFINE);
add_global_decl (name, regexp, pos, 0, 1, SC_FRIEND, F_DEFINE);
F_* defines). */
void
-add_global_defn (name, regexp, pos, hash, var, sc, flags)
- char *name, *regexp;
- int pos;
- unsigned hash;
- int var;
- int sc;
- int flags;
+add_global_defn (char *name, char *regexp, int pos, unsigned int hash, int var, int sc, int flags)
{
int i;
struct sym *sym;
F_* defines). */
void
-add_global_decl (name, regexp, pos, hash, var, sc, flags)
- char *name, *regexp;
- int pos;
- unsigned hash;
- int var;
- int sc;
- int flags;
+add_global_decl (char *name, char *regexp, int pos, unsigned int hash, int var, int sc, int flags)
{
/* Add declaration only if not already declared. Header files must
be processed before source files for this to have the right effect.
Value is a pointer to the member's structure. */
struct member *
-add_member (cls, name, var, sc, hash)
- struct sym *cls;
- char *name;
- int var;
- int sc;
- unsigned hash;
+add_member (struct sym *cls, char *name, int var, int sc, unsigned int hash)
{
struct member *m = (struct member *) xmalloc (sizeof *m + strlen (name));
struct member **list;
in base classes. */
void
-mark_virtual (r)
- struct sym *r;
+mark_virtual (struct sym *r)
{
struct link *p;
struct member *m, *m2;
are virtual because of a virtual declaration in a base class. */
void
-mark_inherited_virtual ()
+mark_inherited_virtual (void)
{
struct sym *r;
int i;
/* Create and return a symbol for a namespace with name NAME. */
struct sym *
-make_namespace (name, context)
- char *name;
- struct sym *context;
+make_namespace (char *name, struct sym *context)
{
struct sym *s = (struct sym *) xmalloc (sizeof *s + strlen (name));
bzero (s, sizeof *s);
/* Find the symbol for namespace NAME. If not found, retrun NULL */
struct sym *
-check_namespace (name, context)
- char *name;
- struct sym *context;
+check_namespace (char *name, struct sym *context)
{
struct sym *p = NULL;
for NAME to all_namespaces. */
struct sym *
-find_namespace (name, context)
- char *name;
- struct sym *context;
+find_namespace (char *name, struct sym *context)
{
struct sym *p = check_namespace (name, context);
/* Find namespace alias with name NAME. If not found return NULL. */
struct link *
-check_namespace_alias (name)
- char *name;
+check_namespace_alias (char *name)
{
struct link *p = NULL;
struct alias *al;
/* Register the name NEW_NAME as an alias for namespace list OLD_NAME. */
void
-register_namespace_alias (new_name, old_name)
- char *new_name;
- struct link *old_name;
+register_namespace_alias (char *new_name, struct link *old_name)
{
unsigned h;
char *s;
/* Enter namespace with name NAME. */
void
-enter_namespace (name)
- char *name;
+enter_namespace (char *name)
{
struct sym *p = find_namespace (name, current_namespace);
/* Leave the current namespace. */
void
-leave_namespace ()
+leave_namespace (void)
{
assert (namespace_sp > 0);
current_namespace = namespace_stack[--namespace_sp];
/* Make sure scope_buffer has enough room to add LEN chars to it. */
void
-ensure_scope_buffer_room (len)
- int len;
+ensure_scope_buffer_room (int len)
{
if (scope_buffer_len + len >= scope_buffer_size)
{
scope name constructed. */
char *
-sym_scope_1 (p)
- struct sym *p;
+sym_scope_1 (struct sym *p)
{
int len;
as it would appear in a C*+ source file. */
char *
-sym_scope (p)
- struct sym *p;
+sym_scope (struct sym *p)
{
if (!scope_buffer)
{
list. */
int
-dump_members (fp, m)
- FILE *fp;
- struct member *m;
+dump_members (FILE *fp, struct member *m)
{
int n;
/* Dump class ROOT to stream FP. */
void
-dump_sym (fp, root)
- FILE *fp;
- struct sym *root;
+dump_sym (FILE *fp, struct sym *root)
{
fputs (CLASS_STRUCT, fp);
PUTSTR (root->name, fp);
number of classes written. */
int
-dump_tree (fp, root)
- FILE *fp;
- struct sym *root;
+dump_tree (FILE *fp, struct sym *root)
{
struct link *lk;
unsigned n = 0;
/* Dump the entire class tree to file FP. */
void
-dump_roots (fp)
- FILE *fp;
+dump_roots (FILE *fp)
{
int i, n = 0;
struct sym *r;
input buffer not consumed. */
int
-process_pp_line ()
+process_pp_line (void)
{
int in_comment = 0, in_string = 0;
int c;
/* Value is the next token from the input buffer. */
int
-yylex ()
+yylex (void)
{
int c;
char end_char;
shorter than min_regexp. */
char *
-matching_regexp ()
+matching_regexp (void)
{
char *p;
char *s;
/* Return a printable representation of token T. */
char *
-token_string (t)
- int t;
+token_string (int t)
{
static char b[3];
/* Reinitialize the scanner for a new input file. */
void
-re_init_scanner ()
+re_init_scanner (void)
{
in = inbuffer;
yyline = 1;
table. */
void
-insert_keyword (name, tk)
- char *name;
- int tk;
+insert_keyword (char *name, int tk)
{
char *s;
unsigned h = 0;
character class vectors and fills the keyword hash table. */
void
-init_scanner ()
+init_scanner (void)
{
int i;
the current lookahead token after skipping. */
int
-skip_to (token)
- int token;
+skip_to (int token)
{
while (!LOOKING_AT2 (YYEOF, token))
MATCH ();
angle brackets, curly brackets) matching the current lookahead. */
void
-skip_matching ()
+skip_matching (void)
{
int open, close, n;
}
void
-skip_initializer ()
+skip_initializer (void)
{
for (;;)
{
/* Build qualified namespace alias (A::B::c) and return it. */
struct link *
-match_qualified_namespace_alias ()
+match_qualified_namespace_alias (void)
{
struct link *head = NULL;
struct link *cur = NULL;
/* Re-initialize the parser by resetting the lookahead token. */
void
-re_init_parser ()
+re_init_parser (void)
{
tk = -1;
}
distinguish between overloaded functions. */
unsigned
-parm_list (flags)
- int *flags;
+parm_list (int *flags)
{
unsigned hash = 0;
int type_seen = 0;
/* Print position info to stdout. */
void
-print_info ()
+print_info (void)
{
if (info_position >= 0 && BUFFER_POS () <= info_position)
if (info_cls)
public). */
void
-member (cls, vis)
- struct sym *cls;
- int vis;
+member (struct sym *cls, int vis)
{
char *id = NULL;
int sc = SC_MEMBER;
union, class). */
void
-class_body (cls, tag)
- struct sym *cls;
- int tag;
+class_body (struct sym *cls, int tag)
{
int vis = tag == CLASS ? PRIVATE : PUBLIC;
int temp;
symbol for that class. */
struct sym *
-parse_classname ()
+parse_classname (void)
{
struct sym *last_class = NULL;
a static buffer holding the constructed operator name string. */
char *
-operator_name (sc)
- int *sc;
+operator_name (int *sc)
{
static int id_size = 0;
static char *id = NULL;
symbol structure for the ident. */
struct sym *
-parse_qualified_ident_or_type (last_id)
- char **last_id;
+parse_qualified_ident_or_type (char **last_id)
{
struct sym *cls = NULL;
char *id = NULL;
symbol structure for the ident. */
void
-parse_qualified_param_ident_or_type (last_id)
- char **last_id;
+parse_qualified_param_ident_or_type (char **last_id)
{
struct sym *cls = NULL;
static char *id = NULL;
Current lookahead is the class name. */
void
-class_definition (containing, tag, flags, nested)
- struct sym *containing;
- int tag;
- int flags;
- int nested;
+class_definition (struct sym *containing, int tag, int flags, int nested)
{
struct sym *current;
struct sym *base_class;
information about the member (see the F_* defines). */
void
-add_declarator (cls, id, flags, sc)
- struct sym **cls;
- char **id;
- int flags, sc;
+add_declarator (struct sym **cls, char **id, int flags, int sc)
{
if (LOOKING_AT2 (';', ','))
{
/* Parse a declaration. */
void
-declaration (flags)
- int flags;
+declaration (int flags)
{
char *id = NULL;
struct sym *cls = NULL;
otherwise. */
int
-globals (start_flags)
- int start_flags;
+globals (int start_flags)
{
int anonymous;
int class_tk;
/* Parse the current input file. */
void
-yyparse ()
+yyparse (void)
{
while (globals (0) == 0)
MATCH_IF ('}');
input files. */
void
-add_search_path (path_list)
- char *path_list;
+add_search_path (char *path_list)
{
while (*path_list)
{
unchanged file name. */
FILE *
-open_file (file)
- char *file;
+open_file (char *file)
{
FILE *fp = NULL;
static char *buffer;
"
void
-usage (error)
- int error;
+usage (int error)
{
puts (USAGE);
exit (error ? EXIT_FAILURE : EXIT_SUCCESS);
#endif
void
-version ()
+version (void)
{
/* Makes it easier to update automatically. */
char emacs_copyright[] = "Copyright (C) 2010 Free Software Foundation, Inc.";
table. */
void
-process_file (file)
- char *file;
+process_file (char *file)
{
FILE *fp;
is null when EOF is reached. */
char *
-read_line (fp)
- FILE *fp;
+read_line (FILE *fp)
{
static char *buffer;
static int buffer_size;
/* Main entry point. */
int
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
int i;
int any_inputfiles = 0;
#include <errno.h>
\f
-char *getenv (), *getwd ();
+char *getenv (const char *), *getwd (char *);
char *(getcwd) ();
#ifdef WINDOWSNT
/* PID of the Emacs server process. */
int emacs_pid = 0;
-void print_help_and_exit () NO_RETURN;
+void print_help_and_exit (void) NO_RETURN;
struct option longopts[] =
{
/* Like malloc but get fatal error if memory is exhausted. */
long *
-xmalloc (size)
- unsigned int size;
+xmalloc (unsigned int size)
{
long *result = (long *) malloc (size);
if (result == NULL)
The global variable `optind' will say how many arguments we used up. */
void
-decode_options (argc, argv)
- int argc;
- char **argv;
+decode_options (int argc, char **argv)
{
alternate_editor = egetenv ("ALTERNATE_EDITOR");
\f
void
-print_help_and_exit ()
+print_help_and_exit (void)
{
/* Spaces and tabs are significant in this message; they're chosen so the
message aligns properly both in a tty and in a Windows message box.
#define AUTH_KEY_LENGTH 64
#define SEND_BUFFER_SIZE 4096
-extern char *strerror ();
+extern char *strerror (int);
/* Buffer to accumulate data to send in TCP connections. */
char send_buffer[SEND_BUFFER_SIZE + 1];
/* On Windows, the socket library was historically separate from the standard
C library, so errors are handled differently. */
void
-sock_err_message (function_name)
- char *function_name;
+sock_err_message (char *function_name)
{
#ifdef WINDOWSNT
char* msg = NULL;
- the buffer is full (but this shouldn't happen)
Otherwise, we just accumulate it. */
void
-send_to_emacs (s, data)
- HSOCKET s;
- char *data;
+send_to_emacs (int s, char *data)
{
while (data)
{
Does not change the string. Outputs the result to STREAM. */
void
-quote_argument (s, str)
- HSOCKET s;
- char *str;
+quote_argument (int s, char *str)
{
char *copy = (char *) xmalloc (strlen (str) * 2 + 1);
char *p, *q;
modifying the string in place. Returns STR. */
char *
-unquote_argument (str)
- char *str;
+unquote_argument (char *str)
{
char *p, *q;
\f
int
-file_name_absolute_p (filename)
- const unsigned char *filename;
+file_name_absolute_p (const unsigned char *filename)
{
/* Sanity check, it shouldn't happen. */
if (! filename) return FALSE;
* the Emacs server: host, port, pid and authentication string.
*/
int
-get_server_config (server, authentication)
- struct sockaddr_in *server;
- char *authentication;
+get_server_config (struct sockaddr_in *server, char *authentication)
{
char dotted[32];
char *port;
}
HSOCKET
-set_tcp_socket ()
+set_tcp_socket (void)
{
HSOCKET s;
struct sockaddr_in server;
0 - success: none of the above */
static int
-socket_status (socket_name)
- char *socket_name;
+socket_status (char *socket_name)
{
struct stat statbfr;
HSOCKET
-set_local_socket ()
+set_local_socket (void)
{
HSOCKET s;
struct sockaddr_un server;
}
int
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
int i, rl, needlf = 0;
char *cwd, *str;
\f
static void
-print_language_names ()
+print_language_names (void)
{
language *lang;
char **name, **ext;
# define VERSION "17.38.1.4"
#endif
static void
-print_version ()
+print_version (void)
{
/* Makes it easier to update automatically. */
char emacs_copyright[] = "Copyright (C) 2010 Free Software Foundation, Inc.";
#endif
static void
-print_help (argbuffer)
- argument *argbuffer;
+print_help (argument *argbuffer)
{
bool help_for_lang = FALSE;
\f
int
-main (argc, argv)
- int argc;
- char *argv[];
+main (int argc, char **argv)
{
int i;
unsigned int nincluded_files;
* Idea by Vladimir Alexiev <vladimir@cs.ualberta.ca> (1998)
*/
static compressor *
-get_compressor_from_suffix (file, extptr)
- char *file;
- char **extptr;
+get_compressor_from_suffix (char *file, char **extptr)
{
compressor *compr;
char *slash, *suffix;
* Return a language given the name.
*/
static language *
-get_language_from_langname (name)
- const char *name;
+get_language_from_langname (const char *name)
{
language *lang;
* Return a language given the interpreter name.
*/
static language *
-get_language_from_interpreter (interpreter)
- char *interpreter;
+get_language_from_interpreter (char *interpreter)
{
language *lang;
char **iname;
* Return a language given the file name.
*/
static language *
-get_language_from_filename (file, case_sensitive)
- char *file;
- bool case_sensitive;
+get_language_from_filename (char *file, int case_sensitive)
{
language *lang;
char **name, **ext, *suffix;
* This routine is called on each file argument.
*/
static void
-process_file_name (file, lang)
- char *file;
- language *lang;
+process_file_name (char *file, language *lang)
{
struct stat stat_buf;
FILE *inf;
}
static void
-process_file (fh, fn, lang)
- FILE *fh;
- char *fn;
- language *lang;
+process_file (FILE *fh, char *fn, language *lang)
{
static const fdesc emptyfdesc;
fdesc *fdp;
* of a char is TRUE if it is the string "white", else FALSE.
*/
static void
-init ()
+init (void)
{
register char *sp;
register int i;
* which finds the function and type definitions.
*/
static void
-find_entries (inf)
- FILE *inf;
+find_entries (FILE *inf)
{
char *cp;
language *lang = curfdp->lang;
* etags.el needs to use the same characters that are in NONAM.
*/
static void
-make_tag (name, namelen, is_func, linestart, linelen, lno, cno)
- char *name; /* tag name, or NULL if unnamed */
- int namelen; /* tag length */
- bool is_func; /* tag is a function */
- char *linestart; /* start of the line where tag is */
- int linelen; /* length of the line where tag is */
- int lno; /* line number */
- long cno; /* character number */
+make_tag (char *name, int namelen, int is_func, char *linestart, int linelen, int lno, long int cno)
+ /* tag name, or NULL if unnamed */
+ /* tag length */
+ /* tag is a function */
+ /* start of the line where tag is */
+ /* length of the line where tag is */
+ /* line number */
+ /* character number */
{
bool named = (name != NULL && namelen > 0);
/* Record a tag. */
static void
-pfnote (name, is_func, linestart, linelen, lno, cno)
- char *name; /* tag name, or NULL if unnamed */
- bool is_func; /* tag is a function */
- char *linestart; /* start of the line where tag is */
- int linelen; /* length of the line where tag is */
- int lno; /* line number */
- long cno; /* character number */
+pfnote (char *name, int is_func, char *linestart, int linelen, int lno, long int cno)
+ /* tag name, or NULL if unnamed */
+ /* tag is a function */
+ /* start of the line where tag is */
+ /* length of the line where tag is */
+ /* line number */
+ /* character number */
{
register node *np;
* recurse on left children, iterate on right children.
*/
static void
-free_tree (np)
- register node *np;
+free_tree (register node *np)
{
while (np)
{
* delete a file description
*/
static void
-free_fdesc (fdp)
- register fdesc *fdp;
+free_fdesc (register fdesc *fdp)
{
free (fdp->infname);
free (fdp->infabsname);
* maintain state.
*/
static void
-add_node (np, cur_node_p)
- node *np, **cur_node_p;
+add_node (node *np, node **cur_node_p)
{
register int dif;
register node *cur_node = *cur_node_p;
* given file description (CTAGS case) or free them (ETAGS case).
*/
static void
-invalidate_nodes (badfdp, npp)
- fdesc *badfdp;
- node **npp;
+invalidate_nodes (fdesc *badfdp, node **npp)
{
node *np = *npp;
/* Length of a non-negative number's decimal representation. */
static int
-number_len (num)
- long num;
+number_len (long int num)
{
int len = 1;
while ((num /= 10) > 0)
* but is still supplied for backward compatibility.
*/
static int
-total_size_of_entries (np)
- register node *np;
+total_size_of_entries (register node *np)
{
register int total = 0;
}
static void
-put_entries (np)
- register node *np;
+put_entries (register node *np)
{
register char *sp;
static fdesc *fdp = NULL;
#endif
#endif
static unsigned int
-hash (str, len)
- register const char *str;
- register unsigned int len;
+hash (register const char *str, register unsigned int len)
{
static unsigned char asso_values[] =
{
}
static struct C_stab_entry *
-in_word_set (str, len)
- register const char *str;
- register unsigned int len;
+in_word_set (register const char *str, register unsigned int len)
{
enum
{
/*%>*/
static enum sym_type
-C_symtype (str, len, c_ext)
- char *str;
- int len;
- int c_ext;
+C_symtype (char *str, int len, int c_ext)
{
register struct C_stab_entry *se = in_word_set (str, len);
&& bracelev == cstack.bracelev[nestlev-1] + 1)
static void
-pushclass_above (bracelev, str, len)
- int bracelev;
- char *str;
- int len;
+pushclass_above (int bracelev, char *str, int len)
{
int nl;
}
static void
-popclass_above (bracelev)
- int bracelev;
+popclass_above (int bracelev)
{
int nl;
}
static void
-write_classname (cn, qualifier)
- linebuffer *cn;
- char *qualifier;
+write_classname (linebuffer *cn, char *qualifier)
{
int i, len;
int qlen = strlen (qualifier);
*/
static bool
-consider_token (str, len, c, c_extp, bracelev, parlev, is_func_or_var)
- register char *str; /* IN: token pointer */
- register int len; /* IN: token length */
- register int c; /* IN: first char after the token */
- int *c_extp; /* IN, OUT: C extensions mask */
- int bracelev; /* IN: brace level */
- int parlev; /* IN: parenthesis level */
- bool *is_func_or_var; /* OUT: function or variable found */
+consider_token (register char *str, register int len, register int c, int *c_extp, int bracelev, int parlev, int *is_func_or_var)
+ /* IN: token pointer */
+ /* IN: token length */
+ /* IN: first char after the token */
+ /* IN, OUT: C extensions mask */
+ /* IN: brace level */
+ /* IN: parenthesis level */
+ /* OUT: function or variable found */
{
/* When structdef is stagseen, scolonseen, or snone with bracelev > 0,
structtype is the type of the preceding struct-like keyword, and
static void
-make_C_tag (isfun)
- bool isfun;
+make_C_tag (int isfun)
{
/* This function is never called when token.valid is FALSE, but
we must protect against invalid input or internal errors. */
* C syntax and adds them to the list.
*/
static void
-C_entries (c_ext, inf)
- int c_ext; /* extension of C */
- FILE *inf; /* input file */
+C_entries (int c_ext, FILE *inf)
+ /* extension of C */
+ /* input file */
{
register char c; /* latest char read; '\0' for end of line */
register char *lp; /* pointer one beyond the character `c' */
* of a global flag.
*/
static void
-default_C_entries (inf)
- FILE *inf;
+default_C_entries (FILE *inf)
{
C_entries (cplusplus ? C_PLPL : C_AUTO, inf);
}
/* Always do plain C. */
static void
-plain_C_entries (inf)
- FILE *inf;
+plain_C_entries (FILE *inf)
{
C_entries (0, inf);
}
/* Always do C++. */
static void
-Cplusplus_entries (inf)
- FILE *inf;
+Cplusplus_entries (FILE *inf)
{
C_entries (C_PLPL, inf);
}
/* Always do Java. */
static void
-Cjava_entries (inf)
- FILE *inf;
+Cjava_entries (FILE *inf)
{
C_entries (C_JAVA, inf);
}
/* Always do C*. */
static void
-Cstar_entries (inf)
- FILE *inf;
+Cstar_entries (FILE *inf)
{
C_entries (C_STAR, inf);
}
/* Always do Yacc. */
static void
-Yacc_entries (inf)
- FILE *inf;
+Yacc_entries (FILE *inf)
{
C_entries (YACC, inf);
}
* matching on files that have no language defined.
*/
static void
-just_read_file (inf)
- FILE *inf;
+just_read_file (FILE *inf)
{
register char *dummy;
static void F_getit (FILE *);
static void
-F_takeprec ()
+F_takeprec (void)
{
dbp = skip_spaces (dbp);
if (*dbp != '*')
}
static void
-F_getit (inf)
- FILE *inf;
+F_getit (FILE *inf)
{
register char *cp;
static void
-Fortran_functions (inf)
- FILE *inf;
+Fortran_functions (FILE *inf)
{
LOOP_ON_INPUT_LINES (inf, lb, dbp)
{
/* Once we are positioned after an "interesting" keyword, let's get
the real tag value necessary. */
static void
-Ada_getit (inf, name_qualifier)
- FILE *inf;
- char *name_qualifier;
+Ada_getit (FILE *inf, char *name_qualifier)
{
register char *cp;
char *name;
}
static void
-Ada_funcs (inf)
- FILE *inf;
+Ada_funcs (FILE *inf)
{
bool inquote = FALSE;
bool skip_till_semicolumn = FALSE;
* Idea by Bob Weiner, Motorola Inc. (1994)
*/
static void
-Asm_labels (inf)
- FILE *inf;
+Asm_labels (FILE *inf)
{
register char *cp;
* Ideas by Kai Großjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> (2001)
*/
static void
-Perl_functions (inf)
- FILE *inf;
+Perl_functions (FILE *inf)
{
char *package = savestr ("main"); /* current package name */
register char *cp;
* More ideas by seb bacon <seb@jamkit.com> (2002)
*/
static void
-Python_functions (inf)
- FILE *inf;
+Python_functions (FILE *inf)
{
register char *cp;
* Idea by Diez B. Roggisch (2001)
*/
static void
-PHP_functions (inf)
- FILE *inf;
+PHP_functions (FILE *inf)
{
register char *cp, *name;
bool search_identifier = FALSE;
* Idea by Corny de Souza (1993)
*/
static void
-Cobol_paragraphs (inf)
- FILE *inf;
+Cobol_paragraphs (FILE *inf)
{
register char *bp, *ep;
* Ideas by Assar Westerlund <assar@sics.se> (2001)
*/
static void
-Makefile_targets (inf)
- FILE *inf;
+Makefile_targets (FILE *inf)
{
register char *bp;
* the tag is skipped.
*/
static void
-Pascal_functions (inf)
- FILE *inf;
+Pascal_functions (FILE *inf)
{
linebuffer tline; /* mostly copied from C_entries */
long save_lcno;
static void L_getit (void);
static void
-L_getit ()
+L_getit (void)
{
if (*dbp == '\'') /* Skip prefix quote */
dbp++;
}
static void
-Lisp_functions (inf)
- FILE *inf;
+Lisp_functions (FILE *inf)
{
LOOP_ON_INPUT_LINES (inf, lb, dbp)
{
* "function" and "local function" are tags if they start at column 1.
*/
static void
-Lua_functions (inf)
- FILE *inf;
+Lua_functions (FILE *inf)
{
register char *bp;
* Masatake Yamato <masata-y@is.aist-nara.ac.jp> (1999)
*/
static void
-PS_functions (inf)
- FILE *inf;
+PS_functions (FILE *inf)
{
register char *bp, *ep;
* Ideas by Eduardo Horvath <eeh@netbsd.org> (2004)
*/
static void
-Forth_words (inf)
- FILE *inf;
+Forth_words (FILE *inf)
{
register char *bp;
* Original code by Ken Haase (1985?)
*/
static void
-Scheme_functions (inf)
- FILE *inf;
+Scheme_functions (FILE *inf)
{
register char *bp;
* TeX/LaTeX scanning loop.
*/
static void
-TeX_commands (inf)
- FILE *inf;
+TeX_commands (FILE *inf)
{
char *cp;
linebuffer *key;
/* Figure out whether TeX's escapechar is '\\' or '!' and set grouping
chars accordingly. */
static void
-TEX_mode (inf)
- FILE *inf;
+TEX_mode (FILE *inf)
{
int c;
/* Read environment and prepend it to the default string.
Build token table. */
static void
-TEX_decode_env (evarname, defenv)
- char *evarname;
- char *defenv;
+TEX_decode_env (char *evarname, char *defenv)
{
register char *env, *p;
int i, len;
\f
/* Texinfo support. Dave Love, Mar. 2000. */
static void
-Texinfo_nodes (inf)
- FILE * inf;
+Texinfo_nodes (FILE *inf)
{
char *cp, *start;
LOOP_ON_INPUT_LINES (inf, lb, cp)
* Francesco Potortì, 2002.
*/
static void
-HTML_labels (inf)
- FILE * inf;
+HTML_labels (FILE *inf)
{
bool getnext = FALSE; /* next text outside of HTML tags is a tag */
bool skiptag = FALSE; /* skip to the end of the current HTML tag */
static int prolog_atom (char *, int);
static void
-Prolog_functions (inf)
- FILE *inf;
+Prolog_functions (FILE *inf)
{
char *cp, *last;
int len;
static void
-prolog_skip_comment (plb, inf)
- linebuffer *plb;
- FILE *inf;
+prolog_skip_comment (linebuffer *plb, FILE *inf)
{
char *cp;
* header was found.
*/
static int
-prolog_pr (s, last)
- char *s;
- char *last; /* Name of last clause. */
+prolog_pr (char *s, char *last)
+
+ /* Name of last clause. */
{
int pos;
int len;
* Backslash quotes everything.
*/
static int
-prolog_atom (s, pos)
- char *s;
- int pos;
+prolog_atom (char *s, int pos)
{
int origpos;
static int erlang_atom (char *);
static void
-Erlang_functions (inf)
- FILE *inf;
+Erlang_functions (FILE *inf)
{
char *cp, *last;
int len;
* was found.
*/
static int
-erlang_func (s, last)
- char *s;
- char *last; /* Name of last clause. */
+erlang_func (char *s, char *last)
+
+ /* Name of last clause. */
{
int pos;
int len;
* -record(graph, {vtab = notable, cyclic = true}).
*/
static void
-erlang_attribute (s)
- char *s;
+erlang_attribute (char *s)
{
char *cp = s;
* Return the number of bytes consumed, or -1 if there was an error.
*/
static int
-erlang_atom (s)
- char *s;
+erlang_atom (char *s)
{
int pos = 0;
* unterminated regexps.
*/
static char *
-scan_separators (name)
- char *name;
+scan_separators (char *name)
{
char sep = name[0];
char *copyto = name;
/* Look at the argument of --regex or --no-regex and do the right
thing. Same for each line of a regexp file. */
static void
-analyse_regex (regex_arg)
- char *regex_arg;
+analyse_regex (char *regex_arg)
{
if (regex_arg == NULL)
{
/* Separate the regexp pattern, compile it,
and care for optional name and modifiers. */
static void
-add_regex (regexp_pattern, lang)
- char *regexp_pattern;
- language *lang;
+add_regex (char *regexp_pattern, language *lang)
{
static struct re_pattern_buffer zeropattern;
char sep, *pat, *name, *modifiers;
* arguments.
*/
static char *
-substitute (in, out, regs)
- char *in, *out;
- struct re_registers *regs;
+substitute (char *in, char *out, struct re_registers *regs)
{
char *result, *t;
int size, dig, diglen;
/* Deallocate all regexps. */
static void
-free_regexps ()
+free_regexps (void)
{
regexp *rp;
while (p_head != NULL)
* Idea by Ben Wing <ben@666.com> (2002).
*/
static void
-regex_tag_multiline ()
+regex_tag_multiline (void)
{
char *buffer = filebuf.buffer;
regexp *rp;
\f
static bool
-nocase_tail (cp)
- char *cp;
+nocase_tail (char *cp)
{
register int len = 0;
}
static void
-get_tag (bp, namepp)
- register char *bp;
- char **namepp;
+get_tag (register char *bp, char **namepp)
{
register char *cp = bp;
* appended to `filebuf'.
*/
static long
-readline_internal (lbp, stream)
- linebuffer *lbp;
- register FILE *stream;
+readline_internal (linebuffer *lbp, register FILE *stream)
{
char *buffer = lbp->buffer;
register char *p = lbp->buffer;
* directives.
*/
static void
-readline (lbp, stream)
- linebuffer *lbp;
- FILE *stream;
+readline (linebuffer *lbp, FILE *stream)
{
long result;
* with xnew where the string CP has been copied.
*/
static char *
-savestr (cp)
- char *cp;
+savestr (char *cp)
{
return savenstr (cp, strlen (cp));
}
* the string CP has been copied for at most the first LEN characters.
*/
static char *
-savenstr (cp, len)
- char *cp;
- int len;
+savenstr (char *cp, int len)
{
register char *dp;
* Identical to POSIX strrchr, included for portability.
*/
static char *
-etags_strrchr (sp, c)
- register const char *sp;
- register int c;
+etags_strrchr (register const char *sp, register int c)
{
register const char *r;
* Identical to POSIX strchr, included for portability.
*/
static char *
-etags_strchr (sp, c)
- register const char *sp;
- register int c;
+etags_strchr (register const char *sp, register int c)
{
do
{
* Same as BSD's strcasecmp, included for portability.
*/
static int
-etags_strcasecmp (s1, s2)
- register const char *s1;
- register const char *s2;
+etags_strcasecmp (register const char *s1, register const char *s2)
{
while (*s1 != '\0'
&& (ISALPHA (*s1) && ISALPHA (*s2)
* Same as BSD's strncasecmp, included for portability.
*/
static int
-etags_strncasecmp (s1, s2, n)
- register const char *s1;
- register const char *s2;
- register int n;
+etags_strncasecmp (register const char *s1, register const char *s2, register int n)
{
while (*s1 != '\0' && n-- > 0
&& (ISALPHA (*s1) && ISALPHA (*s2)
/* Skip spaces (end of string is not space), return new pointer. */
static char *
-skip_spaces (cp)
- char *cp;
+skip_spaces (char *cp)
{
while (iswhite (*cp))
cp++;
/* Skip non spaces, except end of string, return new pointer. */
static char *
-skip_non_spaces (cp)
- char *cp;
+skip_non_spaces (char *cp)
{
while (*cp != '\0' && !iswhite (*cp))
cp++;
/* Print error message and exit. */
void
-fatal (s1, s2)
- char *s1, *s2;
+fatal (char *s1, char *s2)
{
error (s1, s2);
exit (EXIT_FAILURE);
}
static void
-pfatal (s1)
- char *s1;
+pfatal (char *s1)
{
perror (s1);
exit (EXIT_FAILURE);
}
static void
-suggest_asking_for_help ()
+suggest_asking_for_help (void)
{
fprintf (stderr, "\tTry `%s %s' for a complete list of options.\n",
progname, NO_LONG_OPTIONS ? "-h" : "--help");
/* Print error message. `s1' is printf control string, `s2' is arg for it. */
static void
-error (s1, s2)
- const char *s1, *s2;
+error (const char *s1, const char *s2)
{
fprintf (stderr, "%s: ", progname);
fprintf (stderr, s1, s2);
/* Return a newly-allocated string whose contents
concatenate those of s1, s2, s3. */
static char *
-concat (s1, s2, s3)
- char *s1, *s2, *s3;
+concat (char *s1, char *s2, char *s3)
{
int len1 = strlen (s1), len2 = strlen (s2), len3 = strlen (s3);
char *result = xnew (len1 + len2 + len3 + 1, char);
/* Does the same work as the system V getcwd, but does not need to
guess the buffer size in advance. */
static char *
-etags_getcwd ()
+etags_getcwd (void)
{
#ifdef HAVE_GETCWD
int bufsize = 200;
/* Return a newly allocated string containing the file name of FILE
relative to the absolute directory DIR (which should end with a slash). */
static char *
-relative_filename (file, dir)
- char *file, *dir;
+relative_filename (char *file, char *dir)
{
char *fp, *dp, *afn, *res;
int i;
/* Return a newly allocated string containing the absolute file name
of FILE given DIR (which should end with a slash). */
static char *
-absolute_filename (file, dir)
- char *file, *dir;
+absolute_filename (char *file, char *dir)
{
char *slashp, *cp, *res;
file name of dir where FILE resides given DIR (which should
end with a slash). */
static char *
-absolute_dirname (file, dir)
- char *file, *dir;
+absolute_dirname (char *file, char *dir)
{
char *slashp, *res;
char save;
/* Whether the argument string is an absolute file name. The argument
string must have been canonicalized with canonicalize_filename. */
static bool
-filename_is_absolute (fn)
- char *fn;
+filename_is_absolute (char *fn)
{
return (fn[0] == '/'
#ifdef DOS_NT
/* Upcase DOS drive letter and collapse separators into single slashes.
Works in place. */
static void
-canonicalize_filename (fn)
- register char *fn;
+canonicalize_filename (register char *fn)
{
register char* cp;
char sep = '/';
\f
/* Initialize a linebuffer for use. */
static void
-linebuffer_init (lbp)
- linebuffer *lbp;
+linebuffer_init (linebuffer *lbp)
{
lbp->size = (DEBUG) ? 3 : 200;
lbp->buffer = xnew (lbp->size, char);
/* Set the minimum size of a string contained in a linebuffer. */
static void
-linebuffer_setlen (lbp, toksize)
- linebuffer *lbp;
- int toksize;
+linebuffer_setlen (linebuffer *lbp, int toksize)
{
while (lbp->size <= toksize)
{
/* Like malloc but get fatal error if memory is exhausted. */
static PTR
-xmalloc (size)
- unsigned int size;
+xmalloc (unsigned int size)
{
PTR result = (PTR) malloc (size);
if (result == NULL)
}
static PTR
-xrealloc (ptr, size)
- char *ptr;
- unsigned int size;
+xrealloc (char *ptr, unsigned int size)
{
PTR result = (PTR) realloc (ptr, size);
if (result == NULL)
static stream_list the_streams;
static boolean no_problems = true;
-extern FILE *popen ();
-extern int fclose (), pclose ();
+extern FILE *popen (const char *, const char *);
+extern int fclose (FILE *), pclose (FILE *);
#ifdef CURRENT_USER
extern struct passwd *getpwuid ();
/* Print error message. `s1' is printf control string, `s2' is arg for it. */
static void
-error (s1, s2)
- char *s1, *s2;
+error (char *s1, char *s2)
{
printf ("%s: ", my_name);
printf (s1, s2);
/* Print error message and exit. */
static void
-fatal (s1)
- char *s1;
+fatal (char *s1)
{
error ("%s", s1);
exit (EXIT_FAILURE);
/* Like malloc but get fatal error if memory is exhausted. */
static long *
-xmalloc (size)
- int size;
+xmalloc (int size)
{
long *result = (long *) malloc (((unsigned) size));
if (result == ((long *) NULL))
}
static long *
-xrealloc (ptr, size)
- long *ptr;
- int size;
+xrealloc (long int *ptr, int size)
{
long *result = (long *) realloc (ptr, ((unsigned) size));
if (result == ((long *) NULL))
/* Initialize a linebuffer for use */
void
-init_linebuffer (linebuffer)
- struct linebuffer *linebuffer;
+init_linebuffer (struct linebuffer *linebuffer)
{
linebuffer->size = INITIAL_LINE_SIZE;
linebuffer->buffer = ((char *) xmalloc (INITIAL_LINE_SIZE));
Return the length of the line. */
long
-readline (linebuffer, stream)
- struct linebuffer *linebuffer;
- FILE *stream;
+readline (struct linebuffer *linebuffer, FILE *stream)
{
char *buffer = linebuffer->buffer;
char *p = linebuffer->buffer;
If there is no keyword, return NULL and don't alter *REST. */
char *
-get_keyword (field, rest)
- register char *field;
- char **rest;
+get_keyword (register char *field, char **rest)
{
static char keyword[KEYWORD_SIZE];
register char *ptr;
/* Nonzero if the string FIELD starts with a colon-terminated keyword. */
boolean
-has_keyword (field)
- char *field;
+has_keyword (char *field)
{
char *ignored;
return (get_keyword (field, &ignored) != ((char *) NULL));
the caller has to make it big enough. */
char *
-add_field (the_list, field, where)
- line_list the_list;
- register char *field, *where;
+add_field (line_list the_list, register char *field, register char *where)
{
register char c;
while (true)
}
\f
line_list
-make_file_preface ()
+make_file_preface (void)
{
char *the_string, *temp;
long idiotic_interface;
}
void
-write_line_list (the_list, the_stream)
- register line_list the_list;
- FILE *the_stream;
+write_line_list (register line_list the_list, FILE *the_stream)
{
for ( ;
the_list != ((line_list) NULL) ;
}
\f
int
-close_the_streams ()
+close_the_streams (void)
{
register stream_list rem;
for (rem = the_streams;
}
void
-add_a_stream (the_stream, closing_action)
- FILE *the_stream;
- int (*closing_action)();
+add_a_stream (FILE *the_stream, int (*closing_action) (/* ??? */))
{
stream_list old = the_streams;
the_streams = new_stream ();
}
int
-my_fclose (the_file)
- FILE *the_file;
+my_fclose (FILE *the_file)
{
putc ('\n', the_file);
fflush (the_file);
}
boolean
-open_a_file (name)
- char *name;
+open_a_file (char *name)
{
FILE *the_stream = fopen (name, "a");
if (the_stream != ((FILE *) NULL))
}
void
-put_string (s)
- char *s;
+put_string (char *s)
{
register stream_list rem;
for (rem = the_streams;
}
void
-put_line (string)
- char *string;
+put_line (char *string)
{
register stream_list rem;
for (rem = the_streams;
Call open_a_file for each file. */
void
-setup_files (the_list, field)
- register line_list the_list;
- register char *field;
+setup_files (register line_list the_list, register char *field)
{
register char *start;
register char c;
The result says how big to make the buffer to pass to parse_header. */
int
-args_size (the_header)
- header the_header;
+args_size (header the_header)
{
register header old = the_header;
register line_list rem;
Also, if the header has any FCC fields, call setup_files for each one. */
void
-parse_header (the_header, where)
- header the_header;
- register char *where;
+parse_header (header the_header, register char *where)
{
register header old = the_header;
do
Continuation lines are grouped in the headers they continue. */
header
-read_header ()
+read_header (void)
{
register header the_header = ((header) NULL);
register line_list *next_line = ((line_list *) NULL);
}
\f
void
-write_header (the_header)
- header the_header;
+write_header (header the_header)
{
register header old = the_header;
do
}
\f
int
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
char *command_line;
header the_header;
register int size;
FILE *the_pipe;
- extern char *getenv ();
+ extern char *getenv (const char *);
mail_program_name = getenv ("FAKEMAILER");
if (!(mail_program_name && *mail_program_name))
int group_by = DEFAULT_GROUPING;
char *progname;
-void usage();
+void usage(void);
int
-main (argc, argv)
- int argc;
- char *argv[];
+main (int argc, char **argv)
{
register long address;
char string[18];
}
void
-usage ()
+usage (void)
{
fprintf (stderr, "usage: %s [-de] [-iso]\n", progname);
exit (EXIT_FAILURE);
/* VARARGS1 */
void
-error (s1, s2)
- char *s1, *s2;
+error (char *s1, char *s2)
{
fprintf (stderr, "%s: ", progname);
fprintf (stderr, s1, s2);
/* VARARGS1 */
void
-fatal (s1, s2)
- char *s1, *s2;
+fatal (char *s1, char *s2)
{
error (s1, s2);
exit (EXIT_FAILURE);
/* Like malloc but get fatal error if memory is exhausted. */
void *
-xmalloc (size)
- unsigned int size;
+xmalloc (unsigned int size)
{
void *result = (void *) malloc (size);
if (result == NULL)
}
\f
int
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
int i;
int err_count = 0;
/* Add a source file name boundary marker in the output file. */
void
-put_filename (filename)
- char *filename;
+put_filename (char *filename)
{
char *tmp;
/* Return 1 if file is not found, 0 if it is found. */
int
-scan_file (filename)
- char *filename;
+scan_file (char *filename)
{
int len = strlen (filename);
spaces are output first. */
static INLINE void
-put_char (ch, state)
- int ch;
- struct rcsoc_state *state;
+put_char (int ch, struct rcsoc_state *state)
{
int out_ch;
do
keyword, but were in fact not. */
static void
-scan_keyword_or_put_char (ch, state)
- int ch;
- struct rcsoc_state *state;
+scan_keyword_or_put_char (int ch, struct rcsoc_state *state)
{
if (state->keyword
&& *state->cur_keyword_ptr == ch
true if any were encountered. */
int
-read_c_string_or_comment (infile, printflag, comment, saw_usage)
- FILE *infile;
- int printflag;
- int *saw_usage;
- int comment;
+read_c_string_or_comment (FILE *infile, int printflag, int comment, int *saw_usage)
{
register int c;
struct rcsoc_state state;
MINARGS and MAXARGS are the minimum and maximum number of arguments. */
void
-write_c_args (out, func, buf, minargs, maxargs)
- FILE *out;
- char *func, *buf;
- int minargs, maxargs;
+write_c_args (FILE *out, char *func, char *buf, int minargs, int maxargs)
{
register char *p;
int in_ident = 0;
Accepts any word starting DEF... so it finds DEFSIMPLE and DEFPRED. */
int
-scan_c_file (filename, mode)
- char *filename, *mode;
+scan_c_file (char *filename, char *mode)
{
FILE *infile;
register int c;
*/
void
-skip_white (infile)
- FILE *infile;
+skip_white (FILE *infile)
{
char c = ' ';
while (c == ' ' || c == '\t' || c == '\n' || c == '\r')
}
void
-read_lisp_symbol (infile, buffer)
- FILE *infile;
- char *buffer;
+read_lisp_symbol (FILE *infile, char *buffer)
{
char c;
char *fillp = buffer;
}
int
-scan_lisp_file (filename, mode)
- char *filename, *mode;
+scan_lisp_file (char *filename, char *mode)
{
FILE *infile;
register int c;
#endif
#endif
-char *strerror ();
+char *strerror (int);
#ifdef HAVE_INDEX
extern char *index (const char *, int);
#endif
extern char *rindex (const char *, int);
#endif
-void fatal ();
-void error ();
-void pfatal_with_name ();
-void pfatal_and_delete ();
-char *concat ();
-long *xmalloc ();
-int popmail ();
-int pop_retr ();
-int mbx_write ();
-int mbx_delimit_begin ();
-int mbx_delimit_end ();
+void fatal (char *s1, char *s2, char *s3);
+void error (char *s1, char *s2, char *s3);
+void pfatal_with_name (char *name);
+void pfatal_and_delete (char *name);
+char *concat (char *s1, char *s2, char *s3);
+long *xmalloc (unsigned int size);
+int popmail (char *mailbox, char *outfile, int preserve, char *password, int reverse_order);
+int pop_retr (popserver server, int msgno, FILE *arg);
+int mbx_write (char *line, int len, FILE *mbf);
+int mbx_delimit_begin (FILE *mbf);
+int mbx_delimit_end (FILE *mbf);
/* Nonzero means this is name of a lock file to delete on fatal error. */
char *delete_lockname;
int
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
char *inname, *outname;
int indesc, outdesc;
/* Print error message and exit. */
void
-fatal (s1, s2, s3)
- char *s1, *s2, *s3;
+fatal (char *s1, char *s2, char *s3)
{
if (delete_lockname)
unlink (delete_lockname);
are args for it or null. */
void
-error (s1, s2, s3)
- char *s1, *s2, *s3;
+error (char *s1, char *s2, char *s3)
{
fprintf (stderr, "movemail: ");
if (s3)
}
void
-pfatal_with_name (name)
- char *name;
+pfatal_with_name (char *name)
{
fatal ("%s for %s", strerror (errno), name);
}
void
-pfatal_and_delete (name)
- char *name;
+pfatal_and_delete (char *name)
{
char *s = strerror (errno);
unlink (name);
/* Return a newly-allocated string whose contents concatenate those of s1, s2, s3. */
char *
-concat (s1, s2, s3)
- char *s1, *s2, *s3;
+concat (char *s1, char *s2, char *s3)
{
int len1 = strlen (s1), len2 = strlen (s2), len3 = strlen (s3);
char *result = (char *) xmalloc (len1 + len2 + len3 + 1);
/* Like malloc but get fatal error if memory is exhausted. */
long *
-xmalloc (size)
- unsigned size;
+xmalloc (unsigned int size)
{
long *result = (long *) malloc (size);
if (!result)
*/
int
-popmail (mailbox, outfile, preserve, password, reverse_order)
- char *mailbox;
- char *outfile;
- int preserve;
- char *password;
- int reverse_order;
+popmail (char *mailbox, char *outfile, int preserve, char *password, int reverse_order)
{
int nmsgs, nbytes;
register int i;
int mbfi;
FILE *mbf;
- char *getenv ();
+ char *getenv (const char *);
popserver server;
int start, end, increment;
char *user, *hostname;
}
int
-pop_retr (server, msgno, arg)
- popserver server;
- int msgno;
- FILE *arg;
+pop_retr (popserver server, int msgno, FILE *arg)
{
- extern char *strerror ();
+ extern char *strerror (int);
char *line;
int ret;
&& (a[4] == ' '))
int
-mbx_write (line, len, mbf)
- char *line;
- int len;
- FILE *mbf;
+mbx_write (char *line, int len, FILE *mbf)
{
#ifdef MOVEMAIL_QUOTE_POP_FROM_LINES
if (IS_FROM_LINE (line))
}
int
-mbx_delimit_begin (mbf)
- FILE *mbf;
+mbx_delimit_begin (FILE *mbf)
{
time_t now;
struct tm *ltime;
}
int
-mbx_delimit_end (mbf)
- FILE *mbf;
+mbx_delimit_end (FILE *mbf)
{
if (putc ('\n', mbf) == EOF)
return (NOTOK);
* explanation of the error.
*/
popserver
-pop_open (host, username, password, flags)
- char *host;
- char *username;
- char *password;
- int flags;
+pop_open (char *host, char *username, char *password, int flags)
{
int sock;
popserver server;
* connection impossible.
*/
int
-pop_stat (server, count, size)
- popserver server;
- int *count;
- int *size;
+pop_stat (popserver server, int *count, int *size)
{
char *fromserver;
char *end_ptr;
* connection impossible.
*/
int
-pop_list (server, message, IDs, sizes)
- popserver server;
- int message;
- int **IDs;
- int **sizes;
+pop_list (popserver server, int message, int **IDs, int **sizes)
{
int how_many, i;
char *fromserver;
* Side effects: May kill connection on error.
*/
int
-pop_retrieve (server, message, markfrom, msg_buf)
- popserver server;
- int message;
- int markfrom;
- char **msg_buf;
+pop_retrieve (popserver server, int message, int markfrom, char **msg_buf)
{
int *IDs, *sizes, bufsize, fromcount = 0, cp = 0;
char *ptr, *fromserver;
}
int
-pop_retrieve_first (server, message, response)
- popserver server;
- int message;
- char **response;
+pop_retrieve_first (popserver server, int message, char **response)
{
sprintf (pop_error, "RETR %d", message);
return (pop_multi_first (server, pop_error, response));
*/
int
-pop_retrieve_next (server, line)
- popserver server;
- char **line;
+pop_retrieve_next (popserver server, char **line)
{
return (pop_multi_next (server, line));
}
int
-pop_retrieve_flush (server)
- popserver server;
+pop_retrieve_flush (popserver server)
{
return (pop_multi_flush (server));
}
int
-pop_top_first (server, message, lines, response)
- popserver server;
- int message, lines;
- char **response;
+pop_top_first (popserver server, int message, int lines, char **response)
{
sprintf (pop_error, "TOP %d %d", message, lines);
return (pop_multi_first (server, pop_error, response));
*/
int
-pop_top_next (server, line)
- popserver server;
- char **line;
+pop_top_next (popserver server, char **line)
{
return (pop_multi_next (server, line));
}
int
-pop_top_flush (server)
- popserver server;
+pop_top_flush (popserver server)
{
return (pop_multi_flush (server));
}
int
-pop_multi_first (server, command, response)
- popserver server;
- char *command;
- char **response;
+pop_multi_first (popserver server, char *command, char **response)
{
if (server->in_multi)
{
0, LINE is set to null. */
int
-pop_multi_next (server, line)
- popserver server;
- char **line;
+pop_multi_next (popserver server, char **line)
{
char *fromserver;
int ret;
}
int
-pop_multi_flush (server)
- popserver server;
+pop_multi_flush (popserver server)
{
char *line;
int ret;
* otherwise.
*/
int
-pop_delete (server, message)
- popserver server;
- int message;
+pop_delete (popserver server, int message)
{
if (server->in_multi)
{
* Side effects: Closes connection on error.
*/
int
-pop_noop (server)
- popserver server;
+pop_noop (popserver server)
{
if (server->in_multi)
{
* Side effects: Closes the connection on error.
*/
int
-pop_last (server)
- popserver server;
+pop_last (popserver server)
{
char *fromserver;
* Side effects: Closes the connection on error.
*/
int
-pop_reset (server)
- popserver server;
+pop_reset (popserver server)
{
if (pop_retrieve_flush (server))
{
* function is called, even if an error occurs.
*/
int
-pop_quit (server)
- popserver server;
+pop_quit (popserver server)
{
int ret = 0;
* into pop_error.
*/
static int
-socket_connection (host, flags)
- char *host;
- int flags;
+socket_connection (char *host, int flags)
{
#ifdef HAVE_GETADDRINFO
struct addrinfo *res, *it;
* THE RETURNED LINE MAY CONTAIN EMBEDDED NULLS!
*/
static int
-pop_getline (server, line)
- popserver server;
- char **line;
+pop_getline (popserver server, char **line)
{
#define GETLINE_ERROR "Error reading from server: "
* Side effects: Closes the connection on error.
*/
static int
-sendline (server, line)
- popserver server;
- char *line;
+sendline (popserver server, char *line)
{
#define SENDLINE_ERROR "Error writing to POP server: "
int ret;
* Return value: Same as write. Pop_error is not set.
*/
static int
-fullwrite (fd, buf, nbytes)
- int fd;
- char *buf;
- int nbytes;
+fullwrite (int fd, char *buf, int nbytes)
{
char *cp;
int ret = 0;
* Side effects: On failure, may make the connection unusable.
*/
static int
-getok (server)
- popserver server;
+getok (popserver server)
{
char *fromline;
* since the last pop_reset) may be lost.
*/
void
-pop_close (server)
- popserver server;
+pop_close (popserver server)
{
pop_trash (server);
free ((char *) server);
* pop_close or pop_quit after this function has been called.
*/
static void
-pop_trash (server)
- popserver server;
+pop_trash (popserver server)
{
if (server->file >= 0)
{
null, or 0 if it does not contain one. */
static char *
-find_crlf (in_string, len)
- char *in_string;
- int len;
+find_crlf (char *in_string, int len)
{
while (len--)
{
/* Reset the stopwatch to zero. */
void
-reset_watch ()
+reset_watch (void)
{
EMACS_GET_TIME (TV1);
watch_not_started = 0;
If reset_watch was not called yet, exit. */
char *
-get_time ()
+get_time (void)
{
if (watch_not_started)
exit (EXIT_FAILURE); /* call reset_watch first ! */
#endif
\f
int
-main ()
+main (void)
{
int c;
while ((c = getchar ()) != EOF)
/* Print error message. `s1' is printf control string, `s2' is arg for it. */
void
-error (s1, s2)
- char *s1, *s2;
+error (char *s1, char *s2)
{
fprintf (stderr, "sorted-doc: ");
fprintf (stderr, s1, s2);
/* Print error message and exit. */
void
-fatal (s1, s2)
- char *s1, *s2;
+fatal (char *s1, char *s2)
{
error (s1, s2);
exit (EXIT_FAILURE);
/* Like malloc but get fatal error if memory is exhausted. */
char *
-xmalloc (size)
- int size;
+xmalloc (int size)
{
char *result = malloc ((unsigned)size);
if (result == NULL)
}
char *
-xstrdup (str)
- char * str;
+xstrdup (char *str)
{
char *buf = xmalloc (strlen (str) + 1);
(void) strcpy (buf, str);
/* Comparison function for qsort to call. */
int
-cmpdoc (a, b)
- DOCSTR **a;
- DOCSTR **b;
+cmpdoc (DOCSTR **a, DOCSTR **b)
{
register int val = strcmp ((*a)->name, (*b)->name);
if (val) return val;
};
int
-main ()
+main (void)
{
register DOCSTR *dp = NULL; /* allocated DOCSTR */
register LINE *lp = NULL; /* allocated line */
#endif
int
-usage (err)
- int err;
+usage (int err)
{
fprintf (stdout, "Usage: update-game-score [-m MAX ] [ -r ] game/scorefile SCORE DATA\n");
fprintf (stdout, " update-game-score -h\n");
void lose (const char *msg) NO_RETURN;
void
-lose (msg)
- const char *msg;
+lose (const char *msg)
{
fprintf (stderr, "%s\n", msg);
exit (EXIT_FAILURE);
#endif /* ! HAVE_STRERROR */
void
-lose_syserr (msg)
- const char *msg;
+lose_syserr (const char *msg)
{
fprintf (stderr, "%s: %s\n", msg, strerror (errno));
exit (EXIT_FAILURE);
}
char *
-get_prefix (running_suid, user_prefix)
- int running_suid;
- char *user_prefix;
+get_prefix (int running_suid, char *user_prefix)
{
if (!running_suid && user_prefix == NULL)
lose ("Not using a shared game directory, and no prefix given.");
}
int
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
int c, running_suid;
void *lockstate;
}
int
-read_score (f, score)
- FILE *f;
- struct score_entry *score;
+read_score (FILE *f, struct score_entry *score)
{
int c;
if (feof (f))
}
int
-read_scores (filename, scores, count)
- const char *filename;
- struct score_entry **scores;
- int *count;
+read_scores (const char *filename, struct score_entry **scores, int *count)
{
int readval, scorecount, cursize;
struct score_entry *ret;
}
int
-score_compare (a, b)
- const void *a;
- const void *b;
+score_compare (const void *a, const void *b)
{
const struct score_entry *sa = (const struct score_entry *) a;
const struct score_entry *sb = (const struct score_entry *) b;
}
int
-score_compare_reverse (a, b)
- const void *a;
- const void *b;
+score_compare_reverse (const void *a, const void *b)
{
const struct score_entry *sa = (const struct score_entry *) a;
const struct score_entry *sb = (const struct score_entry *) b;
}
int
-push_score (scores, count, newscore, username, newdata)
- struct score_entry **scores;
- int *count; int newscore;
- char *username;
- char *newdata;
+push_score (struct score_entry **scores, int *count, int newscore, char *username, char *newdata)
{
struct score_entry *newscores
= (struct score_entry *) realloc (*scores,
}
void
-sort_scores (scores, count, reverse)
- struct score_entry *scores;
- int count;
- int reverse;
+sort_scores (struct score_entry *scores, int count, int reverse)
{
qsort (scores, count, sizeof (struct score_entry),
reverse ? score_compare_reverse : score_compare);
}
int
-write_scores (filename, scores, count)
- const char *filename;
- const struct score_entry * scores;
- int count;
+write_scores (const char *filename, const struct score_entry *scores, int count)
{
FILE *f;
int i;
}
int
-lock_file (filename, state)
- const char *filename;
- void **state;
+lock_file (const char *filename, void **state)
{
int fd;
struct stat buf;
}
int
-unlock_file (filename, state)
- const char *filename;
- void *state;
+unlock_file (const char *filename, void *state)
{
char *lockpath = (char *) state;
int ret = unlink (lockpath);