1/* 2 * Copyright (c) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16#ifndef APPSPAWN_CLIENT_MOUNT_PERMISSION_H 17#define APPSPAWN_CLIENT_MOUNT_PERMISSION_H 18#include <stdint.h> 19#include <stdio.h> 20#include <stdlib.h> 21 22#include "list.h" 23 24#ifdef __cplusplus 25extern "C" { 26#endif 27 28#ifdef APPSPAWN_CLIENT 29typedef struct TagSandboxQueue { 30 struct ListNode front; 31 uint32_t type; 32} SandboxQueue; 33 34typedef struct { 35 struct ListNode node; 36} SandboxMountNode; 37 38typedef struct TagPermissionNode { 39 SandboxMountNode sandboxNode; 40 uint32_t permissionIndex; 41 char name[0]; 42} SandboxPermissionNode; 43#endif 44 45#ifdef APPSPAWN_CLIENT 46#define PERMISSION_NAME(node) (node) == NULL ? NULL : (node)->name 47#else 48#define PERMISSION_NAME(node) (node) == NULL ? NULL : (node)->section.name 49#endif 50 51#ifdef __cplusplus 52} 53#endif 54#endif // APPSPAWN_CLIENT_MOUNT_PERMISSION_H 55