string.c

来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· C语言 代码 · 共 107 行

C
107
字号
#ifndef lintstatic CHTYPE *sccsid = "@(#)string.c	4.1      7/17/90";#endif lint/************************************************************************ *									* *			Copyright (c) 1986 by				* *		Digital Equipment Corporation, Maynard, MA		* *			All rights reserved.				* *									* *   This software is furnished under a license and may be used and	* *   copied  only  in accordance with the terms of such license and	* *   with the  inclusion  of  the  above  copyright  notice.   This	* *   software  or  any  other copies thereof may not be provided or	* *   otherwise made available to any other person.  No title to and	* *   ownership of the software is hereby transferred.			* *									* *   This software is  derived  from  software  received  from  the	* *   University    of   California,   Berkeley,   and   from   Bell	* *   Laboratories.  Use, duplication, or disclosure is  subject  to	* *   restrictions  under  license  agreements  with  University  of	* *   California and with AT&T.						* *									* *   The information in this software is subject to change  without	* *   notice  and should not be construed as a commitment by Digital	* *   Equipment Corporation.						* *									* *   Digital assumes no responsibility for the use  or  reliability	* *   of its software on equipment which is not supplied by Digital.	* *									* ************************************************************************//* * *   Modification History: * * 001 - Gary Gaudet for Andy Gadsby 09-mar-88 *	i18n version of csh * * * *//* * UNIX shell * * Bell Telephone Laboratories * */#include	"defs.h"/* ========	general purpose string handling ======== */CHTYPE *movstr(a, b)register CHTYPE	*a, *b;{	while (*b++ = *a++);	return(--b);}any(c, s)register CHTYPE	c;CHTYPE	*s;{	register CHTYPE d;	while (d = *s++)	{		if (d == c)			return(TRUE);	}	return(FALSE);}cf(s1, s2)register CHTYPE *s1, *s2;{	while (*s1++ == *s2)		if (*s2++ == 0)			return(0);	return(*--s1 - *s2);}length(as)CHTYPE	*as;{	register CHTYPE	*s;	if (s = as)		while (*s++);	return(s - as);}CHTYPE *movstrn(a, b, n)	register CHTYPE *a, *b;	register int n;{	while ((n-- > 0) && *a)		*b++ = *a++;	return(b);}

⌨️ 快捷键说明

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