-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
104 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
MODULE = tinyvcdiff | ||
|
||
include $(RIOTBASE)/Makefile.base |