Here's a simple question. What's the meaning of the leading letter "s" in the sin_family, sin_port, sin_addr and sin_zero?
struct sockaddr_in {
short int sin_family; // Address family, AF_INET
unsigned short int sin_port; // Port number
struct in_addr sin_addr; // Internet address
unsigned char sin_zero[8]; // Same size as struct sockaddr
};
Thanks.
A counterclockwise direction is an S (sinister, Latin for left) configuration. A clockwise direction is an R (rectus, Latin for right) configuration.
R configuration is the spatial arrangement of R isomer. S configuration is the spatial arrangement of S isomer. Priority of Substituents. R isomer has its relative direction of the priority order in the clockwise direction.
Because the 4th highest priority atom is placed in the back, the arrow should appear like it is going across the face of a clock. If it is going clockwise, then it is an R-enantiomer; If it is going counterclockwise, it is an S-enantiomer.
Draw an arrow starting from priority one and going to priority two and then to priority 3: If the arrow goes clockwise, like in this case, the absolute configuration is R. As opposed to this, if the arrow goes counterclockwise then the absolute configuration is S.
This comes from Berkeley, back when LSD was still legal. So very obvious in their naming choices :/
All kidding aside, this dates back to very early K&R C where structure members didn't have their own namespace. Which required you to come up with distinct names for the structure members that wouldn't collide with identifiers in the global namespace. Painful. Prefixing the names with an abbreviation of the structure name was the common approach.
Thus "sockaddr_in" becomes "sin".
Note how enums still have this problem today, not untypically solved the same way.
sin
is repeating the name of the sockaddr_in
structure, i.e. Socket INternet.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With