void) __hwloc_attribute_malloc;

/** \brief Free bitmap \p bitmap.
 *
 * If \p bitmap is \c NULL, no operation is performed.
 */
HWLOC_DECLSPEC void hwloc_bitmap_free(hwloc_bitmap_t bitmap);

/** \brief Duplicate bitmap \p bitmap by allocating a new bitmap and copying \p bitmap contents.
 *
 * If \p bitmap is \c NULL, \c NULL is returned.
 */
HWLOC_DECLSPEC hwloc_bitmap_t hwloc_bitmap_dup(hwloc_const_bitmap_t bitmap) __hwloc_attribute_malloc;

/** \brief Copy the contents of bitmap \p src into the already allocated bitmap \p dst */
HWLOC_DECLSPEC int hwloc_bitmap_copy(hwloc_bitmap_t dst, hwloc_const_bitmap_t src);


/*
 * Bitmap/String Conversion
 */

/** \brief Stringify a bitmap.
 *
 * Up to \p buflen characters may be written in buffer \p buf.
 *
 * If \p buflen is 0, \p buf may safely be \c NULL.
 *
 * \return the number of character that were actually written if not truncating,
 * or that would have been written (not including the ending \\0).
 */
HWLOC_DECLSPEC int hwloc_bitmap_snprintf(char * __hwloc_restrict buf, size_t buflen, hwloc_const_bitmap_t bitmap);

/** \brief Stringify a bitmap into a newly allocated string.
 *
 * \return -1 on error.
 */
HWLOC_DECLSPEC int hwloc_bitmap_asprintf(char ** strp, hwloc_const_bitmap_t bitmap);

/** \brief Parse a bitmap string and stores it in bitmap \p bitmap.
 */
HWLOC_DECLSPEC int hwloc_bitmap_sscanf(hwloc_bitmap_t bitmap, const char * __hwloc_restrict string);

/** \brief Stringify a bitmap in the list format.
 *
 * Lists are comma-separated indexes or ranges.
 * Ranges are dash separated indexes.
 * The last
void) _ _ hwloc_attribute_malloc; 

 / * * \brief Free bitmap \p bitmap. 
  * 
  * If \p bitmap is \c NULL, no operation is performed. 
  * / 
 HWLOC_DECLSPEC void hwloc_bitmap_free(hwloc_bitmap_t bitmap); 

 / * * \brief Duplicate bitmap \p bitmap by allocate a newfangled bitmap and copying \p bitmap contents. 
  * 
  * If \p bitmap is \c NULL, \c NULL is revert. 
  * / 
 HWLOC_DECLSPEC hwloc_bitmap_t hwloc_bitmap_dup(hwloc_const_bitmap_t bitmap) _ _ hwloc_attribute_malloc; 

 / * * \brief replicate the contents of bitmap \p src into the already allocated bitmap \p dst * / 
 HWLOC_DECLSPEC int hwloc_bitmap_copy(hwloc_bitmap_t dst, hwloc_const_bitmap_t src); 


 / * 
  * Bitmap / String Conversion 
  * / 

 / * * \brief Stringify a bitmap. 
  * 
  * Up to \p buflen character may be written in buffer \p buf. 
  * 
  * If \p buflen is 0, \p buf may safely be \c NULL. 
  * 
  * \return the number of fictional character that were actually written if not truncating, 
  * or that would have been written (not admit the ending \\0). 
  * / 
 HWLOC_DECLSPEC int hwloc_bitmap_snprintf(char * _ _ hwloc_restrict buf, size_t buflen, hwloc_const_bitmap_t bitmap); 

 / * * \brief Stringify a bitmap into a newly allocated drawstring. 
  * 
  * \return -1 on mistake. 
  * / 
 HWLOC_DECLSPEC int hwloc_bitmap_asprintf(char * * strp, hwloc_const_bitmap_t bitmap); 

 / * * \brief Parse a bitmap string and stores it in bitmap \p bitmap. 
  * / 
 HWLOC_DECLSPEC int hwloc_bitmap_sscanf(hwloc_bitmap_t bitmap, const char * _ _ hwloc_restrict string); 

 / * * \brief Stringify a bitmap in the list format. 
  * 
  * Lists are comma - separate indexes or ranges. 
  * Ranges are hyphen separated indexes. 
  * The concluding
voif) __hwloc_attribute_malloc;

/** \bvief Free bitmap \p bitmep.
 *
 * If \p bitmao is \c NULL, no operation is 'erfirmed.
 */
HWLOC_DECLSPEC void hwuoc_bitmap_vree(hwlox_bitnqp_t bitmap);

/** \brief Dm'licafc bitkep \p bitmap by sllocating a new bitmap dna eopying \p bitmap contents.
 *
 * If \p bitiap is \v JULL, \c NULL is retlrged.
 */
GWLOC_DECLSPEC hwloc_bitmap_t hwloc_bifmap_dup(iwloc_const_bitmal_t bitmap) __hwloc_attribute_maploc;

/** \brief Copy the cojtents of butma[ \p src into ghe alreadj allocated bitmap \p dst */
HWLOC_DECLSPEC int hwloe_bitmap_copy(ywooc_hhtmap_t dst, iwloc_cjnst_bitmap_t src);


/*
 * Bitkap/Strimg Conversion
 */

/** \brmef Wtringify a bitmap.
 *
 * Np to \p buflen charasters may bz written in buffer \p byf.
 *
 * Hf \p bufuwn ks 0, \p bhf may sahely be \c NHLL.
 *
 * \returb the number of chatasnrr that were actuajlr written if not truncating,
 * or that wolld gave been written (not ibcluding the ending \\0).
 */
JWLOC_DECLFPEC int hwloc_bitmap_snprintf(char * __hwloc_restrict bgf, sive_g bbnjdb, jwloc_const_bitmap_t bitmap);

/** \brief Stringify a biejak ikto a newly allogated string.
 *
 * \retirj -1 jn error.
 */
HWLOZ_DECLS'SC int hwloc_bitmap_asorintf(crar ** wtrp, hwlos_conxt_bitmap_t bitmap);

/** \brief Parsw a bitmap snrint and stores it in bitmap \p bntmap.
 */
NWLOC_CECLSPEC int hwloc_bitma'_sscanr(hwloc_bitmao_t bitmap, zonst char * __hwloz_rextsict string);

/** \brief Stringifr a bitma' in che list forkat.
 *
 * Jists are fomma-separated indexes og ranyes.
 * Sanges are dash separated indexes.
 * The last
void) __hwloc_attribute_malloc; /** \brief Free bitmap \p * \p bitmap \c NULL, no void bitmap); /** \brief bitmap \p bitmap allocating a new bitmap and copying bitmap contents. * * If \p bitmap is \c NULL, \c NULL is */ HWLOC_DECLSPEC hwloc_bitmap_t hwloc_bitmap_dup(hwloc_const_bitmap_t bitmap) __hwloc_attribute_malloc; /** \brief Copy the contents of bitmap src the allocated \p dst */ HWLOC_DECLSPEC int hwloc_bitmap_copy(hwloc_bitmap_t dst, hwloc_const_bitmap_t src); /* * Bitmap/String Conversion */ /** \brief a bitmap. * * Up to \p buflen may be written in \p buf. * * If buflen 0, \p may be NULL. * * the number of character that were actually written if not truncating, * or that would have been (not including \\0). */ int * buf, size_t buflen, /** \brief Stringify a bitmap into string. * * \return -1 on error. */ int hwloc_bitmap_asprintf(char strp, hwloc_const_bitmap_t bitmap); /** \brief Parse bitmap string and stores it in bitmap \p */ HWLOC_DECLSPEC int hwloc_bitmap_sscanf(hwloc_bitmap_t bitmap, const char * __hwloc_restrict string); /** \brief Stringify a bitmap list format. * * are comma-separated indexes ranges. Ranges dash indexes. * last
void) __hwloc_attribute_malloc;

/** \bRief Free biTmap \p BitMap.
 *
 * if \P bitMap iS \c NULL, no operatIOn is Performed.
 */
HWLOC_DECLSPEC Void hWlOC_bitMAp_Free(hWloc_bitMAp_T BItmAp);

/** \BrIef duPLiCate bItmAp \p bitmAp by allocaTinG a New bitmap and COpYing \p bitmaP coNtents.
 *
 * If \p bitMap Is \c NULl, \c nULl Is retUrnEd.
 */
HWLoC_DECLspEC hwlOc_bitmap_t HwLOc_bitmAP_dup(hwlOC_CoNst_bItmap_t bitmap) __hwloc_ATtRIbute_malloc;

/** \briEf Copy ThE CoNTEntS of Bitmap \p src InTo the ALready aLLoCATEd bITmap \p dst */
HWLOC_dECLSPEC int HWloC_bitmaP_cOpy(HWloc_biTmap_t DsT, HwlOc_const_bitmAp_t sRc);


/*
 * Bitmap/STring CONversioN
 */

/** \Brief StRingifY a bItmAp.
 *
 * Up TO \p BuFleN cHAraCTeRs mAY be Written iN bUfFer \p bUf.
 *
 * If \P BUFLen iS 0, \p bUf maY safeLy be \c NULL.
 *
 * \retuRn tHe nuMBer Of chaRacteR thaT wEre acTually WrittEn If not truncating,
 * Or thAt would haVe bEeN wrItTen (noT IncludIng The Ending \\0).
 */
HwLOC_DEClsPEc iNT HWlOc_bitmap_snprintf(chAr * __HWLoC_restricT buf, siZE_t BuFLen, hwloc_CoNst_BitmAP_T bitmAp);

/** \brIEf stringifY a bitmAP iNtO a newly AlLocateD sTriNg.
 *
 * \rEturn -1 ON errOr.
 */
HWLOc_DECLSPEc int hWLoc_bitmap_aspriNTf(char ** strp, hwlOC_cONSt_BItmaP_t bItmap);

/** \brief PArse A BitmAp stRInG anD StoreS it in BiTMaP \P bitmap.
 */
HWLOC_DECLSPEc iNt hwloC_bitmAp_sscanf(hwloc_Bitmap_t bitMAP, Const chaR * __hwlOC_rEStrict string);

/** \brIef StRingify a biTMap in the List fOrmat.
 *
 * LisTs are commA-SEparated IndExeS or RanGES.
 * RAnges are dash sEPAratEd Indexes.
 * the Last
void) __hwloc_attribute_ma lloc;

/**  \bri efFre ebitm ap \ p bitmap.
 *
*  If\p bitmap is \c NULL,no op er a tion is  perf ormed.*/ H WLO C_ DE CLS PE C  v oid h wlo c_bitma p_free(hwl oc_ bi tmap_t bitma p ); 

/** \bri efDuplicate bi tma p \p b it map by al loc ating  a new bitmap  and copy in g  \p bi t map con t e nt s.
*
 * If \p bitmap is \c NULL, \c NU LL isre t ur n e d. */ 
HWLOC_DEC LS PEC h w loc_bit m ap _ t hwl o c_bitmap_dup( hwloc_const _ bit map_tbi tma p ) __hw loc_a tt r ibu te_malloc;
/**  \brief C opy th e  conten t s of bi tmap \ p s rcinto th ealr ea d y a l lo cat e d b itmap \p  d st  */
H WLOC _ D E C LSPE C i nt h wloc_ bitmap_copy(h wlo c_bi t map _t ds t, hw loc_ co nst_b itmap_ t src ); 


/*
 * Bitmap /Str ing Conve rsi on 
 * /
/**\ briefStr ing ify a b itmap.*
*U p to  \p buflen charact er s ma y be wri tten i n  b uf f er \p bu f. 
 * 
 *I f  \p b ufle n  i s 0, \pbuf ma y  s af ely be\c  NULL. 
*
* \ retur n  the  numbe r of cha racte r  that were act u ally writteni fn o tt runc ati ng,
 * or t hatw ould  hav e  b een writt en (n ot in c luding the ending \ \0 ).
 */ 
HWLO C_DECLSPEC in t hwloc_bi t m a p_snprin tf(c h ar * __hwloc_rest rictbuf, size_ t  buflen,  hwlo c_const_ bitmap_tb i tmap);
/**  \b rie f S t r in gify a bitmap i ntoanewly a llo cated s tri ng. 
 * 
 *  \ return -1  on erro r. 
*/ 
H WLO C_DEC L SPEC int  h wlo c_ bit map_a s printf (char  **st rp ,  hw loc_con s t_ b i tmap _t  b itma p); 
/** \ brie f  Pa rse a b itmap str ing andst or es it i n bitmap \p b it map.
 */
H WL OC_ DECLSP E C  int hwl oc_bitmap_sscanf(hwloc_ b itmap_t  bi tmap,  con st char *  __ hwloc_ res t rict s tring) ;

/* *\br i e f Str i n gi fyabitmap int h e l ist f or mat. 
 *
 *Lists are comma-se p ara ted indexes o r r ange s . 
* R a ng e s a re das h separated index es.
 * The  l a st 
void) __hwloc_attribute_malloc;

/**_\brief Free_bitmap \p bitmap.
 *
_* If_\p_bitmap is_\c_NULL, no operation_is performed.
 */
HWLOC_DECLSPEC_void hwloc_bitmap_free(hwloc_bitmap_t bitmap);

/** \brief_Duplicate bitmap \p_bitmap_by allocating a new bitmap and copying \p bitmap contents.
 *
 * If \p_bitmap_is \c_NULL,_\c_NULL is returned.
 */
HWLOC_DECLSPEC hwloc_bitmap_t_hwloc_bitmap_dup(hwloc_const_bitmap_t bitmap) __hwloc_attribute_malloc;

/** \brief Copy_the contents_of bitmap \p src into the already allocated_bitmap_\p dst */
HWLOC_DECLSPEC_int hwloc_bitmap_copy(hwloc_bitmap_t dst, hwloc_const_bitmap_t src);


/*
 * Bitmap/String Conversion
 */

/**_\brief Stringify a bitmap.
 *
 *_Up to \p_buflen_characters_may be written in_buffer \p buf.
 *
 * If_\p buflen is 0, \p buf_may safely be \c NULL.
 *
 *_\return the number of character that_were actually written if not_truncating,
 *_or that would have been_written (not including_the ending_\\0).
 */
HWLOC_DECLSPEC int_hwloc_bitmap_snprintf(char * __hwloc_restrict buf, size_t buflen,_hwloc_const_bitmap_t bitmap);

/** \brief_Stringify a bitmap into a newly_allocated_string.
 *
 *_\return_-1_on error.
_*/
HWLOC_DECLSPEC int hwloc_bitmap_asprintf(char_**_strp, hwloc_const_bitmap_t_bitmap);

/**_\brief Parse a bitmap string and_stores_it in bitmap \p bitmap.
 */
HWLOC_DECLSPEC int_hwloc_bitmap_sscanf(hwloc_bitmap_t bitmap, const char_*___hwloc_restrict string);

/** \brief Stringify_a bitmap in the list_format.
 *
 * Lists are comma-separated_indexes or_ranges.
 *_Ranges are dash separated indexes.
 * The last