Hacker News new | ask | show | jobs
by ehxor 2514 days ago
Looks like it's viewable here: https://github.com/iputils/iputils/blob/master/ping.c
1 comments

obviously not the original source code from 1983.

    pr_pack( buf, cc, from )
    char *buf;
    int cc;
    struct sockaddr_in *from;
    {
I know this ship has sailed, but after reading through the code you linked to, I finally understand the merit to this old-style C function definition syntax, and actually think it might look nicer than the modern way of doing the same thing for longer parameter lists:

    pr_pack( char *buf,
             int cc,
             struct sockaddr_in *from )
    {
It reminds me of how in TypeScript, if a function gets too many arguments, I'll split them out into an interface, and use destructuring to get to each element in the actual parameter list for convenience.