Commit 30942ff2 authored by Rob Swindell's avatar Rob Swindell 💬
Browse files

Include git branch/hash in sbbsctrl version info

And export a simple ver() function to be used in MainFormUnit.cpp (for mqtt stuff)
parent f4c01684
/* Synchronet Control Panel (GUI Borland C++ Builder Project for Win32) */
/* $Id: AboutBoxFormUnit.cpp,v 1.14 2020/04/15 05:27:14 rswindell Exp $ */
/****************************************************************************
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
......@@ -15,21 +13,9 @@
* See the GNU General Public License for more details: gpl.txt or *
* http://www.fsf.org/copyleft/gpl.html *
* *
* Anonymous FTP access to the most recent released source is available at *
* ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net *
* *
* Anonymous CVS access to the development source and modification history *
* is available at cvs.synchro.net:/cvsroot/sbbs, example: *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login *
* (just hit return, no password is necessary) *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src *
* *
* For Synchronet coding style and modification guidelines, see *
* http://www.synchro.net/source.html *
* *
* You are encouraged to submit any modifications (preferably in Unix diff *
* format) via e-mail to mods@synchro.net *
* *
* Note: If this box doesn't appear square, then you need to fix your tabs. *
****************************************************************************/
......@@ -47,6 +33,8 @@
#include "ftpsrvr.h"
#include "websrvr.h"
#include "services.h"
#include "git_branch.h"
#include "git_hash.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
......@@ -57,11 +45,9 @@ __fastcall TAboutBoxForm::TAboutBoxForm(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TAboutBoxForm::FormShow(TObject *Sender)
{
Credits->Lines->Clear();
const char* ver(void)
{
DWORD i;
unsigned int len=GetFileVersionInfoSize(
Application->ExeName.c_str() // pointer to filename string
......@@ -69,8 +55,7 @@ void __fastcall TAboutBoxForm::FormShow(TObject *Sender)
);
BYTE* buf=(BYTE *)malloc(len);
if(buf==NULL) {
Credits->Lines->Add("MALLOC ERROR!");
return;
return "MALLOC ERROR!";
}
GetFileVersionInfo(
Application->ExeName.c_str() // pointer to filename string
......@@ -94,9 +79,9 @@ void __fastcall TAboutBoxForm::FormShow(TObject *Sender)
,__BORLANDC__>>8
,__BORLANDC__&0xff);
char ver[256];
static char ver[256];
wsprintf(ver,"Synchronet Control Panel v%u.%u.%u.%u%s%s "
"Compiled %s %s with %s"
"Compiled %s/%s %s %s with %s"
,Ver->dwFileVersionMS>>16
,Ver->dwFileVersionMS&0xffff
,Ver->dwFileVersionLS>>16
......@@ -105,21 +90,31 @@ void __fastcall TAboutBoxForm::FormShow(TObject *Sender)
" Debug" : ""
,Ver->dwFileFlags&VS_FF_PRERELEASE ?
" Pre-release" : ""
,GIT_BRANCH, GIT_HASH
,__DATE__, __TIME__, compiler
);
return ver;
}
//---------------------------------------------------------------------------
void __fastcall TAboutBoxForm::FormShow(TObject *Sender)
{
Credits->Lines->Clear();
Credits->Lines->Add(bbs_ver());
Credits->Lines->Add(mail_ver());
Credits->Lines->Add(ftp_ver());
Credits->Lines->Add(web_ver());
Credits->Lines->Add(services_ver());
Credits->Lines->Add(ver);
Credits->Lines->Add(ver());
Credits->Lines->Add("Synchronet Local Spy ANSI Terminal Emulation"
+ CopyRight);
Credits->Lines->Add(AnsiString(js_ver())
+ " (c) 1998 Netscape Communications Corp.");
#ifdef USE_CRYPTLIB
char ver[256];
wsprintf(ver,"Cryptlib v%u.%u.%u"
,(CRYPTLIB_VERSION/100)
,(CRYPTLIB_VERSION/10)%10
......
/* Synchronet Control Panel (GUI Borland C++ Builder Project for Win32) */
/* $Id: AboutBoxFormUnit.h,v 1.6 2018/07/24 01:11:28 rswindell Exp $ */
/****************************************************************************
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
......@@ -15,21 +13,9 @@
* See the GNU General Public License for more details: gpl.txt or *
* http://www.fsf.org/copyleft/gpl.html *
* *
* Anonymous FTP access to the most recent released source is available at *
* ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net *
* *
* Anonymous CVS access to the development source and modification history *
* is available at cvs.synchro.net:/cvsroot/sbbs, example: *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login *
* (just hit return, no password is necessary) *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src *
* *
* For Synchronet coding style and modification guidelines, see *
* http://www.synchro.net/source.html *
* *
* You are encouraged to submit any modifications (preferably in Unix diff *
* format) via e-mail to mods@synchro.net *
* *
* Note: If this box doesn't appear square, then you need to fix your tabs. *
****************************************************************************/
//---------------------------------------------------------------------------
......@@ -43,6 +29,7 @@
#include <ExtCtrls.hpp>
#include <Graphics.hpp>
#include "MainFormUnit.h"
const char* ver(void);
//---------------------------------------------------------------------------
class TAboutBoxForm : public TForm
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment