154183Sbostic /*- 2*63186Sbostic * Copyright (c) 1992, 1993 3*63186Sbostic * The Regents of the University of California. All rights reserved. 454183Sbostic * 554183Sbostic * %sccs.include.redist.c% 654183Sbostic * 7*63186Sbostic * @(#)libkern.h 8.1 (Berkeley) 06/10/93 854183Sbostic */ 954183Sbostic 1054184Sbostic #include <sys/types.h> 1154184Sbostic 1255076Sbostic static inline int 1355076Sbostic imax(a, b) 1455076Sbostic int a, b; 1555076Sbostic { 1655076Sbostic return (a > b ? a : b); 1755076Sbostic } 1855076Sbostic static inline int 1955076Sbostic imin(a, b) 2055076Sbostic int a, b; 2155076Sbostic { 2255076Sbostic return (a < b ? a : b); 2355076Sbostic } 2455076Sbostic static inline long 2555076Sbostic lmax(a, b) 2655076Sbostic long a, b; 2755076Sbostic { 2855076Sbostic return (a > b ? a : b); 2955076Sbostic } 3055076Sbostic static inline long 3155076Sbostic lmin(a, b) 3255076Sbostic long a, b; 3355076Sbostic { 3455076Sbostic return (a < b ? a : b); 3555076Sbostic } 3655076Sbostic static inline u_int 3755076Sbostic max(a, b) 3855076Sbostic u_int a, b; 3955076Sbostic { 4055076Sbostic return (a > b ? a : b); 4155076Sbostic } 4255076Sbostic static inline u_int 4355076Sbostic min(a, b) 4455076Sbostic u_int a, b; 4555076Sbostic { 4655076Sbostic return (a < b ? a : b); 4755076Sbostic } 4855076Sbostic static inline u_long 4955076Sbostic ulmax(a, b) 5055076Sbostic u_long a, b; 5155076Sbostic { 5255076Sbostic return (a > b ? a : b); 5355076Sbostic } 5455076Sbostic static inline u_long 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