/src/ostree/libglnx/glnx-console.h
Line | Count | Source |
1 | | /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- |
2 | | * |
3 | | * Copyright (C) 2013,2014,2015 Colin Walters <walters@verbum.org> |
4 | | * SPDX-License-Identifier: LGPL-2.0-or-later |
5 | | * |
6 | | * This program is free software: you can redistribute it and/or modify |
7 | | * it under the terms of the GNU Lesser General Public License as published |
8 | | * by the Free Software Foundation; either version 2 of the licence or (at |
9 | | * your option) any later version. |
10 | | * |
11 | | * This library 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 GNU |
14 | | * Lesser General Public License for more details. |
15 | | * |
16 | | * You should have received a copy of the GNU Lesser General |
17 | | * Public License along with this library; if not, write to the |
18 | | * Free Software Foundation, Inc., 59 Temple Place, Suite 330, |
19 | | * Boston, MA 02111-1307, USA. |
20 | | */ |
21 | | |
22 | | #pragma once |
23 | | |
24 | | #include <glnx-backport-autocleanups.h> |
25 | | |
26 | | G_BEGIN_DECLS |
27 | | |
28 | | struct GLnxConsoleRef { |
29 | | gboolean locked; |
30 | | gboolean is_tty; |
31 | | }; |
32 | | |
33 | | typedef struct GLnxConsoleRef GLnxConsoleRef; |
34 | | |
35 | | gboolean glnx_stdout_is_tty (void); |
36 | | |
37 | | void glnx_console_lock (GLnxConsoleRef *ref); |
38 | | |
39 | | void glnx_console_text (const char *text); |
40 | | |
41 | | void glnx_console_progress_text_percent (const char *text, |
42 | | guint percentage); |
43 | | |
44 | | void glnx_console_progress_n_items (const char *text, |
45 | | guint current, |
46 | | guint total); |
47 | | |
48 | | void glnx_console_unlock (GLnxConsoleRef *ref); |
49 | | |
50 | | guint glnx_console_lines (void); |
51 | | |
52 | | guint glnx_console_columns (void); |
53 | | |
54 | | static inline void |
55 | | glnx_console_ref_cleanup (GLnxConsoleRef *p) |
56 | 0 | { |
57 | 0 | if (p->locked) |
58 | 0 | glnx_console_unlock (p); |
59 | 0 | } Unexecuted instantiation: fuzz-bootconfig.c:glnx_console_ref_cleanup Unexecuted instantiation: ostree-bootconfig-parser.c:glnx_console_ref_cleanup Unexecuted instantiation: ot-gio-utils.c:glnx_console_ref_cleanup Unexecuted instantiation: ostree-core.c:glnx_console_ref_cleanup Unexecuted instantiation: ot-checksum-utils.c:glnx_console_ref_cleanup Unexecuted instantiation: ot-fs-utils.c:glnx_console_ref_cleanup Unexecuted instantiation: ot-unix-utils.c:glnx_console_ref_cleanup Unexecuted instantiation: ot-variant-utils.c:glnx_console_ref_cleanup Unexecuted instantiation: fuzz-repo.c:glnx_console_ref_cleanup Unexecuted instantiation: ostree-repo.c:glnx_console_ref_cleanup Unexecuted instantiation: ostree-repo-commit.c:glnx_console_ref_cleanup Unexecuted instantiation: ostree-repo-composefs.c:glnx_console_ref_cleanup Unexecuted instantiation: ostree-repo-pull.c:glnx_console_ref_cleanup Unexecuted instantiation: ostree-repo-refs.c:glnx_console_ref_cleanup Unexecuted instantiation: ostree-repo-verity.c:glnx_console_ref_cleanup Unexecuted instantiation: ostree-repo-file.c:glnx_console_ref_cleanup Unexecuted instantiation: ostree-sepolicy.c:glnx_console_ref_cleanup Unexecuted instantiation: ostree-sysroot.c:glnx_console_ref_cleanup Unexecuted instantiation: ostree-sysroot-cleanup.c:glnx_console_ref_cleanup Unexecuted instantiation: ostree-sysroot-deploy.c:glnx_console_ref_cleanup Unexecuted instantiation: ostree-deployment.c:glnx_console_ref_cleanup Unexecuted instantiation: ostree-bootloader.c:glnx_console_ref_cleanup Unexecuted instantiation: ostree-bootloader-aboot.c:glnx_console_ref_cleanup Unexecuted instantiation: ostree-bootloader-grub2.c:glnx_console_ref_cleanup Unexecuted instantiation: ostree-bootloader-zipl.c:glnx_console_ref_cleanup Unexecuted instantiation: ostree-bootloader-syslinux.c:glnx_console_ref_cleanup Unexecuted instantiation: ostree-bootloader-uboot.c:glnx_console_ref_cleanup Unexecuted instantiation: ostree-repo-static-delta-core.c:glnx_console_ref_cleanup Unexecuted instantiation: ostree-repo-static-delta-processing.c:glnx_console_ref_cleanup Unexecuted instantiation: ostree-kernel-args.c:glnx_console_ref_cleanup Unexecuted instantiation: ostree-gpg-verifier.c:glnx_console_ref_cleanup Unexecuted instantiation: ostree-gpg-verify-result.c:glnx_console_ref_cleanup Unexecuted instantiation: ostree-sign.c:glnx_console_ref_cleanup Unexecuted instantiation: ostree-sign-dummy.c:glnx_console_ref_cleanup Unexecuted instantiation: ot-checksum-instream.c:glnx_console_ref_cleanup Unexecuted instantiation: ot-gpg-utils.c:glnx_console_ref_cleanup Unexecuted instantiation: ot-keyfile-utils.c:glnx_console_ref_cleanup Unexecuted instantiation: ot-tool-util.c:glnx_console_ref_cleanup Unexecuted instantiation: otcore-prepare-root.c:glnx_console_ref_cleanup Unexecuted instantiation: glnx-console.c:glnx_console_ref_cleanup Unexecuted instantiation: ostree-async-progress.c:glnx_console_ref_cleanup Unexecuted instantiation: ostree-content-writer.c:glnx_console_ref_cleanup Unexecuted instantiation: ostree-linuxfsutil.c:glnx_console_ref_cleanup Unexecuted instantiation: ostree-diff.c:glnx_console_ref_cleanup Unexecuted instantiation: ostree-mutable-tree.c:glnx_console_ref_cleanup Unexecuted instantiation: ostree-ref.c:glnx_console_ref_cleanup Unexecuted instantiation: ostree-remote.c:glnx_console_ref_cleanup Unexecuted instantiation: ostree-repo-checkout.c:glnx_console_ref_cleanup Unexecuted instantiation: ostree-repo-prune.c:glnx_console_ref_cleanup Unexecuted instantiation: ostree-repo-traverse.c:glnx_console_ref_cleanup Unexecuted instantiation: fuzz-bsdiff.c:glnx_console_ref_cleanup |
60 | | G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GLnxConsoleRef, glnx_console_ref_cleanup) |
61 | | |
62 | | G_END_DECLS |