aboutsummaryrefslogtreecommitdiffstats
path: root/package/utils/rbextract/src/rle.c
diff options
context:
space:
mode:
authorThibaut VARÈNE <hacks@slashdirt.org>2020-04-19 11:46:57 +0200
committerKoen Vandeputte <koen.vandeputte@ncentric.com>2020-05-08 15:17:17 +0200
commitab68939254b2ebf53561eb47fdd28da016e93b53 (patch)
treea271786d88d938ff9df20b61cb593bac4c50d2db /package/utils/rbextract/src/rle.c
parent1e24af5638f1c7263c10157afd7b25b9bf601c0c (diff)
downloadupstream-ab68939254b2ebf53561eb47fdd28da016e93b53.tar.gz
upstream-ab68939254b2ebf53561eb47fdd28da016e93b53.tar.bz2
upstream-ab68939254b2ebf53561eb47fdd28da016e93b53.zip
package/utils: remove rbextract
Rationale: 1/ This tool is no longer necessary following the implementation of a sysfs driver 2/ The upstream author, Robert Marko, stated[1] that this tool had been taken from his tree in an unfinished state not suitable for merging [1] https://github.com/openwrt/openwrt/pull/2850#issuecomment-610277863 Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
Diffstat (limited to 'package/utils/rbextract/src/rle.c')
-rw-r--r--package/utils/rbextract/src/rle.c80
1 files changed, 0 insertions, 80 deletions
diff --git a/package/utils/rbextract/src/rle.c b/package/utils/rbextract/src/rle.c
deleted file mode 100644
index ca198ee9fc..0000000000
--- a/package/utils/rbextract/src/rle.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * RLE decoding routine
- *
- * Copyright (C) 2012 Gabor Juhos <juhosg@openwrt.org>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published
- * by the Free Software Foundation.
- */
-
-#include <stdio.h>
-#include <stddef.h>
-#include <stdint.h>
-#include <stdbool.h>
-#include <sys/types.h>
-
-#include "rle.h"
-
-int rle_decode(const unsigned char *src, size_t srclen,
- unsigned char *dst, size_t dstlen,
- size_t *src_done, size_t *dst_done)
-{
- size_t srcpos, dstpos;
- int ret;
-
- srcpos = 0;
- dstpos = 0;
- ret = 1;
-
- /* sanity checks */
- if (!src || !srclen || !dst || !dstlen)
- goto out;
-
- while (1) {
- signed char count;
-
- if (srcpos >= srclen)
- break;
-
- count = (signed char) src[srcpos++];
- if (count == 0) {
- ret = 0;
- break;
- }
-
- if (count > 0) {
- unsigned char c;
-
- if (srcpos >= srclen)
- break;
-
- c = src[srcpos++];
-
- while (count--) {
- if (dstpos >= dstlen)
- break;
-
- dst[dstpos++] = c;
- }
- } else {
- count *= -1;
-
- while (count--) {
- if (srcpos >= srclen)
- break;
- if (dstpos >= dstlen)
- break;
- dst[dstpos++] = src[srcpos++];
- }
- }
- }
-
-out:
- if (src_done)
- *src_done = srcpos;
- if (dst_done)
- *dst_done = dstpos;
-
- return ret;
-}