diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2016-04-13 01:09:45 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2016-04-13 01:09:45 +0200 |
commit | a5268a54131f53b51e778a7f6157da53cdbe3142 (patch) | |
tree | adb177241ca239ed0d64f78a2fea339ee025123a /sys/src/liboventi/zero.c | |
parent | ffb0199247c2c748887f0782538545c75a304f88 (diff) |
remove unused liboventi
Diffstat (limited to 'sys/src/liboventi/zero.c')
-rw-r--r-- | sys/src/liboventi/zero.c | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/sys/src/liboventi/zero.c b/sys/src/liboventi/zero.c deleted file mode 100644 index 75acf3bd7..000000000 --- a/sys/src/liboventi/zero.c +++ /dev/null @@ -1,79 +0,0 @@ -#include <u.h> -#include <libc.h> -#include <oventi.h> - -/* score of a zero length block */ -uchar vtZeroScore[VtScoreSize] = { - 0xda, 0x39, 0xa3, 0xee, 0x5e, 0x6b, 0x4b, 0x0d, 0x32, 0x55, - 0xbf, 0xef, 0x95, 0x60, 0x18, 0x90, 0xaf, 0xd8, 0x07, 0x09 -}; - - -int -vtZeroExtend(int type, uchar *buf, int n, int nn) -{ - uchar *p, *ep; - - switch(type) { - default: - memset(buf+n, 0, nn-n); - break; - case VtPointerType0: - case VtPointerType1: - case VtPointerType2: - case VtPointerType3: - case VtPointerType4: - case VtPointerType5: - case VtPointerType6: - case VtPointerType7: - case VtPointerType8: - case VtPointerType9: - p = buf + (n/VtScoreSize)*VtScoreSize; - ep = buf + (nn/VtScoreSize)*VtScoreSize; - while(p < ep) { - memmove(p, vtZeroScore, VtScoreSize); - p += VtScoreSize; - } - memset(p, 0, buf+nn-p); - break; - } - return 1; -} - -int -vtZeroTruncate(int type, uchar *buf, int n) -{ - uchar *p; - - switch(type) { - default: - for(p = buf + n; p > buf; p--) { - if(p[-1] != 0) - break; - } - return p - buf; - case VtRootType: - if(n < VtRootSize) - return n; - return VtRootSize; - case VtPointerType0: - case VtPointerType1: - case VtPointerType2: - case VtPointerType3: - case VtPointerType4: - case VtPointerType5: - case VtPointerType6: - case VtPointerType7: - case VtPointerType8: - case VtPointerType9: - /* ignore slop at end of block */ - p = buf + (n/VtScoreSize)*VtScoreSize; - - while(p > buf) { - if(memcmp(p - VtScoreSize, vtZeroScore, VtScoreSize) != 0) - break; - p -= VtScoreSize; - } - return p - buf; - } -} |