libalpm
Arch Linux Package Manager Library
sandbox.h
Go to the documentation of this file.
1/*
2 * sandbox.h
3 *
4 * Copyright (c) 2021-2022 Pacman Development Team <pacman-dev@lists.archlinux.org>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef ALPM_SANDBOX_H
21#define ALPM_SANDBOX_H
22
23#include <stdbool.h>
24
25
26/* The type of callbacks that can happen during a sandboxed operation */
27typedef enum {
30} _alpm_sandbox_callback_t;
31
32typedef struct {
33 int callback_pipe;
34} _alpm_sandbox_callback_context;
35
36
37/* Sandbox callbacks */
38
39__attribute__((format(printf, 3, 0)))
40void _alpm_sandbox_cb_log(void *ctx, alpm_loglevel_t level, const char *fmt, va_list args);
41
42void _alpm_sandbox_cb_dl(void *ctx, const char *filename, alpm_download_event_type_t event, void *data);
43
44
45/* Functions to capture sandbox callbacks and convert them to alpm callbacks */
46
47bool _alpm_sandbox_process_cb_log(alpm_handle_t *handle, int callback_pipe);
48bool _alpm_sandbox_process_cb_download(alpm_handle_t *handle, int callback_pipe);
49
50
51#endif /* ALPM_SANDBOX_H */
alpm_download_event_type_t
File download events.
Definition alpm.h:1168
alpm_loglevel_t
Logging Levels.
Definition alpm.h:1494
alpm_loglevel_t const char va_list args
Definition sandbox.h:40
alpm_loglevel_t level
Definition sandbox.h:40
__attribute__((format(printf, 3, 0))) void _alpm_sandbox_cb_log(void *ctx
@ ALPM_SANDBOX_CB_DOWNLOAD
Definition sandbox.h:29
alpm_loglevel_t const char * fmt
Definition sandbox.h:40
@ ALPM_SANDBOX_CB_LOG
Definition sandbox.h:28