Pelles C forum

C language => User contributions => Topic started by: ddainelis1 on March 11, 2026, 02:51:43 AM

Title: Has anyone built a crude CMS ( Code Management System) in Pelles C
Post by: ddainelis1 on March 11, 2026, 02:51:43 AM
Has anyone built a crude CMS ( Code Management System) in Pelles C.    I'm working on a Dartmouth style BASIC interpreter since my old ALTAIR 8080 died.  I really do not want to spend the time to fully understand GITHIB right now.   Just wondering.
Title: Re: Has anyone built a crude CMS ( Code Management System) in Pelles C
Post by: Vortex on March 11, 2026, 11:08:25 AM
Hello,

You can check this one :

QuoteA simple CRUD system written in C

https://github.com/gabrielwitor/CRUD-C
Title: Re: Has anyone built a crude CMS ( Code Management System) in Pelles C
Post by: ddainelis1 on March 11, 2026, 12:42:07 PM
Thank you for the lead.
Title: Re: Has anyone built a crude CMS ( Code Management System) in Pelles C
Post by: rweidner on March 11, 2026, 08:48:08 PM
That's an interesting project idea, actually. If the scope of the project was limited to source code and ignored binary assets (images, sound, etc.), you could in theory use sqlite (or any db that supports triggers)

A CRUDE but effective workflow might be.

- scan source code directories for code files (for example, .c or .h)
- check file timestamps
- find the file in the database
- If file times on the file system differ from the one stored in the database, change the content in the database.
- If it doesn't exist at all, insert it. (filepath, file timestamp, content)
- use a "BEFORE" trigger to copy the current row into a history table. The history table will look like the code table plus a new primary key.

I mean, that's no GIT replacement, but it would track changes.

Is that what you meant by "crude"? Or did you need something more?

I think with just a little more work, one could add revisions.
Title: Re: Has anyone built a crude CMS ( Code Management System) in Pelles C
Post by: Vortex on March 11, 2026, 10:33:36 PM
By the way, the abbreviation must be CRUD if I am not wrong :

Quotecreate, read, update, and delete (CRUD)

https://en.wikipedia.org/wiki/Create,_read,_update_and_delete
Title: Re: Has anyone built a crude CMS ( Code Management System) in Pelles C
Post by: rweidner on March 12, 2026, 01:42:05 AM
I've decided to write one. I have dozens of projects that I don't really want on GitHub because... well... because I don't. So, I'll make this. I've decided not to use SQLite. Instead it will be purely file-based. The motivation for making it file-based is to minimize the amount of UI I need to create. Instead, I'll assume the user has WinMerge or similar. This process should be pretty quick and will be a nice distraction for me.

It's not intended to be like or ever replace GitHub. For me, it's just a place to put projects that linger around longer than expected.

The code will be written in C using PellesC.
Title: Re: Has anyone built a crude CMS ( Code Management System) in Pelles C
Post by: ddainelis1 on March 12, 2026, 02:19:04 AM
I'm working on one right now.  Here is the screen shot of help menu. 
Right now I'm cleaning up the help file in this version before I go to the next version V0.9 which will have create and fetch baseline.    Also,  I'm working on a script to test each version so I don't have to manually test it and figure what broke where.

CMS Development App
Type HELP for commands. Press Ctrl+Z to exit.

Root set to: E:\CMS_LIB
Library opened: E:\CMS_LIB\test2
CMS> ver
CMS Version V8.4PREA  (build Mar 11 2026 11:48:36)
CMS> help
Commands working in V8:
  HELP
  SHOW ROOT
  SHOW DRIVE
  SHOW VERSION
  SET DRIVE
  SET USERID
  CREATE LIBRARY
  OPEN LIBRARY
  SHOW LIBRARY
  SHOW CONFIG
  CREATE ELEMENT
  SHOW ELEMENT
  FETCH ELEMENT
  EXIT
  QUIT
  DEV

Commands present in notes but NOT working in this build:
  SET ROOT
  HISTORY
  CREATE BASELINE
  FETCH BASELINE
 

Use HELP <command> for details on one command.
CMS>

Title: Re: Has anyone built a crude CMS ( Code Management System) in Pelles C
Post by: ddainelis1 on March 12, 2026, 02:46:20 AM
V10 will be the new command:
Add "element" "get" to BASELINE

any suggestions here....
Title: Re: Has anyone built a crude CMS ( Code Management System) in Pelles C
Post by: rweidner on March 12, 2026, 03:35:03 AM
This is what I came up with. I run it from a .bat file.

crude.bat
C:\dev\crude\crude.exe "C:\dev\XecronixEngine\FBIPursuit" "C:\CRUDE"
C:\dev\crude\crude.exe: this is where I built crude
C:\dev\XecronixEngine\FBIPursuit: this is the source for a project I wanted to put in a repo.
C:\CRUDE: This is where my repos go. I could have many.

Here is the code and project file if you'd like to see it:
https://github.com/xecronix/crude
Title: Re: Has anyone built a crude CMS ( Code Management System) in Pelles C
Post by: ddainelis1 on March 13, 2026, 02:18:05 AM
Good Evening RWEIDNER,

Thank you for the link to your "CRUDE" application github site. It is a good App that meets your design requirements. Also, it does use a design approach that i had not considered.  Using a DB and i will look into the method for another app soon.

Best regards
Title: Re: Has anyone built a crude CMS ( Code Management System) in Pelles C
Post by: rweidner on March 13, 2026, 04:00:48 AM
I ran out of steam today.  But tomorrow I think I'll have a "Crude" revision control system complete with visual diff via winMerge "integrated" into the PellesC IDE using the tools editor.

The tool fills a need for me and was a fun little project.  Thanks for the idea.
Title: Re: Has anyone built a crude CMS ( Code Management System) in Pelles C
Post by: TimoVJL on March 13, 2026, 11:53:12 AM
poide have internal visual diff using fdiff.dll
Title: Re: Has anyone built a crude CMS ( Code Management System) in Pelles C
Post by: ddainelis1 on March 13, 2026, 05:31:19 PM
Hello TimoVJL,
Would you have a link on how to use the "internal visual diff using fdiff.dll" ?   

Best regards,

DJD
Title: Re: Has anyone built a crude CMS ( Code Management System) in Pelles C
Post by: TimoVJL on March 13, 2026, 05:48:08 PM
File -> New -> Differences

Help
Integrated Environment ->Differences

EDIT 2026-03-14 From Add-In help:
QuotePurpose:
Starts a File difference job in the IDE.

Syntax (macro):
BOOL AddIn_FileDifference(HWND hwnd, PADDIN_FILE_DIFFERENCE pFileDiff);

Syntax (SendMessage):
SendMessage(hwnd, AIM_FILE_DIFFERENCE, (WPARAM)0, (LPARAM)(PADDIN_FILE_DIFFERENCE)(pFileDiff))
typedef struct tagADDIN_FILE_DIFFERENCE {
    UINT cbSize;
    const WCHAR *pszSpecLeft;
    const WCHAR *pszSpecRight;
    BOOL fRecurse;
} ADDIN_FILE_DIFFERENCE, *PADDIN_FILE_DIFFERENCE;
Title: Re: Has anyone built a crude CMS ( Code Management System) in Pelles C
Post by: rweidner on March 13, 2026, 08:27:43 PM
Well, I looked closer at adding Crude to the tools section of PellesC IDE. While the IDE itself makes that task simple to do, Crude was designed as a per-project tool. Therefore, I stopped trying to integrate it into the PellesC IDE. For me, the juice wasn't worth the squeeze. A small setup process is required for Crude to work. The source directory and destination directory need to be configured. I put the setup in .batch files. I added two . bat files to the project as examples and pushed those to Github.

Example batch files:
1. crude.bat: Create a snapshot revision on demand.
2. compare.bat: Open WinMerge with the latest snapshot compared against the current project state.