1 #ifndef OPENAFS_OPR_OPR_H
2 #define OPENAFS_OPR_OPR_H 1
6 /* should use offsetof() if available */
7 #define opr_containerof(ptr, structure, member) \
8 ((structure *)((char *)(ptr)-(char *)(&((structure *)NULL)->member)))
13 # define opr_abort() opr_NTAbort()
14 extern void opr_NTAbort(void);
16 # define opr_abort() abort()
19 extern void opr_AssertionFailed(char *, int) AFS_NORETURN;
20 extern void opr_AssertFailU(const char *, const char *, int) AFS_NORETURN;
22 #define opr_Assert(ex) \
23 do {if (!(ex)) opr_AssertionFailed(__FILE__, __LINE__);} while(0)
26 #define lcstring opr_lcstring
27 #define ucstring opr_ucstring
28 #define stolower opr_stolower
29 #define stoupper opr_stoupper
30 /* XXX str* is in the implementation namespace when <string.h> is included */
31 #define strcompose opr_strcompose
33 extern char *opr_lcstring(char *d, const char *s, int n) AFS_NONNULL((1,2));
34 extern char *opr_ucstring(char *d, const char *s, int n) AFS_NONNULL((1,2));
35 extern void opr_stolower(char *s) AFS_NONNULL(());
36 extern void opr_stoupper(char *s) AFS_NONNULL(());
37 extern char *opr_strcompose(char *buf, size_t len, ...) AFS_NONNULL((1));