]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/journal/audit-type.h
tree-wide: drop license boilerplate
[thirdparty/systemd.git] / src / journal / audit-type.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 #pragma once
3
4 /***
5 This file is part of systemd.
6
7 Copyright 2015 Zbigniew Jędrzejewski-Szmek
8 ***/
9
10 #include "macro.h"
11
12 const char *audit_type_to_string(int type);
13 int audit_type_from_string(const char *s);
14
15 /* This is inspired by DNS TYPEnnn formatting */
16 #define audit_type_name_alloca(type) \
17 ({ \
18 const char *_s_; \
19 _s_ = audit_type_to_string(type); \
20 if (!_s_) { \
21 _s_ = alloca(STRLEN("AUDIT") + DECIMAL_STR_MAX(int)); \
22 sprintf((char*) _s_, "AUDIT%04i", type); \
23 } \
24 _s_; \
25 })