xref: /csrg-svn/sys/libkern/libkern.h (revision 67596)
154183Sbostic /*-
263186Sbostic  * Copyright (c) 1992, 1993
363186Sbostic  *	The Regents of the University of California.  All rights reserved.
454183Sbostic  *
554183Sbostic  * %sccs.include.redist.c%
654183Sbostic  *
7*67596Smckusick  *	@(#)libkern.h	8.2 (Berkeley) 08/05/94
854183Sbostic  */
954183Sbostic 
1054184Sbostic #include <sys/types.h>
1154184Sbostic 
12*67596Smckusick static __inline int
imax(a,b)1355076Sbostic imax(a, b)
1455076Sbostic 	int a, b;
1555076Sbostic {
1655076Sbostic 	return (a > b ? a : b);
1755076Sbostic }
18*67596Smckusick static __inline int
imin(a,b)1955076Sbostic imin(a, b)
2055076Sbostic 	int a, b;
2155076Sbostic {
2255076Sbostic 	return (a < b ? a : b);
2355076Sbostic }
24*67596Smckusick static __inline long
lmax(a,b)2555076Sbostic lmax(a, b)
2655076Sbostic 	long a, b;
2755076Sbostic {
2855076Sbostic 	return (a > b ? a : b);
2955076Sbostic }
30*67596Smckusick static __inline long
lmin(a,b)3155076Sbostic lmin(a, b)
3255076Sbostic 	long a, b;
3355076Sbostic {
3455076Sbostic 	return (a < b ? a : b);
3555076Sbostic }
36*67596Smckusick static __inline u_int
max(a,b)3755076Sbostic max(a, b)
3855076Sbostic 	u_int a, b;
3955076Sbostic {
4055076Sbostic 	return (a > b ? a : b);
4155076Sbostic }
42*67596Smckusick static __inline u_int
min(a,b)4355076Sbostic min(a, b)
4455076Sbostic 	u_int a, b;
4555076Sbostic {
4655076Sbostic 	return (a < b ? a : b);
4755076Sbostic }
48*67596Smckusick static __inline u_long
ulmax(a,b)4955076Sbostic ulmax(a, b)
5055076Sbostic 	u_long a, b;
5155076Sbostic {
5255076Sbostic 	return (a > b ? a : b);
5355076Sbostic }
54*67596Smckusick static __inline u_long
ulmin(a,b)5555076Sbostic ulmin(a, b)
5655076Sbostic 	u_long a, b;
5755076Sbostic {
5855076Sbostic 	return (a < b ? a : b);
5955076Sbostic }
6055076Sbostic 
6154183Sbostic /* Prototypes for non-quad routines. */
6254183Sbostic int	 bcmp __P((const void *, const void *, size_t));
6354183Sbostic int	 ffs __P((int));
6454184Sbostic int	 locc __P((int, char *, u_int));
6554354Storek u_long	 random __P((void));
6656870Sbostic char	*rindex __P((const char *, int));
6754184Sbostic int	 scanc __P((u_int, u_char *, u_char *, int));
6854184Sbostic int	 skpc __P((int, int, char *));
6954183Sbostic char	*strcat __P((char *, const char *));
7054183Sbostic char	*strcpy __P((char *, const char *));
7154183Sbostic size_t	 strlen __P((const char *));
7254183Sbostic char	*strncpy __P((char *, const char *, size_t));
73