# define extern?

Damon Permezel damonp at daemon.UUCP
Mon Jun 4 17:01:15 AEST 1984


What I have eventually come up with is the following. I am
not entirely satisfied with it, but it works ok. I tried the
# define extern route, but was unable to provide initialisers.

===extern.h=====
/*
 * common external definitions
 */

#define EXTERN_IT

#include "extern.c"
====extern.c====
/*
 * external definitions
 */

#ifndef EXTERN_IT
#   include "dclass.h"
#   undef  ev
#   define ev(type, var, init)  type var = init
#else
#   undef  ev
#   define ev(type, var, init)  extern type var
#endif

ev(char *, usage, "dclass {Machine=<mach> | [Class=]<class>}");
ev(char *, mach, 0);            /* desired machine                      */
ev(char, home[MAX_PATH+1], 0);  /* home directory                       */
ev(char, verbose, 0);           /* verbose flag                         */



More information about the Comp.unix.wizards mailing list