mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-15 10:17:20 +00:00
Always put the "access" macro argument in (), it might be an expression.
This is a purely stylistic change.
This commit is contained in:
parent
6adb748875
commit
d8be0570d0
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=105582
@ -191,85 +191,85 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry);
|
||||
/* This constructs a node from which other oids can hang. */
|
||||
#define SYSCTL_NODE(parent, nbr, name, access, handler, descr) \
|
||||
struct sysctl_oid_list sysctl_##parent##_##name##_children; \
|
||||
SYSCTL_OID(parent, nbr, name, CTLTYPE_NODE|access, \
|
||||
SYSCTL_OID(parent, nbr, name, CTLTYPE_NODE|(access), \
|
||||
(void*)&sysctl_##parent##_##name##_children, 0, handler, \
|
||||
"N", descr)
|
||||
|
||||
#define SYSCTL_ADD_NODE(ctx, parent, nbr, name, access, handler, descr) \
|
||||
sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_NODE|access, \
|
||||
sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_NODE|(access), \
|
||||
0, 0, handler, "N", descr)
|
||||
|
||||
/* Oid for a string. len can be 0 to indicate '\0' termination. */
|
||||
#define SYSCTL_STRING(parent, nbr, name, access, arg, len, descr) \
|
||||
SYSCTL_OID(parent, nbr, name, CTLTYPE_STRING|access, \
|
||||
SYSCTL_OID(parent, nbr, name, CTLTYPE_STRING|(access), \
|
||||
arg, len, sysctl_handle_string, "A", descr)
|
||||
|
||||
#define SYSCTL_ADD_STRING(ctx, parent, nbr, name, access, arg, len, descr) \
|
||||
sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_STRING|access, \
|
||||
sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_STRING|(access), \
|
||||
arg, len, sysctl_handle_string, "A", descr)
|
||||
|
||||
/* Oid for an int. If ptr is NULL, val is returned. */
|
||||
#define SYSCTL_INT(parent, nbr, name, access, ptr, val, descr) \
|
||||
SYSCTL_OID(parent, nbr, name, CTLTYPE_INT|access, \
|
||||
SYSCTL_OID(parent, nbr, name, CTLTYPE_INT|(access), \
|
||||
ptr, val, sysctl_handle_int, "I", descr)
|
||||
|
||||
#define SYSCTL_ADD_INT(ctx, parent, nbr, name, access, ptr, val, descr) \
|
||||
sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_INT|access, \
|
||||
sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_INT|(access), \
|
||||
ptr, val, sysctl_handle_int, "I", descr)
|
||||
|
||||
/* Oid for an unsigned int. If ptr is NULL, val is returned. */
|
||||
#define SYSCTL_UINT(parent, nbr, name, access, ptr, val, descr) \
|
||||
SYSCTL_OID(parent, nbr, name, CTLTYPE_UINT|access, \
|
||||
SYSCTL_OID(parent, nbr, name, CTLTYPE_UINT|(access), \
|
||||
ptr, val, sysctl_handle_int, "IU", descr)
|
||||
|
||||
#define SYSCTL_ADD_UINT(ctx, parent, nbr, name, access, ptr, val, descr) \
|
||||
sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_UINT|access, \
|
||||
sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_UINT|(access), \
|
||||
ptr, val, sysctl_handle_int, "IU", descr)
|
||||
|
||||
/* Oid for a long. The pointer must be non NULL. */
|
||||
#define SYSCTL_LONG(parent, nbr, name, access, ptr, val, descr) \
|
||||
SYSCTL_OID(parent, nbr, name, CTLTYPE_LONG|access, \
|
||||
SYSCTL_OID(parent, nbr, name, CTLTYPE_LONG|(access), \
|
||||
ptr, val, sysctl_handle_long, "L", descr)
|
||||
|
||||
#define SYSCTL_ADD_LONG(ctx, parent, nbr, name, access, ptr, descr) \
|
||||
sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_LONG|access, \
|
||||
sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_LONG|(access), \
|
||||
ptr, 0, sysctl_handle_long, "L", descr)
|
||||
|
||||
/* Oid for a long. The pointer must be non NULL. */
|
||||
#define SYSCTL_ULONG(parent, nbr, name, access, ptr, val, descr) \
|
||||
SYSCTL_OID(parent, nbr, name, CTLTYPE_ULONG|access, \
|
||||
SYSCTL_OID(parent, nbr, name, CTLTYPE_ULONG|(access), \
|
||||
ptr, val, sysctl_handle_long, "LU", descr)
|
||||
|
||||
#define SYSCTL_ADD_ULONG(ctx, parent, nbr, name, access, ptr, descr) \
|
||||
sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_ULONG|access, \
|
||||
sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_ULONG|(access), \
|
||||
ptr, 0, sysctl_handle_long, "LU", descr)
|
||||
|
||||
/* Oid for an opaque object. Specified by a pointer and a length. */
|
||||
#define SYSCTL_OPAQUE(parent, nbr, name, access, ptr, len, fmt, descr) \
|
||||
SYSCTL_OID(parent, nbr, name, CTLTYPE_OPAQUE|access, \
|
||||
SYSCTL_OID(parent, nbr, name, CTLTYPE_OPAQUE|(access), \
|
||||
ptr, len, sysctl_handle_opaque, fmt, descr)
|
||||
|
||||
#define SYSCTL_ADD_OPAQUE(ctx, parent, nbr, name, access, ptr, len, fmt, descr)\
|
||||
sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_OPAQUE|access, \
|
||||
sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_OPAQUE|(access), \
|
||||
ptr, len, sysctl_handle_opaque, fmt, descr)
|
||||
|
||||
/* Oid for a struct. Specified by a pointer and a type. */
|
||||
#define SYSCTL_STRUCT(parent, nbr, name, access, ptr, type, descr) \
|
||||
SYSCTL_OID(parent, nbr, name, CTLTYPE_OPAQUE|access, \
|
||||
SYSCTL_OID(parent, nbr, name, CTLTYPE_OPAQUE|(access), \
|
||||
ptr, sizeof(struct type), sysctl_handle_opaque, \
|
||||
"S," #type, descr)
|
||||
|
||||
#define SYSCTL_ADD_STRUCT(ctx, parent, nbr, name, access, ptr, type, descr) \
|
||||
sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_OPAQUE|access, \
|
||||
sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_OPAQUE|(access), \
|
||||
ptr, sizeof(struct type), sysctl_handle_opaque, "S," #type, descr)
|
||||
|
||||
/* Oid for a procedure. Specified by a pointer and an arg. */
|
||||
#define SYSCTL_PROC(parent, nbr, name, access, ptr, arg, handler, fmt, descr) \
|
||||
SYSCTL_OID(parent, nbr, name, access, \
|
||||
SYSCTL_OID(parent, nbr, name, (access), \
|
||||
ptr, arg, handler, fmt, descr)
|
||||
|
||||
#define SYSCTL_ADD_PROC(ctx, parent, nbr, name, access, ptr, arg, handler, fmt, descr) \
|
||||
sysctl_add_oid(ctx, parent, nbr, name, access, \
|
||||
sysctl_add_oid(ctx, parent, nbr, name, (access), \
|
||||
ptr, arg, handler, fmt, descr)
|
||||
|
||||
#endif /* _KERNEL */
|
||||
|
Loading…
Reference in New Issue
Block a user