diff options
author | Thomas Graf <tgr@lsx.localdomain> | 2008-04-29 21:08:12 (GMT) |
---|---|---|
committer | Thomas Graf <tgr@lsx.localdomain> | 2008-04-29 21:08:12 (GMT) |
commit | 662887c052f0fcd98287e2a7fa5843a4f66ca256 (patch) | |
tree | e024f1989efdbc7ed5f9705d3f49c8aea1a01308 /include/netlink | |
parent | 1240cd6635dfc14d4337d844796ed913f2cd44e4 (diff) | |
download | libnl-662887c052f0fcd98287e2a7fa5843a4f66ca256.zip libnl-662887c052f0fcd98287e2a7fa5843a4f66ca256.tar.gz libnl-662887c052f0fcd98287e2a7fa5843a4f66ca256.tar.bz2 |
Export nl_dump_line() and automatically count lines while dumping
Diffstat (limited to 'include/netlink')
-rw-r--r-- | include/netlink/types.h | 17 | ||||
-rw-r--r-- | include/netlink/utils.h | 4 |
2 files changed, 16 insertions, 5 deletions
diff --git a/include/netlink/types.h b/include/netlink/types.h index 903028e..04209b6 100644 --- a/include/netlink/types.h +++ b/include/netlink/types.h @@ -19,16 +19,19 @@ * @ingroup utils */ enum nl_dump_type { - NL_DUMP_BRIEF, /**< Dump object in a brief one-liner */ - NL_DUMP_FULL, /**< Dump all attributes but no statistics */ + NL_DUMP_ONELINE, /**< Dump object briefly on one line */ + NL_DUMP_DETAILS, /**< Dump all attributes but no statistics */ NL_DUMP_STATS, /**< Dump all attributes including statistics */ NL_DUMP_XML, /**< Dump all attribtes in XML format */ NL_DUMP_ENV, /**< Dump all attribtues as env variables */ - NL_DUMP_EVENTS, /**< Dump event */ __NL_DUMP_MAX, }; #define NL_DUMP_MAX (__NL_DUMP_MAX - 1) +/* backards compat */ +#define NL_DUMP_BRIEF NL_DUMP_ONELINE +#define NL_DUMP_FULL NL_DUMP_DETAILS + /** * Dumping parameters * @ingroup utils @@ -100,6 +103,14 @@ struct nl_dump_params * Set if a dump was performed prior to the actual dump handler. */ int dp_pre_dump; + + /** + * PRIVATE + * Owned by the current caller + */ + int dp_ivar; + + unsigned int dp_line; }; #endif diff --git a/include/netlink/utils.h b/include/netlink/utils.h index 0351d38..207e8ec 100644 --- a/include/netlink/utils.h +++ b/include/netlink/utils.h @@ -70,9 +70,9 @@ extern char * nl_ip_proto2str(int, char *, size_t); extern int nl_str2ip_proto(const char *); /* Dumping helpers */ -extern void nl_new_line(struct nl_dump_params *, int); +extern void nl_new_line(struct nl_dump_params *); extern void nl_dump(struct nl_dump_params *, const char *, ...); -extern void nl_dump_line(struct nl_dump_params *, int, const char *, ...); +extern void nl_dump_line(struct nl_dump_params *, const char *, ...); #ifdef __cplusplus } |