libwupsbackend/include/wups_backend/import_defines.h

72 lines
2.6 KiB
C
Raw Normal View History

/****************************************************************************
* Copyright (C) 2019-2022 Maschell
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/
#pragma once
2023-02-17 14:40:14 +01:00
#include <stddef.h>
2022-02-13 16:12:10 +01:00
#include <stdint.h>
typedef enum GetPluginInformationInputType {
2022-02-13 16:12:10 +01:00
PLUGIN_INFORMATION_INPUT_TYPE_PATH = 0,
PLUGIN_INFORMATION_INPUT_TYPE_BUFFER = 1,
} GetPluginInformationInputType;
typedef uint32_t plugin_container_handle;
typedef uint32_t plugin_data_handle;
2023-02-17 14:40:14 +01:00
typedef uint32_t WUPSBackendAPIVersion;
2023-02-17 14:40:14 +01:00
#define WUPS_BACKEND_MODULE_API_VERSION 0x00000002
#define WUPS_BACKEND_MODULE_API_VERSION_ERROR 0xFFFFFFFF
#define PLUGIN_INFORMATION_VERSION 0x00000002
2021-10-01 17:25:19 +02:00
/* plugin_information message */
typedef struct plugin_information {
2021-10-01 17:25:19 +02:00
uint32_t plugin_information_version;
char name[256];
char author[256];
char buildTimestamp[256];
char description[256];
char license[256];
char version[256];
2021-10-01 17:25:19 +02:00
char storageId[256];
size_t size;
} plugin_information;
2023-02-17 14:40:14 +01:00
#define PLUGIN_SECTION_INFORMATION_VERSION 0x00000001
typedef struct plugin_section_info {
uint32_t plugin_section_info_version;
char name[32];
void *address;
uint32_t size;
} plugin_section_info;
typedef enum PluginBackendApiErrorType {
2023-02-17 14:40:14 +01:00
PLUGIN_BACKEND_API_ERROR_NONE = 0,
PLUGIN_BACKEND_API_ERROR_INVALID_SIZE = 0xFFFFFFFF,
PLUGIN_BACKEND_API_ERROR_INVALID_ARG = 0xFFFFFFFE,
PLUGIN_BACKEND_API_ERROR_FAILED_ALLOC = 0xFFFFFFFD,
PLUGIN_BACKEND_API_ERROR_FILE_NOT_FOUND = 0xFFFFFFFC,
PLUGIN_BACKEND_API_INVALID_HANDLE = 0xFFFFFFFB,
PLUGIN_BACKEND_API_ERROR_MODULE_NOT_FOUND = 0xFFFFFFFA,
PLUGIN_BACKEND_API_ERROR_MODULE_MISSING_EXPORT = 0xFFFFFFF9,
PLUGIN_BACKEND_API_ERROR_UNSUPPORTED_VERSION = 0xFFFFFFF8,
PLUGIN_BACKEND_API_ERROR_LIB_UNINITIALIZED = 0xFFFFFFF7,
PLUGIN_BACKEND_API_ERROR_UNSUPPORTED_COMMAND = 0xFFFFFFF6,
} PluginBackendApiErrorType;