Where Online Learning is simpler!
The C and C++ Include Header Files
/usr/include/xorg/wacom-util.h
$ cat -n /usr/include/xorg/wacom-util.h 1 /* 2 * Copyright 2011 by Jason Gerecke, Wacom. <jason.gerecke@wacom.com> 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU General Public License 6 * as published by the Free Software Foundation; either version 2 7 * of the License, or (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 */ 18 19 #ifndef WACOM_UTIL_H_ 20 #define WACOM_UTIL_H_ 21 22 /** 23 * Get the number of elements in an array 24 */ 25 #ifndef ARRAY_SIZE 26 #define ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0])) 27 #endif 28 29 /* to access kernel defined bits */ 30 #define BIT(x) (1UL<<((x) & (BITS_PER_LONG - 1))) 31 #define BITS_PER_LONG (sizeof(long) * 8) 32 #define NBITS(x) ((((x)-1)/BITS_PER_LONG)+1) 33 #define ISBITSET(x,y) ((x)[LONG(y)] & BIT(y)) 34 #define SETBIT(x,y) ((x)[LONG(y)] |= BIT(y)) 35 #define CLEARBIT(x,y) ((x)[LONG(y)] &= ~BIT(y)) 36 #define OFF(x) ((x)%BITS_PER_LONG) 37 #define LONG(x) ((x)/BITS_PER_LONG) 38 39 /** 40 * Test if the mask is set in the given bitfield. 41 * @return TRUE if set or FALSE otherwise. 42 */ 43 #define MaskIsSet(bitfield, mask) !!(((bitfield) & (mask)) == (mask)) 44 /** 45 * Set the given mask for the given bitfield. 46 */ 47 #define MaskSet(bitfield, mask) ((bitfield) |= (mask)) 48 /** 49 * Clear the given mask from the given bitfield 50 */ 51 #define MaskClear(bitfield, mask) ((bitfield) &= ~(mask)) 52 53 #endif /* WACOM_UTIL_H_ */
Welcome to MyWebUniversity on May 21, 2025.
Contact us
|
About us
|
Term of use
|
Copyright © 2000-2025 MyWebUniversity.com ™