Cscope

{{short description|Free software that allows for searching source code written in C, C++, and Java}}

{{lowercase title}}

{{about||the educational curriculum|CSCOPE (education)|the type of radar display|Radar display#C-Scope}}{{Sources needed|date=September 2023}}{{Infobox Software

| name = cscope

| logo =

| screenshot = Cscope browsing it's own source code.jpg

| caption =

| developer =

| latest release version = 15.9

| latest release date = {{Start date and age|2018|7|24}}{{cite web|url=https://sourceforge.net/p/cscope/cscope/ci/612a539b585ccdb70a1261652954f579ccedb270/|title=update configure.in script for 15.9 release|via=SourceForge|first=Neil|last=Horman|date=24 July 2018|accessdate=4 October 2018}}

| latest preview version =

| latest preview date =

| operating system = Unix, Linux, DOS

| genre = Programming tool,
for C, C++, Java

| license = BSD

}}

cscope is a programming tool which works in console mode, text-based interface, that allows computer programmers or software developers to search source code of the programming language C, with some support for C++ and Java. It is often used on very large projects to aid code comprehension to find source code, functions, declarations, definitions, and regular expression. cscope is free and released under a BSD license. The original developer of cscope is Joe Steffen.

History

Joe Steffen began writing cscope in 1980, as an aid to his programming word on a PDP-11.{{Cite web |title=The History of Cscope |url=https://cscope.sourceforge.net/history.html |access-date=2023-09-06 |website=cscope.sourceforge.net}} The tool became very popular within Bell Labs, as fellow employees requested more features and improvements. The tool was later made part of the AT&T Unix distribution. It is still used by developers today, some of whom are most accustomed to using vi or other text-based editors, instead of GUI editors. The functions in cscope are available to varying degrees in modern graphical text editors.

Usage

cscope is used in two phases. First, a developer builds the cscope database of the source code. The developer can often use find or other Unix tools to get the list of filenames needed to index into a file called cscope.files. The developer then builds a database using the command cscope -b -q -k. The k flag is intended to build a database for an operating system or C library source code. It will not look in /usr/include. Second, the developer can now search those files using the command cscope -d. An index must be rebuilt whenever changes are made to indexed files.

cscope was created to search content within C code, but it can also be used (with some caveats) for C++ and Java code.[http://cscope.sourceforge.net/ CScope home page]: "The fuzzy parser supports C, but is flexible enough to be useful for C++ and Java[...]"

Derived software

  • KScope runs on KDE and integrates the Kate text editor. The KScope project is no longer being maintained.[http://kscope.sourceforge.net/ KScope homepage]
  • Seascope runs on PyQt4 and integrates the Scintilla text editor.[http://code.google.com/p/seascope/ Seascope homepage]
  • Gscope is based on GTK2 and GTK3 and integrates with multiple text editors.[https://github.com/tefletch/gscope/wiki Gscope homepage]
  • CCTree is a native Vim plugin that integrates with the Vim editor and offers functions similar to KScope and Seascope.{{Cite web|url=http://www.vim.org/scripts/script.php?script_id=2368|title = CCTree - C Call-Tree Explorer -- Cscope based source-code browser; code flow analyzer : Vim online}}
  • Csope is a fork with an altered TUI.[https://github.com/agvxov/csope Csope homepage]

See also

References

{{reflist}}