1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

pkg/tinyvcdiff: add package

This commit is contained in:
Jue 2022-03-11 11:24:43 +01:00 committed by Juergen Fitschen
parent 641f7a704c
commit 5571d5c7a3
7 changed files with 104 additions and 0 deletions

View File

@ -108,6 +108,7 @@
/pkg/openthread/ @Hyungsin @jia200x
/pkg/semtech-loramac/ @aabadie @jia200x
/pkg/tinydtls/ @rfuentess @leandrolanzieri
/pkg/tinyvcdiff/ @jue89
/pkg/u8g2/ @basilfx
/pkg/ucglib/ @basilfx
/pkg/wakaama/ @leandrolanzieri

View File

@ -64,6 +64,7 @@ rsource "tiny-asn1/Kconfig"
rsource "tinycbor/Kconfig"
rsource "tinycrypt/Kconfig"
rsource "tinydtls/Kconfig"
rsource "tinyvcdiff/Kconfig"
rsource "tlsf/Kconfig"
rsource "tweetnacl/Kconfig"
rsource "u8g2/Kconfig"

22
pkg/tinyvcdiff/Kconfig Normal file
View File

@ -0,0 +1,22 @@
# Copyright (c) 2022 Juergen Fitschen
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
menuconfig PACKAGE_TINYVCDIFF
bool "Tiny VCDIFF"
depends on TEST_KCONFIG
if PACKAGE_TINYVCDIFF
config TINYVCDIFF_BUFFER_SIZE
int "Buffer size"
default 128
help
For VCDIFF copy and run instruction the library requires a buffer.
The best performance is achieved for sizes of typical page sizes of
the underlying MTD or VFS backend. But a size of just 1 byte would
work, too.
endif # PACKAGE_TINYVCDIFF

9
pkg/tinyvcdiff/Makefile Normal file
View File

@ -0,0 +1,9 @@
PKG_NAME=tinyvcdiff
PKG_URL=https://github.com/jue89/tiny-vcdiff.git
PKG_VERSION=e1a679f36d0212f2b84057a70c72f6e9deda45b3
PKG_LICENSE=MIT
include $(RIOTBASE)/pkg/pkg.mk
all:
$(QQ)"$(MAKE)" -C $(PKG_SOURCE_DIR)/src -f $(CURDIR)/$(PKG_NAME).mk

View File

@ -0,0 +1,10 @@
# Buffer size for vcdiff
CONFIG_TINYVCDIFF_BUFFER_SIZE ?= 128
CFLAGS += -DVCDIFF_BUFFER_SIZE=$(CONFIG_TINYVCDIFF_BUFFER_SIZE)
# Disable debugging if DEVELHELP is turned off
ifneq ($(DEVELHELP),1)
CFLAGS += -DVCDIFF_NDEBUG
endif
INCLUDES += -I$(PKGDIRBASE)/tinyvcdiff/include

58
pkg/tinyvcdiff/doc.txt Normal file
View File

@ -0,0 +1,58 @@
/**
* @defgroup pkg_tinyvcdiff Tiny VCDIFF
* @ingroup pkg
* @brief Decoder for interleaved VCDIFF deltas
*
* # Introduction
*
* tiny-vcdiff is a decoder for binary delta files that have been generated by
* [open-vcdiff](https://github.com/google/open-vcdiff) in the interleaved format.
*
* # Usage
*
* Every delta requires a source (the known data) and a target (the reconstructed
* data). This implementation provides backends for the @ref drivers_mtd and
* @ref sys_vfs storage drivers.
*
* # Example
*
* The example down below uses a @ref drivers_mtd device as known source data and
* writes the resulting target data into a @ref sys_vfs file.
*
* ```c
* #include "vcdiff.h"
* #include "vcdiff_mtd.h"
* #include "vcdiff_vfs.h"
*
* int apply_delta (const uint8_t *data, size_t data_len,
* mtd_dev_t *source_mtd,
* int traget_fd)
* {
* int rc;
* vcdiff_t vcdiff;
* vcdiff_init(&vcdiff);
*
* /* make sure source_mtd is already powered on */
* vcdiff_mtd_t source = VCDIFF_MTD_INIT(source_mtd);
* vcdiff_set_source_driver(&vcdiff, &vcdiff_mtd_driver, &source);
*
* /* make sure the vfs file is already opened for writing */
* vcdiff_vfs_t target = VCDIFF_VFS_INIT(fd_target);
* vcdiff_set_target_driver(&vcdiff, &vcdiff_vfs_driver, &target);
*
* rc = vcdiff_apply_delta(&vcdiff, data, data_len);
* if (rc != 0) {
* return rc;
* }
*
* rc = vcdiff_finish(&vcdiff);
* return rc;
* }
* ```
*
* # License
*
* Licensed under MIT.
*
* @see https://github.com/jue89/tiny-vcdiff.git
*/

View File

@ -0,0 +1,3 @@
MODULE = tinyvcdiff
include $(RIOTBASE)/Makefile.base