Right -- ntohl and htonl both do the same thing as each other (assuming consistent bytes) -- but they don't necessarily do the same thing as OP's code. Looking back, your point was probably that ntohl and htonl do the same thing regardless, so there's no need to "choose". I'm pretty sure my point was that yes, sometimes you have to type "ntohl" and sometimes you have to type "htonl", but (1) why reinvent the wheel and (2) it's nice if you can tell just by looking why you're flipping something around.
Originally Posted by cpjust
Yeah, having two names is probably just for convenience. It makes it easier to read code. It seems like they could have just had one function, but maybe coming up with a good name would be a problem.