-#include <ansidecl.h>
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
void print_trig_stuff __P ((void));
int
-DEFUN_VOID(main)
+main (void)
{
- CONST char str[] = "123.456";
+ const char str[] = "123.456";
double x,h,li,lr,a,lrr;
x = atof (str);
}
\f
-#define PI 3.14159265358979323846264338327
-
-const double RAD[5] = { 0, PI/2, PI, (3*PI)/2, 2*PI };
-const int DEG[5] = { 0, 90, 180, 360 };
+const double RAD[5] = { 0, M_PI/2, M_PI, (3*M_PI)/2, 2*M_PI };
#define PRINT_IT_1_ARG(_func, _arg, _value) \
- (_value) = (_func)((_arg)); \
+ (_value) = (_func) ((_arg)); \
if (errno) { \
errno = 0; \
- printf("%s = ERROR %s\n", #_func, strerror(errno)); \
+ printf ("%s = ERROR %s\n", #_func, strerror (errno)); \
} else \
- printf("%s(%g) = %g\n", #_func, _arg, (_value)); \
+ printf ("%s(%g) = %g\n", #_func, _arg, (_value)); \
#define PRINT_IT_2_ARG(_func, _arg1, _arg2, _value) \
- (_value) = (_func)((_arg1),(_arg2)); \
+ (_value) = (_func) ((_arg1),(_arg2)); \
if (errno) { \
errno = 0; \
- printf("%s = ERROR %s\n", #_func, strerror(errno)); \
+ printf ("%s = ERROR %s\n", #_func, strerror (errno)); \
} else \
- printf("%s(%g, %g) = %g\n", #_func, _arg1, _arg2, (_value)); \
+ printf ("%s(%g, %g) = %g\n", #_func, _arg1, _arg2, (_value)); \
void
-DEFUN_VOID (print_trig_stuff)
+print_trig_stuff(void)
{
double value, arg1, arg2;
int i;
-#include <ansidecl.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
int win = 0;
void
-DEFUN(handler, (sig), int sig)
+handler (sig)
+ int sig;
{
- printf("Received signal %d (%s).\n", sig, strsignal(sig));
+ printf ("Received signal %d (%s).\n", sig, strsignal(sig));
win = 1;
}
int
-DEFUN_VOID(main)
+main (void)
{
- if (signal(SIGTERM, handler) == SIG_ERR)
+ if (signal (SIGTERM, handler) == SIG_ERR)
{
- perror("signal: SIGTERM");
- exit(EXIT_FAILURE);
+ perror ("signal: SIGTERM");
+ exit (EXIT_FAILURE);
}
- puts("Set handler.");
+ puts ("Set handler.");
- printf("Sending myself signal %d.\n", SIGTERM);
- fflush(stdout);
+ printf ("Sending myself signal %d.\n", SIGTERM);
+ fflush (stdout);
- if (raise(SIGTERM) < 0)
+ if (raise (SIGTERM) < 0)
{
- perror("raise: SIGTERM");
- exit(EXIT_FAILURE);
+ perror ("raise: SIGTERM");
+ exit (EXIT_FAILURE);
}
if (!win)
{
- puts("Didn't get any signal. Test FAILED!");
- exit(EXIT_FAILURE);
+ puts ("Didn't get any signal. Test FAILED!");
+ exit (EXIT_FAILURE);
}
- puts("Got a signal. Test succeeded.");
- exit(EXIT_SUCCESS);
+ puts ("Got a signal. Test succeeded.");
+ exit (EXIT_SUCCESS);
}
-#include <ansidecl.h>
#include <stdio.h>
#include <string.h>
int
-DEFUN_VOID(main)
+main (void)
{
char *bp;
size_t size;
-#include <ansidecl.h>
#include <stdio.h>
int
-DEFUN_VOID(main)
+main (void)
{
int i;
puts ("This should print \"wow = I\" for I from 0 to 39 inclusive.");
-#include <ansidecl.h>
#include <stdio.h>
int
-DEFUN_VOID(main)
+main (void)
{
char buf[80];
int i;
-/* Copyright (C) 1991 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+/* Copyright (C) 1991, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
-The GNU C Library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
-The GNU C Library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Library General Public License for more details.
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
-#include <ansidecl.h>
#include <stdarg.h>
#include <stdio.h>
-
/* Read formatted input from STREAM according to the format string FORMAT. */
/* VARARGS2 */
int
-DEFUN(fscanf, (stream, format),
- FILE *stream AND CONST char *format DOTS)
+fscanf (FILE *stream, const char *format, ...)
{
va_list arg;
int done;
- va_start(arg, format);
- done = __vfscanf(stream, format, arg);
- va_end(arg);
+ va_start (arg, format);
+ done = __vfscanf (stream, format, arg);
+ va_end (arg);
return done;
}
-#include <ansidecl.h>
#include <stdio.h>
#undef getc
#define fgetc getc
-/* Copyright (C) 1992, 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1996, 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include <ansidecl.h>
#include <stdio.h>
#include <obstack.h>
#include <stdarg.h>
/* Output-room function for obstack streams. */
static void
-DEFUN(grow, (stream, c), FILE *stream AND int c)
+grow (stream, c)
+ FILE *stream;
+ int c;
{
struct obstack *const obstack = (struct obstack *) stream->__cookie;
There is no external state to munge. */
static int
-DEFUN(seek, (cookie, pos, whence),
- PTR cookie AND fpos_t *pos AND int whence)
+seek (cookie, pos, whence)
+ void *cookie;
+ fpos_t *pos;
+ int whence;
{
switch (whence)
{
Only what has been written to the stream can be read back. */
static int
-DEFUN(input, (stream), FILE *stream)
+input (stream)
+ FILE *stream;
{
/* Re-sync with the obstack, growing the object if necessary. */
grow (stream, EOF);
/* Initialize STREAM to talk to OBSTACK. */
static void
-DEFUN(init_obstream, (stream, obstack),
- FILE *stream AND struct obstack *obstack)
+init_obstream (stream, obstack)
+ FILE *stream;
+ struct obstack *obstack;
{
stream->__mode.__write = 1;
stream->__mode.__read = 1;
}
int
-DEFUN(obstack_vprintf, (obstack, format, args),
- struct obstack *obstack AND const char *format AND va_list args)
+obstack_vprintf (obstack, format, args)
+ struct obstack *obstack;
+ const char *format;
+ va_list args;
{
FILE f;
bzero (&f, sizeof (f));
}
int
-DEFUN(obstack_printf, (obstack, format),
- struct obstack *obstack AND const char *format DOTS)
+obstack_printf (obstack, format DOTS)
+ struct obstack *obstack;
+ const char *format;
{
int result;
va_list ap;
-#include <ansidecl.h>
#include <stdio.h>
#undef putc
#define fputc putc