File formats are directly analogous to APIs.
* magic numbers at the start of the file format
* all sorts of enums that you just have to know, names and numbers and the correspondence between them
* names of data types and classes are often needed
* there are often many "standard" things that will be in both the original source and the duplicate because it's the industry standard (things like bold text in any word format or parallel constraints in cad files). They will mostly match in all programs of the same time
And that's just the beginning. You could make an argument that all of those fall under copyright. And they shouldn't. So it really isn't that far from an API.
<doc>
<author>
.....Then in my code I have a parse method:
Def parse_doc(xml)
self.Owner = Person.new(xml[:author])
....
End
And a corresponding write method.
My code is original and contains nothing written by whoever created the file format beyond short and simple tag names. It's much different than copying a class structure and method signatures.
private static void rangeCheck(int arrayLen, int fromIndex, int toIndex {
if (fromIndex > toIndex)
throw new IllegalArgumentException("fromIndex(" + fromIndex +
") > toIndex(" + toIndex+")");
if (fromIndex < 0)
throw new ArrayIndexOutOfBoundsException(fromIndex);
if (toIndex > arrayLen)
throw new ArrayIndexOutOfBoundsException(toIndex);
}
Note that of course "rangeCheck", "arrayLen", "fromIndex" and "toIndex" are part of the function signature, as is "ArrayIndexOutOfBoundsException" and "IllegalArgumentException".Except you do in many cases - there are many serialization systems out there where you describe your structures as types, and they generate the serializers for you. Just look at protobuf as one example. Is a protobuf declaration an API? If not, how is it different from any other API that declares a bunch of structs?
The format of the file is not (last I checked) the thing that's copyrightable; rather, it's the specific producers and consumers which are. Same deal for an API; the API itself is not (supposed) to be copyrightable, while the producers and consumers are indeed copyrightable (as is the documentation).