File: /home/user/src/cscout/example/awk/main.cDetails
Listings
Include Files
Metrics
CScout |
You can view a file's source code in five different forms:
int copy_fifo(from_stat, exists) struct stat *from_stat; int exists; { if (exists && unlink(to.p_path)) { warn("unlink: %s", to.p_path); return (1); } if (mkfifo(to.p_path, from_stat->st_mode)) { warn("mkfifo: %s", to.p_path); return (1); } return (pflag ? setfile(from_stat, 0) : 0); } |
int copy_fifo(from_stat, exists) struct stat *from_stat; int exists; { if (exists && unlink(to.p_path)) { warn("unlink: %s", to.p_path); return (1); } if (mkfifo(to.p_path, from_stat->st_mode)) { warn("mkfifo: %s", to.p_path); return (1); } return (pflag ? setfile(from_stat, 0) : 0); } |
#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) int digittoint __P((int)); int isascii __P((int)); int isblank __P((int)); int ishexnumber __P((int)); int isideogram __P((int)); int isnumber __P((int)); int isphonogram __P((int)); int isrune __P((int)); int isspecial __P((int)); int toascii __P((int)); #endif __END_DECLS #define __istype(c,f) (!!__maskrune((c),(f))) #define isalnum(c) __istype((c), _CTYPE_A|_CTYPE_D) #define isalpha(c) __istype((c), _CTYPE_A) #define iscntrl(c) __istype((c), _CTYPE_C) #define isdigit(c) __isctype((c), _CTYPE_D) /* ANSI -- locale independent */ #define isgraph(c) __istype((c), _CTYPE_G) #define islower(c) __istype((c), _CTYPE_L) #define isprint(c) __istype((c), _CTYPE_R) #define ispunct(c) __istype((c), _CTYPE_P) #define isspace(c) __istype((c), _CTYPE_S) #define isupper(c) __istype((c), _CTYPE_U) #define isxdigit(c) __isctype((c), _CTYPE_X) /* ANSI -- locale independent */ #define tolower(c) __tolower(c) #define toupper(c) __toupper(c) |
File MetricsWritable FilesNumber of elements: 14
Read-only FilesNumber of elements: 14
CScout |
Read-only Files
You can bookmark this page to save the respective query CScout 2.0 - 2004/07/31 12:37:12 |
Writable Files
You can bookmark this page to save the respective query CScout 1.6 - 2003/06/04 15:14:51 |
static
) identifiers, but
detecting global identifiers is more tricky, since it requires
processing of all files that will be linked together.
The restriction to writable identifiers will filter-out noise
generated through the use of the system's library functions.
In our example, the following list is generated:
Files Containing Unused Project-scoped Writable IdentifiersMatching Files
You can bookmark this page to save the respective query CScout 2.0 - 2004/07/31 12:37:12 |
tab
to go to each hyperlink.
In our example the identifier will appear as follows:
void setthetime(fmt, p, jflag, nflag) const char *fmt; register const char *p; int jflag, nflag; { register struct tm *lt; struct timeval tv; const char *dot, *t; int century; |
setthetime
is declared as
static
, but not defined as such.)
static
) unused writable identifiers.
Although some modern compilers can detect file-local
identifiers, they fail to detect macros and some types of
variable declarations.
The CScout query is more general and can be more reliable.
The restriction to writable identifiers will filter-out noise
generated through the use of the system's library functions.
In our example, the following list is generated:
Files Containing Unused File-scoped Writable IdentifiersMatching Files
You can bookmark this page to save the respective query CScout 2.0 - 2004/07/31 12:37:12 |
copyright
and the rcsid
identifiers.
#ifndef lint static char const copyright[] = "@(#) Copyright (c) 1989, 1993\n\ The Regents of the University of California. All rights reserved.\n"; #endif /* not lint */ #ifndef lint #if 0 static char sccsid[] = "@(#)echo.c 8.1 (Berkeley) 5/31/93"; #endif static const char rcsid[] = "$FreeBSD: src/bin/echo/echo.c,v 1.8.2.1 2001/08/01 02:33:32 obrien Exp $"; #endif /* not lint */ |
#ifdef
'd out.
In our example, the result set only contains the processing script (the compiled workspace definition file).
Writable .c Files Without Any StatmentsYou can bookmark this page to save the respective query CScout 1.6 - 2003/06/04 15:14:51 |
#pragma
commands)
to drive the CScout's source code analysis.
In our case the results are:
Writable Files Containing Unprocessed Lines
You can bookmark this page to save the respective query CScout 2.0 - 2004/07/31 12:37:12 |
In our case the results are:
Writable Files Containing Strings
You can bookmark this page to save the respective query CScout 1.6 - 2003/06/04 15:14:51 |
#include
invocations.
This query can be used to find files that break such a guideline.
As usual, read-only system files are excluded; these typically
use recursive #include
invocations as a matter of course.
In our example, the result is:
Writable .h Files With #include directivesYou can bookmark this page to save the respective query CScout 1.6 - 2003/06/04 15:14:51 |
Contents | « Previous Next (Generic File Queries) » |