logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

bitmask, bitmask_alloc, bitmask_free, bitmask_displayhex, bitmask_displaylist, bitmask_parsehex,

Author

pj@sgi.com (Paul Jackson)

Silicon Graphics, Inc                              2006-05-25                                      LIBBITMASK(3)

Description

       See further /usr/share/doc/packages/libbitmask/libbitmask.html.  This document is also available in plain
       text format as /usr/share/doc/packages/libbitmask/libbitmask.txt.

Name

       bitmask,   bitmask_alloc,   bitmask_free,   bitmask_displayhex,   bitmask_displaylist,  bitmask_parsehex,
       bitmask_parselist,  bitmask_copy,   bitmask_setall,   bitmask_clearall,   bitmask_nbytes,   bitmask_mask,
       bitmask_nbits,      bitmask_weight,      bitmask_isbitset,      bitmask_isbitclear,     bitmask_isallset,
       bitmask_isallclear, bitmask_setbit, bitmask_clearbit,  bitmask_equal,  bitmask_subset,  bitmask_disjoint,
       bitmask_intersects,    bitmask_setrange,   bitmask_clearrange,   bitmask_keeprange,   bitmask_complement,
       bitmask_shiftright,   bitmask_shiftleft,   bitmask_and,    bitmask_andnot,    bitmask_or,    bitmask_eor,
       bitmask_first, bitmask_next, bitmask_rel_to_abs_pos, bitmask_abs_to_rel_pos, bitmask_last
        - Dynamically sized multi-word bit masks.

See Also

cpuset(1), libcpuset(3), bootcpuset.conf(5), bootcpuset(8).

Synopsis

#include<bitmask.h>cc...-lbitmaskAllocateandfree`structbitmask*`:
       struct bitmask *bitmask_alloc(unsigned int nbits);
       void bitmask_free(struct bitmask *bmp);

   Displayandparseasciistringrepresentations:
       int bitmask_displayhex(char *buf, int len, const struct bitmask *bmp);
       int bitmask_displaylist(char *buf, int len, const struct bitmask *bmp);
       int bitmask_parsehex(const char *buf, struct bitmask *bmp);
       int bitmask_parselist(const char *buf, struct bitmask *bmp);

   Basicinitializationoperations:
       struct bitmask *bitmask_copy(struct bitmask *bmp1, const bitmask *bmp2);
       struct bitmask *bitmask_setall(struct bitmask *bmp);
       struct bitmask *bitmask_clearall(struct bitmask *bmp);

   Interfacetokernelsched_{set,get}affinitysystemcalls:
       unsigned int bitmask_nbytes(struct bitmask *bmp);
       unsigned long *bitmask_mask(struct bitmask *bmp);

   Unarynumericqueries:
       unsigned int bitmask_nbits(const struct bitmask *bmp);
       unsigned int bitmask_weight(const struct bitmask *bmp);

   UnaryBooleanqueries:
       int bitmask_isbitset(const struct bitmask *bmp, unsigned int i);
       int bitmask_isbitclear(const struct bitmask *bmp, unsigned int i);
       int bitmask_isallset(const struct bitmask *bmp);
       int bitmask_isallclear(const struct bitmask *bmp);

   Singlebitoperations:
       struct bitmask *bitmask_setbit(struct bitmask *bmp, unsigned int i);
       struct bitmask *bitmask_clearbit(struct bitmask *bmp, unsigned int i);

   BinaryBooleanoperations:bmp1op?bmp2:
       int bitmask_equal(const struct bitmask *bmp1, const bitmask *bmp2);
       int bitmask_subset(const struct bitmask *bmp1, const bitmask *bmp2);
       int bitmask_disjoint(const struct bitmask *bmp1, const bitmask *bmp2);
       int bitmask_intersects(const struct bitmask *bmp1, const bitmask *bmp2);

   Rangeoperations:
       struct bitmask *bitmask_setrange(struct bitmask *bmp, unsigned int i, unsigned int j);
       struct bitmask *bitmask_clearrange(struct bitmask *bmp, unsigned int i, unsigned int j);
       struct bitmask *bitmask_keeprange(struct bitmask *bmp, unsigned int i, unsigned int j);

   Unaryoperations:
       struct bitmask *bitmask_complement(struct bitmask *bmp1, const bitmask *bmp2);
       struct bitmask *bitmask_shiftright(struct bitmask *bmp1, const bitmask *bmp2, unsigned int n);
       struct bitmask *bitmask_shiftleft(struct bitmask *bmp1, const bitmask *bmp2, unsigned int n);

   Binaryoperations:
       struct bitmask *bitmask_and(struct bitmask *bmp1, const bitmask *bmp2, const bitmask *bmp3);
       struct bitmask *bitmask_andnot(struct bitmask *bmp1, const bitmask *bmp2, const bitmask *bmp3);
       struct bitmask *bitmask_or(struct bitmask *bmp1, const bitmask *bmp2, const bitmask *bmp3);
       struct bitmask *bitmask_eor(struct bitmask *bmp1, const bitmask *bmp2, const bitmask *bmp3);

   Iterationoperators:
       int bitmask_first(const struct bitmask *bmp);
       unsigned int bitmask_next(const struct bitmask *bmp, unsigned int i);
       unsigned int bitmask_rel_to_abs_pos(const struct bitmask *bmp, unsigned int n);
       unsigned int bitmask_abs_to_rel_pos(const struct bitmask *bmp, unsigned int n);
       unsigned int bitmask_last(const struct bitmask *bmp);

See Also