[NTG-pdftex] Version numbering

Hans Hagen pragma at wxs.nl
Wed Jun 8 10:23:21 CEST 2005


Heiko Oberdiek wrote:
> On Wed, Jun 08, 2005 at 09:26:12AM +0200, Hans Hagen wrote:
> 
> 
>>Heiko Oberdiek wrote:
>>
>>i dislike the formal version number to be calculated, so i'd opt for:
>>
>>new primitives
>>
>>\pdftexmainversion:   readonly integer for A
>>\pdftexsubversion:    readonly integer for B
>>\pdftexbugfixversion: readonly integer for C
>>
>>backward compatibility primitives, not advertised
>>
>>\pdftexversion  := \pdftexmainversion * 100 + \pdftexsubversion
>>\pdftexrevision := to_lowerletter(\pdftexbugfixversion)
> 
> 
> %%% test.tex %%%
> % simulate \pdftexmainversion, ... that are not yet defined
> \newcount\pdftexmainversion
> \pdftexmainversion=1
> \newcount\pdftexsubversion
> \pdftexsubversion=21
> \newcount\pdftexbugfixversion
> \pdftexbugfixversion=1
> 
> % now the code for \pdftexversion and \pdftexrevision follows.
> % It should probably go into pdftexconfig.tex
> \begingroup
>   % * definition of \pdftexversion
>   \count0=\pdftexmainversion
>   \multiply\count0 by 100\relax
>   \advance\count0 by \pdftexsubversion
>   % using \chardef to avoid count register
>   % and \the\pdftexversion must work
>   \global\chardef\pdftexversion=\count0\relax
>   %
>   % definition of \pdftexrevision
>   \count0=\pdftexbugfixversion
>   \advance\count0 by `a\relax
>   % the revision letter must have catcode 12
>   \lccode`0=\count0\relax
>   \lowercase{\xdef\pdftexrevision{0}}%
> \endgroup
> 
> % test
> \message{* \the\pdftexversion\pdftexrevision}
> \end
> %%% test.tex %%%

sounds ok to me

(some \ifx\undefined\pdftexversion is needed as wrapper so that we don't get 
problems due to mixups with older versions)

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------



More information about the ntg-pdftex mailing list