libmicrohttpd
[Top][All Lists]
Advanced

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

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


From: FERMIN GALAN MARQUEZ
Subject: [libmicrohttpd] How MHD_VERSION works and how to get the "x.y.z-r" string from it?
Date: Tue, 27 Oct 2020 18:23:04 +0000

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

reply via email to

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