[M3devel] time/date/version functions in Quake?

Jay jayk123 at hotmail.com
Tue Jan 1 21:17:51 CET 2008


 Hi. This is per Olaf.  
  Quake code in       m3-sys\cm3\src\version.quake   
  wants/needs the time/date like so:  
  C:\dev2\cm3.2\m3-sys\m3quake>\cm3\bin\cm3.exe -version    Critical Mass Modula-3 version d5.5.1      last updated: 2007-12-30      compiled: 2008-01-01 19:59:32    <===      configuration: \cm3\bin\cm3.cfg  
In UTC (universal coordinated time, also known as "greenwich mean time (GMT)")Currently this is via an application specific global variable in m3quake called "CM3_VERSION_NOW"."Currently", as in, I just did it, it is committed. (I'm impatient and impulsive and love coding, take me or leave me...)
 C:\dev2\cm3.2\m3-sys\m3quake>findstr /s NOW  * src\QMachine.m3:            "CM3_VERSION_NOW", 
It's only used on Windows, because I haven't yet tested elsewhere.
Olaf wants to consider something more general, as I understand.Some little extra feature in Quake, new built in function(s)/variable(s) (probably function(s)).Maybe something like Unix date (er, probably less general than that)or strftime, or something.
I'm skeptical that resolution to the second is useful here, seems overly precise.
Please discuss/decide/spec. :)(I don't care much. I'd be content just to change the variable to a function and decide on a name that isn't ALL CAPS,
though those were my own doing in the first place, as well as learning the best idiom for those few lines of code,
such as hopefully to avoid the six+ extra heap allocs for the TEXTs before concating them, like something involving
a small fixed sized buffer on the stack maybe? :) ) (Not clear how much "safety" a "competent programmer"
needs and if it is all worth it...obviously has its place, but...)
Oh, and to be a bit obnoxious -- maybe the higher level version.quake should be pushed into Modula-3 code????I mean..something like..some stamp that is applied to all binaries?
You know, like on Windows, there are these nice version resources.Putting them in every file automatically would be nice, unless overridden by the use -- typical override wouldbe provision of all Win32 resources, and hopefully that'd include a version resource.
 
I /know/ I am confusing issues -- universal injection of such data, vs. implementation in Quake vs. Modula-3.Any conventions/mechanisms for other platforms?The Mac has/had version resources, but these days that'd probably involve creating 10 more files and directories per executable.I can research it though easily enough..
On Windows it would be an extra dependency, on a resource compiler, but they are ubuiquitous.They come with all commercial toolsets and many free ones.
 - Jay
_________________________________________________________________
Don't get caught with egg on your face. Play Chicktionary!
http://club.live.com/chicktionary.aspx?icid=chick_wlhmtextlink1_dec
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20080101/67e87a25/attachment-0001.html>


More information about the M3devel mailing list