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

📄 crlf.c,v

📁 Source Code from Richard Steven s Unix Network Programming
💻 C,V
字号:
head     1.1;branch   ;access   ;symbols  ;locks    ;comment  @ * @;1.1date     94.01.17.14.59.28;  author rstevens;  state Exp;branches ;next     ;desc@@1.1log@08Dec93 version for tcpipi@text@/* * Copyright (c) 1993 W. Richard Stevens.  All rights reserved. * Permission to use or modify this software and its documentation only for * educational purposes and without fee is hereby granted, provided that * the above copyright notice appear in all copies.  The author makes no * representations about the suitability of this software for any purpose. * It is provided "as is" without express or implied warranty. */#include	"sock.h"/* Convert newline to return/newline. */intcrlf_add(char *dst, int dstsize, const char *src, int lenin){	int 	lenout;	char	c;	if ( (lenout = lenin) > dstsize)			err_quit("crlf_add: destination not big enough");	for ( ; lenin > 0; lenin--) {		if ( (c = *src++) == '\n') {			if (++lenout >= dstsize)				err_quit("crlf_add: destination not big enough");			*dst++ = '\r';		}		*dst++ = c;	}	return(lenout);}intcrlf_strip(char *dst, int dstsize, const char *src, int lenin){	int		lenout;	char	c;	for (lenout = 0; lenin > 0; lenin--) { 		if ( (c = *src++) != '\r') {			if (++lenout >= dstsize)				err_quit("crlf_strip: destination not big enough");			*dst++ = c;		}	}	return(lenout);}@

⌨️ 快捷键说明

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