⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lib.c

📁 tcp protocol proxy,it is userful!
💻 C
字号:
/*    File: tcpproxy/lib.c    Version 1.0        Copyright (C) 1999 by Wolfgang Zekoll  <wzk@quietsche-entchen.de>    This source is free software; you can redistribute it and/or modify    it under the terms of the GNU General Public License as published by    the Free Software Foundation; either version 2, or (at your option)    any later version.    This source is distributed in the hope that it will be useful,    but WITHOUT ANY WARRANTY; without even the implied warranty of    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    GNU General Public License for more details.    You should have received a copy of the GNU General Public License    along with this program; if not, write to the Free Software    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.*/#include <stdlib.h>#include <stdio.h>#include <string.h>#include <ctype.h>#include <unistd.h>#include <time.h>#include <fcntl.h>#include <sys/types.h>#include <sys/stat.h>#include "lib.h"#define	DEBUG(x)		void *allocate(size_t size){	void	*p;	if ((p = malloc(size)) == NULL) {		fprintf (stderr, "%s: memory allocation error\n", program);		exit (-1);		}	memset(p, 0, size);	return (p);}void *reallocate(void *p, size_t size){	if ((p = realloc(p, size)) == NULL) {		fprintf (stderr, "%s: memory allocation error\n", program);		exit (-1);		}	return (p);}static unsigned int lower[256], upper[256];static int _init_upper(){	unsigned int c;		DEBUG( fprintf (stderr, "init upper[]\n"); )	for (c = 0; c < 256; c++)		upper[c] = c;	DEBUG( fprintf (stderr, "init uppercase letters\n"); )	for (c = 'a'; c < 'z'+1; c++)		upper[c] = 'A' + (c - 'a');	DEBUG( fprintf (stderr, "init umlaute\n"); )	upper[c = (unsigned char) '

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -