📄 decode_napster.c
字号:
/* decode_napster.c Napster. w00w00! Copyright (c) 2000 Dug Song <dugsong@monkey.org> $Id: decode_napster.c,v 1.5 2000/11/16 07:00:08 dugsong Exp $*/#include "config.h"#include <sys/types.h>#include <stdio.h>#include <string.h>#include "buf.h"#include "decode.h"intdecode_napster(u_char *buf, int len, u_char *obuf, int olen){ struct buf inbuf, outbuf; u_short i, type; buf_init(&inbuf, buf, len); buf_init(&outbuf, obuf, olen); if (buf_get(&inbuf, &i, sizeof(i)) != sizeof(i)) return (0); i = pletohs(&i); if (buf_get(&inbuf, &type, sizeof(type)) != sizeof(type)) return (0); type = pletohs(&type); if (type != 2 || i > buf_len(&inbuf)) return (0); buf_put(&outbuf, buf_ptr(&inbuf), i); buf_put(&outbuf, "\n", 1); buf_end(&outbuf); return (buf_len(&outbuf));}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -