%{/* nlmheader.y - parse NLM header specification keywords.
- Copyright 1993, 1994, 1995, 1997, 1998, 2001, 2002
+ Copyright 1993, 1994, 1995, 1997, 1998, 2001, 2002, 2003
Free Software Foundation, Inc.
This file is part of GNU Binutils.
#define yyerror(msg) nlmheader_error (msg);
/* Local functions. */
-static int yylex PARAMS ((void));
-static void nlmlex_file_push PARAMS ((const char *));
-static bfd_boolean nlmlex_file_open PARAMS ((const char *));
-static int nlmlex_buf_init PARAMS ((void));
-static char nlmlex_buf_add PARAMS ((int));
-static long nlmlex_get_number PARAMS ((const char *));
-static void nlmheader_identify PARAMS ((void));
-static void nlmheader_warn PARAMS ((const char *, int));
-static void nlmheader_error PARAMS ((const char *));
-static struct string_list * string_list_cons PARAMS ((char *,
- struct string_list *));
-static struct string_list * string_list_append PARAMS ((struct string_list *,
- struct string_list *));
-static struct string_list * string_list_append1 PARAMS ((struct string_list *,
- char *));
-static char *xstrdup PARAMS ((const char *));
+static int yylex (void);
+static void nlmlex_file_push (const char *);
+static bfd_boolean nlmlex_file_open (const char *);
+static int nlmlex_buf_init (void);
+static char nlmlex_buf_add (int);
+static long nlmlex_get_number (const char *);
+static void nlmheader_identify (void);
+static void nlmheader_warn (const char *, int);
+static void nlmheader_error (const char *);
+static struct string_list * string_list_cons (char *, struct string_list *);
+static struct string_list * string_list_append (struct string_list *,
+ struct string_list *);
+static struct string_list * string_list_append1 (struct string_list *,
+ char *);
+static char *xstrdup (const char *);
%}
/* Start the lexer going on the main input file. */
bfd_boolean
-nlmlex_file (name)
- const char *name;
+nlmlex_file (const char *name)
{
current.next = NULL;
return nlmlex_file_open (name);
/* Start the lexer going on a subsidiary input file. */
static void
-nlmlex_file_push (name)
- const char *name;
+nlmlex_file_push (const char *name)
{
struct input *push;
/* Start lexing from a file. */
static bfd_boolean
-nlmlex_file_open (name)
- const char *name;
+nlmlex_file_open (const char *name)
{
current.file = fopen (name, "r");
if (current.file == NULL)
((void) (lex_buf != NULL ? lex_pos = 0 : nlmlex_buf_init ()))
static int
-nlmlex_buf_init ()
+nlmlex_buf_init (void)
{
lex_size = 10;
lex_buf = xmalloc (lex_size + 1);
: nlmlex_buf_add (c)))
static char
-nlmlex_buf_add (c)
- int c;
+nlmlex_buf_add (int c)
{
if (lex_pos >= lex_size)
{
code. */
static int
-yylex ()
+yylex (void)
{
int c;
/* Get a number from a string. */
static long
-nlmlex_get_number (s)
- const char *s;
+nlmlex_get_number (const char *s)
{
long ret;
char *send;
number. */
static void
-nlmheader_identify ()
+nlmheader_identify (void)
{
static int done;
/* Issue a warning. */
static void
-nlmheader_warn (s, imax)
- const char *s;
- int imax;
+nlmheader_warn (const char *s, int imax)
{
nlmheader_identify ();
fprintf (stderr, "%s:%d: %s", current.name, current.lineno, s);
/* Report an error. */
static void
-nlmheader_error (s)
- const char *s;
+nlmheader_error (const char *s)
{
nlmheader_warn (s, -1);
++parse_errors;
/* Add a string to a string list. */
static struct string_list *
-string_list_cons (s, l)
- char *s;
- struct string_list *l;
+string_list_cons (char *s, struct string_list *l)
{
struct string_list *ret;
/* Append a string list to another string list. */
static struct string_list *
-string_list_append (l1, l2)
- struct string_list *l1;
- struct string_list *l2;
+string_list_append (struct string_list *l1, struct string_list *l2)
{
register struct string_list **pp;
/* Append a string to a string list. */
static struct string_list *
-string_list_append1 (l, s)
- struct string_list *l;
- char *s;
+string_list_append1 (struct string_list *l, char *s)
{
struct string_list *n;
register struct string_list **pp;
/* Duplicate a string in memory. */
static char *
-xstrdup (s)
- const char *s;
+xstrdup (const char *s)
{
unsigned long len;
char *ret;