Commit Graph
8 Commits
Author SHA1 Message Date
Evgeny f4bb615385 Add edit command with checksum verification
- New command: c_util edit <file> <start_line> <checksum1> [checksum2...]
- Verifies all checksums before editing
- Auto-learns indentation style from surrounding code
- Applies correct indentation to new code block
- Preserves preprocessor directives (no indentation)
- Supports both tabs and spaces for indentation
- Format: "line_num checksum: line_content" for show/description
2026-02-13 15:47:43 +03:00
Evgeny 02a97805f4 Add line numbers and checksums to show/description output
Format: "line_num checksum: line_content"
Checksum: sum of character codes modulo 256 as 2 hex digits
Pre-comments printed without line numbers (as before)
2026-02-13 13:42:57 +03:00
Evgeny 49b26d2822 Replace func/struct/enum with unified show command
- Add 'show' command to display code for functions/structs/enums by name
- Remove separate func/struct/enum commands
- Update usage message and docstring
- Command format: c_util show name1 name2 ...
2026-02-13 13:23:48 +03:00
Evgeny 86a271de7e Add description command and improve toc output
- Add 'description' command for showing items with comments
- toc: functions show signatures only, struct/enum without comments
- description: shows functions with pre-comments, struct/enum with full formatting
- Fix single-line /* */ comment extraction for functions
- Struct/enum in description: tabs for indentation, remove empty lines
2026-02-13 03:12:06 +03:00
Evgeny d110d19073 Add filename headers to toc output
Format:
  lib/filename.c:
  [start-end] declaration;

  lib/filename.h:
  [start-end] typedef struct { ... } name;
2026-02-13 02:51:32 +03:00
Evgeny 30635b53e0 Simplify toc output format to C-like syntax
- Format: [start-end] declaration;
- Normalize multi-line function signatures into single line
- Remove 'File:' headers, use blank lines between files
- Function declarations shown as prototypes (with semicolon)
- Struct/enum declarations preserved with typedef when present
- Whitespace normalized (multiple spaces → single space)
2026-02-13 02:44:49 +03:00
Evgeny 71ca9e08bf Rewrite c_util with proper brace nesting level tracking
- Preprocess: remove preprocessor directives and comments
- Compute brace levels for each line
- Find declarations only at level 0
- Properly handle multi-line function signatures
- Skip forward declarations and extern C blocks
- Find 291 declarations across the project
2026-02-13 02:30:02 +03:00
Evgeny e3e205ca10 Fix c_util script: implement proper C code navigation (toc, func, struct, enum commands) 2026-02-13 02:01:24 +03:00