DWK

General
+ Home
+ Links

Programming
+ My Programs

DWK's codeform

The latest version of codeform is codeform version 1.2.0.

Here is codeform v1.10.

I wrote codeform to format code that I post on the internet. I wrote several DAT files for it (files with rules on what to highlight) for HTML and BBcode (which is used on forums).

Here's an example, using codeform.dat (with " = " added to [sreplace]):

#include <stdio.h>

int main(void) {  /* main() function */
    printf("Hello, World!\n");

    return 0;
}

And here's the same code, without formatting:

#include <stdio.h>

int main(void) {  /* main() function */
    printf("Hello, World!\n");

    return 0;
}

See the difference? :)

Usage

C:\DWK>codeform -v

codeform v1.10 by DWK
Executable path: C:\DWK\C\PATH\CODEFORM.EXE

usage: codeform [infile [outfile] [datfile]]

If no arguments are specified, you are prompted for both infile and outfile.
If no outfile is specified, the screen is used instead.
If no datfile is specified, the default is: "/codeform.dat"

codeform formats your code in nice colours, according to the rules in the
dat file.

C:\DWK>

The default dat file may be different; you can change it yourself by modifying this line in codeform.c (line 28):
char datafile[STRINGLEN] = "/codeform.dat";

Files:

  • codeform.zip (17,744): All the files that are listed here.
  • codeform.c (20,193): The source for codeform. (You can get rid of the #define debug* macros at the top.)
  • codeform.exe (13,824): codeform, compiled for Win32 with Dev-C++ 4.0.
  • codeform.hst (1,403): codeform's history.
  • codeform.dat (2,367): A DAT file for codeform, which codeforms C into HTML.
  • codeform_cpp.dat (3,364): A DAT file for codeform, which codeforms C++ into HTML.
  • codeform_cpp_sdev.dat (1,785): A DAT file for codeform, which codeforms C++ into HTML using Dev-C++ style colours.
  • codeform_cpp_srhide.dat (3,860): A DAT file for codeform, which codeforms C++ into HTML using RHIDE (DJGPP) style colours. There is no BBcode equivalent, because it needs a blue background.
  • codeform_cpp_sscite.dat (3,623): A DAT file for codeform, which codeforms C++ into HTML using SciTE style colours.
  • codeform_cb.dat (1,969): A DAT file for codeform, which codeforms C into BBcode.
  • codeform_cb_cpp.dat (2,712): A DAT file for codeform, which codeforms C++ into BBcode.
  • codeform_cb_cpp_sdev.dat (1,679): A DAT file for codeform, which codeforms C++ into BBcode using Dev-C++ style colours.
  • codeform_cb_cpp_sscite.dat (3,196): A DAT file for codeform, which codeforms C++ into BBcode using SciTE style colours.
Top