libmicrohttpd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [libmicrohttpd] How MHD_VERSION works and how to get the "x.y.z-r" s


From: Christian Grothoff
Subject: Re: [libmicrohttpd] How MHD_VERSION works and how to get the "x.y.z-r" string from it?
Date: Tue, 27 Oct 2020 21:22:26 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

Hi Fermin,

There isn't a sane way to convert the MHD_VERSION string to the
x.y.z-string, and it's largely by accident in that we failed to properly
count in HEX. We are likely to fix that once we go for 1.0. OTOH, the
idea of the MHD_VERSION string was to do stuff like

#if MHD_VERSION > 0x44
bug-fixed-or-feature-available
#else
workaround-or-warn
#endif

and not to 'show' the version as a human-readable string. And for that,
the bug should not matter...

Happy hacking!

Christian

On 10/27/20 7:23 PM, FERMIN GALAN MARQUEZ wrote:
> Hi,
> 
>  
> 
> The MHD_VERSION is defined as follows
> 
>  
> 
> /**
> 
> * Current version of the library.
> 
> * 0x01093001 = 1.9.30-1.
> 
> */
> 
> #define MHD_VERSION 0x00097000
> 
>  
> 
> Thus, it seems that by blocks of two digits, each block defines one of
> the four digits of the usual x.y.z-r version number.
> 
>  
> 
> Thus, for instance in this case:
> 
>  
> 
> 00 -> 0. ..
> 
> 09 -> .. .9. ..
> 
> 70 -> .. .70
> 
> 00 -> ..-0
> 
>  
> 
> resulting in 0.9.70-0. So far so good.
> 
>  
> 
> However, what has surprised me is that the blocks are interpreted
> literary instead of hexadecimal (as 0x0 should mean). For instance 70 in
> hexadecimal is 112 (which would lead to 0.9.112-0 in this case).
> 
>  
> 
> I have two questions regarding this, please:
> 
>  
> 
> ·         Why does it work this way? Maybe it’s obvious, but for me is a
> bit weird J
> 
> ·         It seems there is no way of getting the “x.y.z-r” text string
> directly from the libmicrohttpd functions (please, tell me if I’m wrong…
> I could have missed some function for that provided by the library
> itself). It would be great if somebody hat has faced before the same
> problem could share the code snipped to get the “z.y.z-r” text string
> from the MHD_VERSION hex number :)
> 
>  
> 
> Thank you very much in advance!
> 
>  
> 
> Best regards,
> 
>  
> 
> ------
> 
> Fermín
> 
> 
> ------------------------------------------------------------------------
> 
> Este mensaje y sus adjuntos se dirigen exclusivamente a su destinatario,
> puede contener información privilegiada o confidencial y es para uso
> exclusivo de la persona o entidad de destino. Si no es usted. el
> destinatario indicado, queda notificado de que la lectura, utilización,
> divulgación y/o copia sin autorización puede estar prohibida en virtud
> de la legislación vigente. Si ha recibido este mensaje por error, le
> rogamos que nos lo comunique inmediatamente por esta misma vía y proceda
> a su destrucción.
> 
> The information contained in this transmission is privileged and
> confidential information intended only for the use of the individual or
> entity named above. If the reader of this message is not the intended
> recipient, you are hereby notified that any dissemination, distribution
> or copying of this communication is strictly prohibited. If you have
> received this transmission in error, do not read it. Please immediately
> reply to the sender that you have received this communication in error
> and then delete it.
> 
> Esta mensagem e seus anexos se dirigem exclusivamente ao seu
> destinatário, pode conter informação privilegiada ou confidencial e é
> para uso exclusivo da pessoa ou entidade de destino. Se não é vossa
> senhoria o destinatário indicado, fica notificado de que a leitura,
> utilização, divulgação e/ou cópia sem autorização pode estar proibida em
> virtude da legislação vigente. Se recebeu esta mensagem por erro,
> rogamos-lhe que nos o comunique imediatamente por esta mesma via e
> proceda a sua destruição

Attachment: 0x939E6BE1E29FC3CC.asc
Description: application/pgp-keys


reply via email to

[Prev in Thread] Current Thread [Next in Thread]