computil.c
来自「这是一个同样来自贝尔实验室的和UNIX有着渊源的操作系统, 其简洁的设计和实现易」· C语言 代码 · 共 39 行
C
39 行
#include <u.h>#include <libc.h>#include <draw.h>/* * compressed data are seuences of byte codes. * if the first byte b has the 0x80 bit set, the next (b^0x80)+1 bytes * are data. otherwise, it's two bytes specifying a previous string to repeat. */void_twiddlecompressed(uchar *buf, int n){ uchar *ebuf; int j, k, c; ebuf = buf+n; while(buf < ebuf){ c = *buf++; if(c >= 128){ k = c-128+1; for(j=0; j<k; j++, buf++) *buf ^= 0xFF; }else buf++; }}int_compblocksize(Rectangle r, int depth){ int bpl; bpl = bytesperline(r, depth); bpl = 2*bpl; /* add plenty extra for blocking, etc. */ if(bpl < NCBLOCK) return NCBLOCK; return bpl;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?