PipeWire: pipewire/permission.h Source File

PipeWire 1.4.0 |

Loading...
Searching...
No Matches
permission.h
Go to the documentation of this file.
1/* PipeWire */
2/* SPDX-FileCopyrightText: Copyright © 2018 Wim Taymans */
3/* SPDX-License-Identifier: MIT */
4
5#ifndef PIPEWIRE_PERMISSION_H
6#define PIPEWIRE_PERMISSION_H
7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
12#include <spa/utils/defs.h>
13
21
26
27#define PW_PERM_R 0400
28#define PW_PERM_W 0200
29#define PW_PERM_X 0100
31#define PW_PERM_M 0010
32#define PW_PERM_L 0020
34
35#define PW_PERM_RW (PW_PERM_R|PW_PERM_W)
36#define PW_PERM_RWX (PW_PERM_RW|PW_PERM_X)
37#define PW_PERM_RWXM (PW_PERM_RWX|PW_PERM_M)
38#define PW_PERM_RWXML (PW_PERM_RWXM|PW_PERM_L)
39
40#define PW_PERM_IS_R(p) (((p)&PW_PERM_R) == PW_PERM_R)
41#define PW_PERM_IS_W(p) (((p)&PW_PERM_W) == PW_PERM_W)
42#define PW_PERM_IS_X(p) (((p)&PW_PERM_X) == PW_PERM_X)
43#define PW_PERM_IS_M(p) (((p)&PW_PERM_M) == PW_PERM_M)
44#define PW_PERM_IS_L(p) (((p)&PW_PERM_L) == PW_PERM_L)
45
46#define PW_PERM_ALL PW_PERM_RWXM
47#define PW_PERM_INVALID (uint32_t)(0xffffffff)
48
49 struct pw_permission {
50 uint32_t id;
51 uint32_t permissions;
52};
53
54#define PW_PERMISSION_INIT(id,p) ((struct pw_permission){ (id), (p) })
55
56#define PW_PERMISSION_FORMAT "%c%c%c%c%c"
57#define PW_PERMISSION_ARGS(permission) \
58 (permission) & PW_PERM_R ? 'r' : '-', \
59 (permission) & PW_PERM_W ? 'w' : '-', \
60 (permission) & PW_PERM_X ? 'x' : '-', \
61 (permission) & PW_PERM_M ? 'm' : '-', \
62 (permission) & PW_PERM_L ? 'l' : '-'
63
67
68#ifdef __cplusplus
69}
70#endif
71
72#endif /* PIPEWIRE_PERMISSION_H */
defs.h
spa/utils/defs.h
id
uint32_t id
Definition core.h:432
pw_permission
Definition permission.h:69
pw_permission::permissions
uint32_t permissions
bitmask of above permissions
Definition permission.h:71