/usr/include/Limba/li-package.h is in liblimba-dev 0.5.6-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
*
* Copyright (C) 2014-2016 Matthias Klumpp <matthias@tenstral.net>
*
* Licensed under the GNU Lesser General Public License Version 2.1
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 2.1 of the license, or
* (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#if !defined (__LIMBA_H) && !defined (LI_COMPILATION)
#error "Only <limba.h> can be included directly."
#endif
#ifndef __LI_PACKAGE_H
#define __LI_PACKAGE_H
#include <glib-object.h>
#include "li-pkg-info.h"
#include "li-pkg-cache.h"
G_BEGIN_DECLS
#define LI_TYPE_PACKAGE (li_package_get_type ())
G_DECLARE_DERIVABLE_TYPE (LiPackage, li_package, LI, PACKAGE, GObject)
struct _LiPackageClass
{
GObjectClass parent_class;
/*< private >*/
void (*_as_reserved1) (void);
void (*_as_reserved2) (void);
void (*_as_reserved3) (void);
void (*_as_reserved4) (void);
void (*_as_reserved5) (void);
void (*_as_reserved6) (void);
void (*_as_reserved7) (void);
void (*_as_reserved8) (void);
};
/**
* LI_IPK_MAGIC:
*
* Magic number for IPK packages.
*/
#define LI_IPK_MAGIC "limba1\t\034"
/**
* LiPackageError:
* @LI_PACKAGE_ERROR_FAILED: Generic failure
* @LI_PACKAGE_ERROR_NOT_FOUND: A required file or entity was not found
* @LI_PACKAGE_ERROR_ARCHIVE: Error in the archive structure
* @LI_PACKAGE_ERROR_DATA_MISSING: Some data is missing in the archive
* @LI_PACKAGE_ERROR_OVERRIDE: Could not override file
* @LI_PACKAGE_ERROR_EXTRACT: Could not extract data
* @LI_PACKAGE_ERROR_CHECKSUM_MISMATCH: A checksum did not match
* @LI_PACKAGE_ERROR_WRONG_ARCHITECTURE: The package was built for a different architecture
* @LI_PACKAGE_ERROR_SIGNATURE_BROKEN: The signature of this package is broken
* @LI_PACKAGE_ERROR_DOWNLOAD_NEEDED: Package needs to be downloaded first before we can perfom this operation.
*
* The error type.
**/
typedef enum {
LI_PACKAGE_ERROR_FAILED,
LI_PACKAGE_ERROR_NOT_FOUND,
LI_PACKAGE_ERROR_ARCHIVE,
LI_PACKAGE_ERROR_DATA_MISSING,
LI_PACKAGE_ERROR_OVERRIDE,
LI_PACKAGE_ERROR_EXTRACT,
LI_PACKAGE_ERROR_CHECKSUM_MISMATCH,
LI_PACKAGE_ERROR_WRONG_ARCHITECTURE,
LI_PACKAGE_ERROR_SIGNATURE_BROKEN,
LI_PACKAGE_ERROR_DOWNLOAD_NEEDED,
/*< private >*/
LI_PACKAGE_ERROR_LAST
} LiPackageError;
#define LI_PACKAGE_ERROR li_package_error_quark ()
GQuark li_package_error_quark (void);
/**
* LiTrustLevel:
* @LI_TRUST_LEVEL_NONE: We don't trust that software at all (usually means no signature was found)
* @LI_TRUST_LEVEL_INVALID: The package could not be validated, its signature might be broken.
* @LI_TRUST_LEVEL_LOW: Low trust level (signed and validated, but no trusted author)
* @LI_TRUST_LEVEL_MEDIUM: Medium trust level (we already have software by this author installed and auto-trust him)
* @LI_TRUST_LEVEL_HIGH: High trust level (The software author is in our trusted database)
*
* A simple indicator on how much we trust a software package.
**/
typedef enum {
LI_TRUST_LEVEL_NONE,
LI_TRUST_LEVEL_INVALID,
LI_TRUST_LEVEL_LOW,
LI_TRUST_LEVEL_MEDIUM,
LI_TRUST_LEVEL_HIGH,
/*< private >*/
LI_TRUST_LEVEL_LAST
} LiTrustLevel;
const gchar *li_trust_level_to_text (LiTrustLevel level);
/**
* LiPackageStage:
* @LI_PACKAGE_STAGE_UNKNOWN: Unknown stage
* @LI_PACKAGE_STAGE_DOWNLOADING: Package is being downloaded
* @LI_PACKAGE_STAGE_VERIFYING: A signature is being verified
* @LI_PACKAGE_STAGE_INSTALLING: Package is being installed
* @LI_PACKAGE_STAGE_FINISHED: All tasks have finished
*
* Stages emitted when performing actions on a #LiPackage which consist of several
* smaller steps, like installing the package.
**/
typedef enum {
LI_PACKAGE_STAGE_UNKNOWN,
LI_PACKAGE_STAGE_DOWNLOADING,
LI_PACKAGE_STAGE_VERIFYING,
LI_PACKAGE_STAGE_INSTALLING,
LI_PACKAGE_STAGE_FINISHED,
/*< private >*/
LI_PACKAGE_STAGE_LAST
} LiPackageStage;
const gchar *li_package_stage_to_string (LiPackageStage stage);
LiPackage *li_package_new (void);
gboolean li_package_open_file (LiPackage *pkg,
const gchar *filename,
GError **error);
gboolean li_package_open_remote (LiPackage *pkg,
LiPkgCache *cache,
const gchar *pkid,
GError **error);
gboolean li_package_is_remote (LiPackage *pkg);
gboolean li_package_download (LiPackage *pkg,
GError **error);
gboolean li_package_install (LiPackage *pkg,
GError **error);
gboolean li_package_get_auto_verify (LiPackage *pkg);
void li_package_set_auto_verify (LiPackage *pkg,
gboolean verify);
LiTrustLevel li_package_verify_signature (LiPackage *pkg,
GError **error);
const gchar *li_package_get_install_root (LiPackage *pkg);
void li_package_set_install_root (LiPackage *pkg,
const gchar *dir);
const gchar *li_package_get_id (LiPackage *pkg);
void li_package_set_id (LiPackage *pkg,
const gchar *unique_name);
LiPkgInfo *li_package_get_info (LiPackage *pkg);
gboolean li_package_has_embedded_packages (LiPackage *pkg);
GPtrArray *li_package_get_embedded_packages (LiPackage *pkg);
LiPackage* li_package_extract_embedded_package (LiPackage *pkg,
LiPkgInfo *pki,
GError **error);
gchar *li_package_get_appstream_data (LiPackage *pkg);
void li_package_extract_contents (LiPackage *pkg,
const gchar *dest_dir,
GError **error);
void li_package_extract_appstream_icons (LiPackage *pkg,
const gchar *dest_dir,
GError **error);
G_END_DECLS
#endif /* __LI_PACKAGE_H */
|