📄 oidcmp2.c
字号:
/* oidcmp2.c - oidcmp2.c routines *//* * Copyright 2000-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 1991-1997 Epilogue Technology Corporation. * Copyright 1998 Integrated Systems, Inc. * All rights reserved. *//* * $Log: oidcmp2.c,v $ * Revision 1.2 2001/11/06 21:20:19 josh * revised new path hacking * * Revision 1.1.1.1 2001/11/05 17:47:40 tneale * Tornado shuffle * * Revision 9.2 2001/01/19 22:21:57 paul * Update copyright. * * Revision 9.1 2000/03/17 00:17:40 meister * Update copyright message * * Revision 9.0 1998/10/16 22:09:33 sar * Update version stamp to match release * * Revision 8.2 1998/06/05 18:52:55 sra * "#include <foo.h>" => "#include <envoy/h/foo.h>". * * Revision 8.1 1998/02/25 04:49:52 sra * Update copyrights. * * Revision 8.0 1997/11/18 00:56:11 sar * Updated revision to 8.0 * * Revision 7.2 1997/03/20 06:50:16 sra * DFARS-safe copyright text. Zap! * * Revision 7.1 1997/02/25 10:49:26 sra * Update copyright notice, dust under the bed. * * Revision 7.0 1996/03/15 22:21:24 sar * Updated revision to 7.0 and copyright to 96 * * Revision 6.1 1996/01/05 19:02:18 sar * Removed no_pp style definitions as well as unnecessary include files * * Revision 6.0 1995/05/31 21:50:51 sra * Release 6.0. * * Revision 5.0 1994/05/16 15:29:57 sar * Updated revision to 5.0 and copyright to 1994 * * Revision 4.2 1994/03/08 18:02:30 dab * Mkae argument order consistent with oidcmp. * * Revision 4.1 1994/01/10 23:00:31 dab * taken from oidcmp.c * *//* [clearcase]modification history-------------------01d,12may05,job fix apigen comments01c,18apr05,job update copyright notices01b,16feb05,job apigen for documented APIs01a,24nov03,job update copyright information*//*DESCRIPTIONThis library contains oidcmp2.c routines.INCLUDE FILES: snmp.h*/#include <wrn/wm/snmp/engine/asn1conf.h>#include <wrn/wm/snmp/engine/asn1.h>#include <wrn/wm/snmp/engine/localio.h>#include <wrn/wm/snmp/engine/buffer.h>#include <wrn/wm/snmp/engine/decode.h>#include <wrn/wm/snmp/engine/snmpdefs.h>#include <wrn/wm/snmp/engine/snmp.h>#include <wrn/wm/snmp/engine/auxfuncs.h>/********************************************************************************* oidcmp2 - compare any two objects identifiers* SYNOPSIS** \cs* int oidcmp2* ( * int n1, * OIDC_T * idp1, * int n2, * OIDC_T * idp2 * )* \ce** DESCRIPTION** This routine compares any two objects identifiers. This routine combines the * functions of both oidorder() and oidcmp().** PARAMETERS* \is* \i <n1>* Specify the length of the first object identifier* \i <*idp1>* Specify the first object identifier.* \i <n2>* Specify the length of the second object identifier.* \i <*idp2>* Specify the second object identifier.* \ie** RETURNS: If <idp1> is greater than <idp2>, this routine returns 1. If <idp1> * is less than <idp2>, it returns -1. If they are the same, it returns 0.** ERRNO: N/A** SEE ALSO: llist_cmp(), oidcmp(), oidorder()*/int oidcmp2(int n1, OIDC_T *idp1, int n2, OIDC_T *idp2){ while ((n1 > 0) && (n2 > 0)) { if (*idp1 != *idp2) return (*idp1 < *idp2) ? -1 : 1; idp1++; idp2++; n1--; n2--; } if (n1 == n2) return 0; /* OIDs are the same */ else if (n1 > n2) return 1; else return -1;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -