Le 15/12/2010 20:41, Bernd Kallies a écrit : > >> Are you actually referring to the main API, or to inline helpers such as >> hwloc/helpers.h ? The latter are not strictly part of the API, and may >> be changed easily since they are not in the ABI. >> > It is not really clear to me what belongs to the main API, and what are > helpers.
The main API is hwloc.h (and its dependency hwloc/bitmap.h or cpuset.h). That's what's implemented in src/*.c Inline helpers are all static inline functions in most hwloc/*.h headers (except config.h and rename.h which are special). > I'm referring to things like the following: > > int hwloc_obj_attr_snprintf(char * __hwloc_restrict string, > size_t size, > hwloc_obj_t obj, > const char * __hwloc_restrict separator, > int verbose); > > int hwloc_obj_snprintf(char * __hwloc_restrict string, > size_t size, > hwloc_topology_t topology, > hwloc_obj_t obj, > const char * __hwloc_restrict indexprefix, > int verbose); > > The prototypes are in hwloc.h ("main" API ?). The true source of these > are in src/traversal.c ("helper" API ?). There the topology parameter of > hwloc_obj_snprintf has attribute unused. Things like that. > hwloc_obj_snprintf is deprecated anyway. We probably needed the topology flag in the past, and we couldn't remove it later because it would have broken the ABI. As I said, we're trying to keep things consistent. My understanding is that a function should have a topology parameter if it traverses some links between objects inside the topology. If it only operates on a given object and does not traverse the topology at all, it will likely not need any topology parameter. Brice