S
Steven T. Hatton
I'm trying to figure out if this code (which I'm sure was written for a C
compiler, could be considered legal C++. My confusion is from the last bit
of code at the end. Could someone explain to me what the reason for this
is?
#ifndef MAIN_H
#define MAIN_H
/*
* function prototype insulation
*/
#ifndef _
# ifdef __STDC__
# define _(x) x
# else
# define _(x) ()
# endif
#endif /* _ */
/*
* array manipulation
*/
#define SIZEOF(a) (sizeof(a) / sizeof(a[0]))
#define ENDOF(a) ((a) + SIZEOF(a))
/*
* Take the define out of comments to debug
* the utilities.
* /
#define DEBUG
*/
#endif /* MAIN_H */
/* hexdump.h */
#ifndef HEXDUMP_H
#define HEXDUMP_H
#include <main.h>
void hexdump _((char *infile, char *outfile, long start, long finish,
int by_lines, int width, int no_ascii, int radix));
#endif /* HEXDUMP_H */
/* hexdump.c */
void
hexdump(infile, outfile, start, finish, by_lines, width, no_ascii, rdx)
char *infile;
char *outfile;
long start;
long finish;
int by_lines;
int width;
int no_ascii;
int rdx;
{
FILE *input;
FILE *output;
long addr;
long nlines;
int state;
int c;
unsigned char *line;
int addr_width;
int byte_width;
/*...*/
compiler, could be considered legal C++. My confusion is from the last bit
of code at the end. Could someone explain to me what the reason for this
is?
#ifndef MAIN_H
#define MAIN_H
/*
* function prototype insulation
*/
#ifndef _
# ifdef __STDC__
# define _(x) x
# else
# define _(x) ()
# endif
#endif /* _ */
/*
* array manipulation
*/
#define SIZEOF(a) (sizeof(a) / sizeof(a[0]))
#define ENDOF(a) ((a) + SIZEOF(a))
/*
* Take the define out of comments to debug
* the utilities.
* /
#define DEBUG
*/
#endif /* MAIN_H */
/* hexdump.h */
#ifndef HEXDUMP_H
#define HEXDUMP_H
#include <main.h>
void hexdump _((char *infile, char *outfile, long start, long finish,
int by_lines, int width, int no_ascii, int radix));
#endif /* HEXDUMP_H */
/* hexdump.c */
void
hexdump(infile, outfile, start, finish, by_lines, width, no_ascii, rdx)
char *infile;
char *outfile;
long start;
long finish;
int by_lines;
int width;
int no_ascii;
int rdx;
{
FILE *input;
FILE *output;
long addr;
long nlines;
int state;
int c;
unsigned char *line;
int addr_width;
int byte_width;
/*...*/