- Visual C++源码
- Visual Basic源码
- C++ Builder源码
- Java源码
- Delphi源码
- C/C++源码
- PHP源码
- Perl源码
- Python源码
- Asm源码
- Pascal源码
- Borland C++源码
- Others源码
- SQL源码
- VBScript源码
- JavaScript源码
- ASP/ASPX源码
- C#源码
- Flash/ActionScript源码
- matlab源码
- PowerBuilder源码
- LabView源码
- Flex源码
- MathCAD源码
- VBA源码
- IDL源码
- Lisp/Scheme源码
- VHDL源码
- Objective-C源码
- Fortran源码
- tcl/tk源码
- QT源码
- /*
- * Copyright (c) 1998, 1999 Sendmail, Inc. and its suppliers.
- * All rights reserved.
- * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
- * Copyright (c) 1988, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * By using this file, you agree to the terms and conditions set
- * forth in the LICENSE file which can be found at the top level of
- * the sendmail distribution.
- *
- */
- #ifndef lint
- static char id[] = "@(#)$Id: trace.c,v 8.20 1999/08/02 21:44:36 ca Exp $";
- #endif /* ! lint */
- #include <sendmail.h>
- /*
- ** TtSETUP -- set up for trace package.
- **
- ** Parameters:
- ** vect -- pointer to trace vector.
- ** size -- number of flags in trace vector.
- ** defflags -- flags to set if no value given.
- **
- ** Returns:
- ** none
- **
- ** Side Effects:
- ** environment is set up.
- */
- static u_char *tTvect;
- static int tTsize;
- static char *DefFlags;
- void
- tTsetup(vect, size, defflags)
- u_char *vect;
- int size;
- char *defflags;
- {
- tTvect = vect;
- tTsize = size;
- DefFlags = defflags;
- }
- /*
- ** TtFLAG -- process an external trace flag description.
- **
- ** Parameters:
- ** s -- the trace flag.
- **
- ** Returns:
- ** none.
- **
- ** Side Effects:
- ** sets/clears trace flags.
- */
- void
- tTflag(s)
- register char *s;
- {
- unsigned int first, last;
- register unsigned int i;
- if (*s == '')
- s = DefFlags;
- for (;;)
- {
- /* find first flag to set */
- i = 0;
- while (isascii(*s) && isdigit(*s))
- i = i * 10 + (*s++ - '0');
- first = i;
- /* find last flag to set */
- if (*s == '-')
- {
- i = 0;
- while (isascii(*++s) && isdigit(*s))
- i = i * 10 + (*s - '0');
- }
- last = i;
- /* find the level to set it to */
- i = 1;
- if (*s == '.')
- {
- i = 0;
- while (isascii(*++s) && isdigit(*s))
- i = i * 10 + (*s - '0');
- }
- /* clean up args */
- if (first >= tTsize)
- first = tTsize - 1;
- if (last >= tTsize)
- last = tTsize - 1;
- /* set the flags */
- while (first <= last)
- tTvect[first++] = i;
- /* more arguments? */
- if (*s++ == '')
- return;
- }
- }