Re: documentation on rootcint

From: Masaharu Goto (gotom@hpyiddq.jpn.hp.com)
Date: Thu Dec 18 1997 - 00:59:12 MET


Bruce,

About embedding C functions,

 You can use rootcint exactly the same way as you embed C++ library. The
 only difference is that you'll need to add 'extern "C"' for the C function
 prototypes.  Let me know if this doesn't work.

 #ifdef __cplusplus
 extern "C" {
 #endif

 enum    _elementHDUtype{HDU_UNKNOWN,PHDU,IMAGE,ATABLE,BTABLE,OTHER};
 typedef enum _elementHDUtype  elementHDUtype;
 void encodeHDUtype(elementHDUtype type, char *str);
 
 #ifdef __cplusplus
 }
 #endif

 Makecint , raw cint version of rootcint, has C embedding mode which
 enables embedding C functions without adding 'extern "C"'.  Rootcint 
 doesn't expose this capability, however, this should be simple enough.

 Masaharu Goto


> 
> Hi,
>   I'm trying to include just a set of C functions in root.  I know, it's
> a C++ framework, but...
> 
>   I'm running into a problem, I believe, with the following construct:
> 
> 
> enum    _elementHDUtype{HDU_UNKNOWN,PHDU,IMAGE,ATABLE,BTABLE,OTHER};
> 
> typedef enum _elementHDUtype  elementHDUtype;
> 
> void encodeHDUtype(elementHDUtype type, char *str);
> 
> I'm not sure how to tell rootcint about the type elementHDUtype so that
> I can run a macro of the form:
> 
> char tmp[100];
> encodeHDUtype(IMAGE,tmp);
> 
> and get tmp assigned the value of "IMAGE"
> 
> Thanks!
> bruce
> 
> --
> 
> Bruce O'Neel                       phone:  +41 22 950 91 22 (direct)
> INTEGRAL Science Data Centre               +41 22 950 91 00 (switchb.)
> Chemin d'Ecogia 16                 fax:    +41 22 950 91 33
> CH-1290 VERSOIX                    e-mail: Bruce.Oneel@obs.unige.ch
> Switzerland                        WWW:    http://obswww.unige.ch/isdc/
> 



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:26:23 MET