File: typesize.h

package info (click to toggle)
fdclone 3.01b-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 4,772 kB
  • ctags: 8,674
  • sloc: ansic: 100,552; makefile: 4,497; sh: 1,480; sed: 224
file content (62 lines) | stat: -rw-r--r-- 1,278 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
 *	typesize.h
 *
 *	definitions for size of types
 */

#ifndef	__TYPESIZE_H_
#define	__TYPESIZE_H_

#define	strsize(s)		((int)sizeof(s) - 1)
#define	arraysize(a)		((int)((u_int)sizeof(a) / (u_int)sizeof(*(a))))

#define	MAXLONGWIDTH		20	/* log10(2^64) = 19.266 */
#define	MAXCOLSCOMMA(d)		(MAXLONGWIDTH + (MAXLONGWIDTH / (d)))
#ifndef	BITSPERBYTE
# ifdef	CHAR_BIT
# define	BITSPERBYTE	CHAR_BIT
# else	/* !CHAR_BIT */
#  ifdef	NBBY
#  define	BITSPERBYTE	NBBY
#  else
#  define	BITSPERBYTE	8
#  endif
# endif	/* !CHAR_BIT */
#endif	/* !BITSPERBYTE */

#ifdef	HAVELONGLONG
typedef long long		long_t;
typedef unsigned long long	u_long_t;
#else
typedef long			long_t;
typedef unsigned long		u_long_t;
#endif

#define	_MAXUTYPE(t)		((t)(~(t)0))
#define	MINTYPE(t)		((t)(_MAXUTYPE(t) << \
				(BITSPERBYTE * sizeof(t) - 1)))
#define	MAXTYPE(t)		((t)~MINTYPE(t))
#ifdef	LSI_C
#define	MAXUTYPE(t)		((u_long_t)~0 >> \
				(BITSPERBYTE * (sizeof(u_long_t) - sizeof(t))))
#else
#define	MAXUTYPE(t)		_MAXUTYPE(t)
#endif

#ifdef	USELLSEEK
typedef long_t			l_off_t;
#else
typedef off_t			l_off_t;
#endif

#ifdef	USEPID_T
typedef pid_t			p_id_t;
#else	/* !USEPID_T */
# if	MSDOS
typedef int			p_id_t;
# else
typedef long			p_id_t;
# endif
#endif	/* !USEPID_T */

#endif	/* !__TYPESIZE_H_ */