Cweed4 is a C source file weeder for Windows, written in Win32Forth.

It only changes whitespace (formatting) and does not otherwise change the content of the file.

This is analogous to weeding a garden, where the plants are left untouched but the bits between (weeds) may be seriously modified.

Cweed is an experiment in specifying a coding standard in the form of an executable program.

It is designed only to modify whitespace, but please make a backup before using.

Cweed4 V4.02 2021 Oct 16 Documentation PDF file

Cweed4 V4.02 2021 Oct 16.7z  7zip file.

Now with support for Barr Coding Standard (2018) Rules 3.1 Spaces.


New in Cweed4 V4.02

The file Cweed4_script.f is now loaded when running the Barr 3.1 function.

This allows the rules to be changed and reloaded without re-compiling Cweed.

If the file Cweed4_script.f is not found in the directory where Cweed4 is running, the default file is used

i.e. the one that existed when Cweed4 was compiled.


New in Cweed4 V4.01

New name – Cweed4 . Searching for “Cweed” online finds lots of sites about “weed” – “Cweed4” is easier to find. The version has also been reset to Cweed4 V4.01.

Added a custom file Cweed4.script for the Barr Coding Standard (2018) – this allows modifications to be made without recompiling Cweed4.

Download Cweed4v01.exe self-extracting zip files no longer work.

Download zip file.

New in V4.25

Added F2 key to add/remove "interior spaces" : [i] <--> [ i ] etc.

Press F2 to apply the Barr Coding Standard (2018) Barr Coding Standard (2018) Rules 3.1 Spaces a, g, h, i and j.

Added source files for Win32Forth, so that source for system words can be viewed.

Cweed V4.24 2020 Nov 13 7z file.

Now with support for C++, Lint and with Folder Scan, and works under Windows 7/8/10. Also NumName human readable hash values…

Download Cweed4v24.exe self-extracting zip file.

Download zip file.

New in V4.24

Now packaged with Win32Forth6v05H 2019 Mar 02 which fixes a bug that forced its window to be too small.

New in V4.23

 Indenting now ignores #ifdef, #ifndef, #else and #endif if the line contains double underscores : __IGNORE_THISE_INDENT__

This is to prevent indentation in *.h files with the usual redefinition macro format, below.

Please make sure any #else and #endif has a double underscore in a comment on the same line :

#ifndef __HEADER_FILE_NAME__

#define __HEADER_FILE_NAME__

... your code here...

#endif // __HEADER_FILE_NAME__

New in V4.2x

 “Select File” now defaults to All Files *.*, made INDENT_SPACES changeable

V4.21 adds 'F' for ShowFolder with filter for *.c and *.h only, and fixes a bug with #tabs in ShowFolder.

New in V4.1

Minor bug fixes in Folder Report and new NumName.txt file “monsoons-megabyte”

New in V4.0

Fixed lack of update when the Cweed window is covered, added NumName text feature to give the file MD5 hash a human readable form – see NumName.f for details.The NumName.txt file list of words is now precompiled.

New in V3.4

Fixed lack of update when the Cweed window is covered, added NumName text feature to give the file MD5 hash a human readable form – see NumName.f for details.

New in V3.3

Added Windows7 support in the Win32Forth supplied in the Cweed package, also made the window re-paint after it is covered by another window.

New in V3.2

Fix to non comment block lines being indented if they start with a ‘*’.

Folder report added – select a file, then click on Show Folder to perform a scan of all C, C++ and header files in the containing folder.

V3.21 fixes a bug in the number of tabs reported in Show Folder

New in V3.1

Lint report shows numbers of “//lint –save” and “//lint –restore”  strings in the file.

Also checks for “-e” after a “–restore” and a one or more spaces between the “//” and “lint”.

New in V3.0

Bug fixes to namespace indentation.

Adding 2-space indentation for public: , private: and protected: .

Adding CRC32 and MD5 values for the file.

Block comments indented by one space.

Configuration options are now at the top of file Cweed.f .

Howerd Oakford