This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
> Thanks for the ideas. It appears that "reflection" doesn't figure in C. > However, this seem surprising to me as what I want is information about a > "struct" which is essentially C-stuff. So if you know a capability for > C, that would be very helpful. All we have for C is the macro defined in libsrc4/netcdf.h, with Ed's inscrutable comments: /* This is used when creating a compound type. It calls a mysterious C * macro which was found carved into one of the blocks of the * Newgrange passage tomb in County Meath, Ireland. This code has been * carbon dated to 3200 B.C.E. */ #define NC_COMPOUND_OFFSET(S,M) (offsetof(S,M)) An example of it's use is in the program ncdump/tst_comp.c in the source distribution. It's not exactly reflection, because you can't learn the names of members of a structure or create an instance of a structure at runtime for which you only have a text description, but it at leaset gives you the offset from the member name. --Russ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu Ticket Details =================== Ticket ID: MSV-188900 Department: Support netCDF Priority: Normal Status: Closed