📄 rot13fs.fist
字号:
%{ /* * rot13fs: "encrypts" file data using rot13 */%}filter data;debug on;// this is a FiST comment, not copied to output files// rot13fs's smallest encoding/decoding unit is 1 byte (1 is default also)//encoding_blocksize 1;// block type encoding is also the default//encoding_type block;%%%%/* * rot13 each byte * return the number of bytes written */introt13fs_encode_block(const char *inbuf, char *outbuf, int len, const vnode_t *vp, const vfs_t *vfsp, u_long pagenum){ unsigned char *incp = (unsigned char *) inbuf; unsigned char *outcp = (unsigned char *) outbuf; unsigned char c; int i; for (i = 0; i < len; i++) { c = *incp & ~0x20; /* uppercase c */ *outcp = *incp; if (c >= 'A' && c <= 'Z') { if (c > 'M') *outcp -= 13; else *outcp += 13; } incp++; outcp++; } return len;}/* * un-rot13 each byte * return the number of bytes written */introt13fs_decode_block(const char *inbuf, char *outbuf, int len, const vnode_t *vp, const vfs_t *vfsp, u_long pagenum){ /* rot13fs decode and encode are identical */ return rot13fs_encode_block(inbuf, outbuf, len, vp, vfsp, pagenum);}/* * Local variables: * c-basic-offset: 4 * End: */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -