File: misc.h

package info (click to toggle)
fbi 2.07-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 1,172 kB
  • ctags: 2,303
  • sloc: ansic: 17,896; sh: 60; makefile: 35; perl: 12
file content (9 lines) | stat: -rw-r--r-- 256 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
/*
 * misc useful #defines ...
 */

#define container_of(ptr, type, member) ({			\
        const typeof( ((type *)0)->member ) *__mptr = (ptr);	\
        (type *)( (char *)__mptr - offsetof(type,member) );})

#define array_size(x) (sizeof(x)/sizeof(x[0]))