1
0
Fork
You've already forked csope
0
C source code browser. Fork of Cscope version 15.9, with various improvements.
  • C 84.6%
  • Lex 7.7%
  • Yacc 4.6%
  • E 1.3%
  • OCaml 0.8%
  • Other 1%
Find a file
2026年05月13日 08:47:30 -06:00
config tag consistency 2023年12月15日 14:44:12 +01:00
documentation document historic relations to InterLisp's MasterScope 2026年05月04日 13:12:06 +02:00
object renamed folders 2023年09月26日 09:29:23 +02:00
scripts remove unused script (automake artifact) 2025年09月23日 10:00:25 +02:00
source Fix conflicting types error 2026年05月13日 08:47:30 -06:00
test revisit tests; all passing 2026年01月15日 20:17:55 +01:00
.gitignore gdb history should have never been commited 2025年09月09日 23:23:32 +02:00
LICENSE add LICENSE; remove obnoxious copyright comments (no benefits for BSD) 2025年09月24日 09:46:14 +02:00
Makefile fix inconsistency 2025年09月23日 12:26:05 +02:00
README.md bump readme 2026年03月29日 16:12:17 +02:00

Csope

C source code browser. Fork of Cscope version 15.9, with various improvements.

Because CScope is good and shall not be forgotten. While the original's maintenance seems abandoned and as far as I can tell you need a PhD in autoconf to compile the latest version, Csope is alive and well.

Table of contents

Demo

demo

Before/After

After

after

Before

after

Features

Search for

  • symbol
  • global definition
  • assignments to specified symbol
  • functions called by specified function
  • functions calling specified function
  • text string
  • egrep pattern
  • file
  • files #including specified file

...and open with your editor.

Batch change search results interactively. Save/load/pipe results.

It fully supports:

  • C
  • Lex
  • Yacc

Partially supports:

  • C++
  • Java
  • Specification and Description Language

Interface

 <-- Tab -->
 +--Version-----------------Case--+ +--------------------------------+
A |+--------------+---------------+| |+------------------------------+|
| || Input Window | Result window || || ||
| |+--------------+ || ? || ||
 || Mode Window | || ----> || Help ||
% || | || <---- || ||
 || | || ... || ||
| || | || || ||
| || | || || ||
V |+--------------+---------------+| |+------------------------------+|
 +---------------------Tool Tips--+ +--------------------------------+

Usacase

Csope excels at exploring strange and obscure codebases thanks to its TUI. It is sometimes mislabeled as a code navigation tool, but the original documentation describes it more accurately as a code browsing tool. Many tools can jump to a definition or grep for a pattern, but Csope stands out because it does all of that and much more while presenting a clear, comprehensive list of results, ready to launch your editor at the exact location of any entry. This project itself is a good example of that strength. The Cscope codebase used to be a complete mess, and fixing it would likely have been a lost cause without Cscope/Csope.

Improvements/Changes

User side

  • Renamed the program, because "cscope" is annoying to type
  • Improved TUI
  • GNU Readline/History integration

To the code

  • Nuked autoconf, replaced with single Makefile
  • Reorganized the control flow
  • Encapsulated various functionalities
  • Removed macro hell used for compiling on dead badgers
  • Reduced global state hell
  • Use stdbool instead of YES/NO macros
  • Removed dead code
  • ...and much more

Installation

Gentoo

Add my overlay and install using portage.

From source

After you made sure you have the following installed:

  • ncurses
  • GNU Readline
  • GNU History (should come with Readline)
  • Lex (or GNU Flex)
  • Yacc (or GNU Bison)

Just run:

make

This will yield the executable "csope", which you are free to do whatever with.

Hint:

cp csope /usr/bin/

Quick start

Start browsing your project by running csope over it's source dir.

csope -s source/

Configuration

Readline

The readline integration should be complete -please let us know if not-, except for your prompt being used, which could easily break the TUIs display.

The rl_readline_name variable will be set to "Csope", so you may have conditional configurations in your .inputrc with the following format:

$if Csope
	# <whatever>
$endif

Colors

All can be configured sucklessly under "config/colors.h". Hopefully the comments are self evident.