Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/libkern.h
Show First 20 Lines • Show All 220 Lines • ▼ Show 20 Lines | |||||
static __inline char * | static __inline char * | ||||
rindex(const char *p, int ch) | rindex(const char *p, int ch) | ||||
{ | { | ||||
return (strrchr(p, ch)); | return (strrchr(p, ch)); | ||||
} | } | ||||
static __inline int64_t | |||||
signed_extend64(uint64_t bitmap, int lsb, int width) | |||||
{ | |||||
return ((int64_t)(bitmap << (63 - lsb - (width - 1)))) >> | |||||
(63 - (width - 1)); | |||||
} | |||||
static __inline int32_t | |||||
signed_extend32(uint32_t bitmap, int lsb, int width) | |||||
{ | |||||
return ((int32_t)(bitmap << (31 - lsb - (width - 1)))) >> | |||||
(31 - (width - 1)); | |||||
} | |||||
/* fnmatch() return values. */ | /* fnmatch() return values. */ | ||||
#define FNM_NOMATCH 1 /* Match failed. */ | #define FNM_NOMATCH 1 /* Match failed. */ | ||||
/* fnmatch() flags. */ | /* fnmatch() flags. */ | ||||
#define FNM_NOESCAPE 0x01 /* Disable backslash escaping. */ | #define FNM_NOESCAPE 0x01 /* Disable backslash escaping. */ | ||||
#define FNM_PATHNAME 0x02 /* Slash must be matched by slash. */ | #define FNM_PATHNAME 0x02 /* Slash must be matched by slash. */ | ||||
#define FNM_PERIOD 0x04 /* Period must be matched by period. */ | #define FNM_PERIOD 0x04 /* Period must be matched by period. */ | ||||
#define FNM_LEADING_DIR 0x08 /* Ignore /<tail> after Imatch. */ | #define FNM_LEADING_DIR 0x08 /* Ignore /<tail> after Imatch. */ | ||||
#define FNM_CASEFOLD 0x10 /* Case insensitive search. */ | #define FNM_CASEFOLD 0x10 /* Case insensitive search. */ | ||||
#define FNM_IGNORECASE FNM_CASEFOLD | #define FNM_IGNORECASE FNM_CASEFOLD | ||||
#define FNM_FILE_NAME FNM_PATHNAME | #define FNM_FILE_NAME FNM_PATHNAME | ||||
#endif /* !_SYS_LIBKERN_H_ */ | #endif /* !_SYS_LIBKERN_H_ */ |