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

📄 strnicmp.c

📁 wm PNE 3.3 source code, running at more than vxworks6.x version.
💻 C
字号:
/* $Header: /usr/cvsroot/target/src/wrn/wm/common/lib/strnicmp.c,v 1.3 2003/01/16 18:18:57 josh Exp $ *//* * Copyright (C) 1999-2005 Wind River Systems, Inc. * All rights reserved.  Provided under license only. * Distribution or other use of this software is only * permitted pursuant to the terms of a license agreement * from Wind River Systems (and is otherwise prohibited). * Refer to that license agreement for terms of use. *//**************************************************************************** *  Copyright 1993-1997 Epilogue Technology Corporation. *  Copyright 1998 Integrated Systems, Inc. *  All rights reserved. ****************************************************************************//* * $Log: strnicmp.c,v $ * Revision 1.3  2003/01/16 18:18:57  josh * directory structure shifting * * Revision 1.2  2001/11/06 22:15:55  tneale * Fixed for newest file layout * * Revision 1.1.1.1  2001/11/05 17:48:40  tneale * Tornado shuffle * * Revision 1.6  2001/05/24 20:32:30  paul * CAD-UL compiler is picky. * * Revision 1.5  2001/01/19 22:21:32  paul * Update copyright. * * Revision 1.4  2000/03/17 00:16:57  meister * Update copyright message * * Revision 1.3  1999/04/09 20:33:48  wes * re-constify.  let's see what, if anything, blows up * * Revision 1.2  1998/06/17 18:25:54  meister * This function only returned 0 or -1, now fixed to return 0, 1, or -1 * as appropriate. * * Revision 1.1  1998/06/03 20:12:51  sar * Added some common string functions.  The user can choose to install * these if his library doesn't include them or they are broken. * *//* [clearcase]modification history-------------------01b,20apr05,job  update copyright notices01a,11dec03,job  fix copyright statements*/#include <wrn/wm/common/install.h>#include <wrn/wm/common/stdf.h>#include <ctype.h>#include <string.h>#include <errno.h>/* PORTABLE 'Standard' C FUNCTIONS - these are written in C because not * all systems provide them consistently. Sometimes they're even broken. * This code used to be in snark/snmptalk/stdf.c but was moved here to * be available to more code.  */int  etc_strnicmp(register const char   *s,	       register const char   *t,	       size_t                len){  int a, b;    while (*s && *t && len) {    len--;    a = (int)*s; b = (int)*t;    if (isupper(a))      a = tolower(a);    if (isupper(b))      b = tolower(b);    if (a != b)      return (a > b ? 1 : -1);    s++;    t++;  }    /* if we're here because len is zero, don't do the final compare,   * which verifies that both strings are null terminated, cause   * chances are, they're not.   */  if (len == 0)    return 0;    if (*s != *t) {    return (*s > *t ? 1 : -1);  }  else {    return 0;  }}

⌨️ 快捷键说明

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