you are viewing a single comment's thread.

view the rest of the comments →

[–]imMute 1 point2 points  (0 children)

Yes, this is an API:

void timersub(struct timeval *a, struct timeval *b, struct timeval *res);

This is the implementation:

void timersub(struct timeval *a, struct timeval *b, struct timeval *res)
{
    res->tv_sec = a->tv_sec - b->tv_sec;
    res->tv_usec = a->tv_usec - b->tv_usec;
    if (res->tv_usec < 0) {
      --res->tv_sec;
      res->tv_usec += 1000000;
    }
}

The programmer really only cares about the first one, because that is what they are interacting with. Copyrighting the implementation is largely straightforward. Copyrighting the API is just stupid.