PipeWire 1.2.5
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
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
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)
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)
46#define PW_PERM_ALL PW_PERM_RWXM
47#define PW_PERM_INVALID (uint32_t)(0xffffffff)
48
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
68#ifdef __cplusplus
70#endif
72#endif /* PIPEWIRE_PERMISSION_H */
spa/utils/defs.h
Definition permission.h:69
uint32_t id
id of object, PW_ID_ANY for default permission
Definition permission.h:70
uint32_t permissions
bitmask of above permissions
Definition permission.h:71