Author Topic: Compilation Monitoring Plugin  (Read 4406 times)

Offline threeS

  • Multiple posting newcomer
  • *
  • Posts: 36
Compilation Monitoring Plugin
« on: September 02, 2014, 08:13:02 pm »
Good Day!

I don't have any experience in creating plugins and I'm an average (maybe) C/C++ Programmer and a Code::Blocks IDE user when doing my assignments in school.

I'm planning to create a plugin and i know it's a good one:
A plugin that save the .cpp/.c++ (+ the system timestamp ex: *2014-09-03 2:07AM)  file every time I hit the compile/run button in the IDE and save it to my postgresql database.

Platform: Ubuntu 14.04 64 bit
Compiler: gcc version 4.8
PostgreSQL: 9.3

Is there any plugin yet created or related to this one?
Can somebody give me the link?  :)

A big thanks to all!
More Power!  :)
« Last Edit: September 02, 2014, 09:01:40 pm by threeS »

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Compilation Monitoring Plugin
« Reply #1 on: September 03, 2014, 04:31:21 am »
This description sounds like it is more the job for something like git or svn.

(Assuming you have already build Code::Blocks from source - if not, see the wiki for directions.)
However, if you will be the only user, an easy hack would be inserting a few PostgreSQL api calls into plugins/compilergcc/compilergcc.cpp in the function CompilerGCC::DoPrepareQueue() (around line 1560-ish +/- whatever changes in your local rev.).  If you are distributing, use RegisterEventSink() subscribe to cbEVT_COMPILER_STARTED (edit: from within your own plugin) and execute your code there.  Use find in files with C::B's source for these identifiers if you need code examples.
(Note: Specifics on PostgreSQL api are out of scope of this forum.)
« Last Edit: September 03, 2014, 04:43:53 am by Alpha »

Online oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13344
    • Travis build status
Re: Compilation Monitoring Plugin
« Reply #2 on: September 03, 2014, 08:56:39 am »
Writing a plugin will be far easier...
There are events for compilation started or finished.
A plugin can listen for them and then do its job.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline teto

  • Almost regular
  • **
  • Posts: 127
Re: Compilation Monitoring Plugin
« Reply #3 on: September 03, 2014, 11:25:49 am »
You may want to start with this (very simple) codebase:,19557.0.html