libwupsbackend/include/wups_backend/import_defines.h

72 lines
2.7 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>
2024-03-23 08:11:02 +01:00
typedef enum WUPSBackendGetPluginInformationInputType {
2022-02-13 16:12:10 +01:00
PLUGIN_INFORMATION_INPUT_TYPE_PATH = 0,
PLUGIN_INFORMATION_INPUT_TYPE_BUFFER = 1,
2024-03-23 08:11:02 +01:00
} WUPSBackendGetPluginInformationInputType;
2024-03-23 08:11:02 +01:00
typedef uint32_t wups_backend_plugin_container_handle;
typedef uint32_t wups_backend_plugin_data_handle;
2023-02-17 14:40:14 +01:00
typedef uint32_t WUPSBackendAPIVersion;
2024-03-23 08:11:02 +01:00
#define WUPS_BACKEND_MODULE_API_VERSION 0x00000002
#define WUPS_BACKEND_MODULE_API_VERSION_ERROR 0xFFFFFFFF
2023-02-17 14:40:14 +01:00
2024-03-23 08:11:02 +01:00
#define WUPS_BACKEND_PLUGIN_INFORMATION_VERSION 0x00000002
2021-10-01 17:25:19 +02:00
/* plugin_information message */
2024-03-23 08:11:02 +01:00
typedef struct wups_backend_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;
2024-03-23 08:11:02 +01:00
} wups_backend_plugin_information;
2024-03-23 08:11:02 +01:00
#define WUPS_BACKEND_PLUGIN_SECTION_INFORMATION_VERSION 0x00000001
2023-02-17 14:40:14 +01:00
2024-03-23 08:11:02 +01:00
typedef struct wups_backend_plugin_section_info {
2023-02-17 14:40:14 +01:00
uint32_t plugin_section_info_version;
char name[32];
void *address;
uint32_t size;
2024-03-23 08:11:02 +01:00
} wups_backend_plugin_section_info;
2023-02-17 14:40:14 +01:00
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;