5

This is an attempt to break down: Does a host application's license apply to plug-ins written for it? into the underlying questions.

Assume the following scenario:

  • Two programs 'communicate' via a text file
  • One of the programs is GPL (no exemptions)
  • The format of the file's contents are defined by the GPL program
  • The existence of the file is the only form of linkage between the two.

It is actually irrelevant but, for simplicity, assume the GPL program reads the file.

Also assume that the document describing the format of the file's contents is published under the same license as the rest of the project (i.e. GPL)

Does the format of the file's contents constitute an API?

(Also see my follow on question: Does sharing a file format make two programs either a combined or derived work?)

  • 1
    How is the file format published? In a copyrighted document? Or are there just a lot of examples lying about? – bmargulies Jul 17 '15 at 20:57
  • A README style file in the project root, for example – kdopen Jul 17 '15 at 21:34
  • The answer would be "yes" or "no", depending on how you choose to define an API. I have problems understanding what you're asking. – Free Radical Jul 18 '15 at 2:56
  • I tried giving a hypothetical elsewhere and we seemed to go off on a tangent so I'm trying to keep this very specific. I was told in chat that it is and API but I want some other answers – kdopen Jul 18 '15 at 3:25
  • 1
    The GPL license itself goes into some depth explaining how it handles this exact scenario. If a question is discussed within a major OSI license then I'd argue that topic is absolutely on-topic for this website. – Abhi Beckert Jul 18 '15 at 9:06
2

To begin I cite the Wikipedia about the definition of API:

In computer programming, an application programming interface (API) is a set of routines, protocols, and tools for building software applications. An API expresses a software component in terms of its operations, inputs, outputs, and underlying types.

So, the if file format describes how operations are executed and/or transfers data, it is part of an API. To make the API complete you still need a mechanism to exchange the files.

One common example that practically fits your description are common web-APIs. A file (usually XML or JSON) is sent to the webservice in form of a POST-REQUEST and the result is sent back by HTTP status codes and another file as response. This more or less fits your description given in the question (with one exception I go into soon) and it is an API.

The one thing in your question that isn't fitting is:

The existence of the file is the only form of linkage between the two.

An API always needs a defined way to exchange the file. In the webservice-example it is the HTTP-connection. But it may also be as simple, as writing the file into a predefined directory that the other program monitors. Either way, without the definition of the communication-mechanism the file-format alone can be never enough, but the communication can be extremely simple (and therefore many people forget about it).

As you mention in your question that one of the programs is a GPL-licensed program, I assume your question targets in the direction of the usage of such an file-API makes the other program a derivate and therefore it has to be licensed under GPL too, This makes also sense, because without it, the question has no connection to open-source.

So to answer the implicit question: No, the simple usage of an API isn't creating a derivate and therefore triggering the GPL. The GPL is talking about linking the software, not about using an API. If linking is enough to create a derivate work is discussed, and not everyone shares the point of view of the FSF. But even the FSF stops at linking and I know of no one, who interprets the formation of a derivate even more inclusive than the FSF.

The FSF addresses this distinction in their FAQ:

If the modules are included in the same executable file, they are definitely combined in one program. If modules are designed to run linked together in a shared address space, that almost surely means combining them into one program.

By contrast, pipes, sockets and command-line arguments are communication mechanisms normally used between two separate programs. So when they are used for communication, the modules normally are separate programs. But if the semantics of the communication are intimate enough, exchanging complex internal data structures, that too could be a basis to consider the two parts as combined into a larger program.

As you can see, transferring files via Sockets or Pipes (including STDOUT and STDIN), does not qualify as combination into a larger program. The file could be also exchanged via a command-line parameter pointing to the position the file is saved. That is even more indirectly.

The FAQ has some consideration into 'complex internal data structures', so that could be an argument that both programs are combined. For a file with a defined content (needed for it being an API), we can argue against it being 'internal'. It's pretty obvious for text-files, that you defined in the question, internal data-structures (and that includes strings) have to be converted to fit into text-files. Strings have a length-integer at the beginning (seldom in use today) or are ended by a null-byte (more common). In a test-file strings are separated by a defined separator, commonly a line-break. That alone makes the data no longer internal.

But even for a binary file some sort of conversion is needed. Different compilers can lead to different memory-layout of data-structures: little vs. big-endian for multi-byte datatypes, direction for arrays, padding bytes included by the compiler, length of integers. If the file is part of an API all this has to be defined, meaning on a different platform with different compilers a conversion from the internal data-structure is needed.

  • 1
    On a related note... Linus Torvalds and some expert lawyers believes that you can dynamic link against GPL code without your code needing to be GPL licensed. Just because GPL license text tries to force you to do something doesn't mean you're actually required to do it - there are limits to what a license can actually enforce. This hasn't ever been tested in court but it's clear that this part of the license is at least questionable. – Abhi Beckert Jul 18 '15 at 9:09
  • @AbhiBeckert: Yes, that is an interesting discussion and I linked the question that is about it. But in this case i even think that according to FSF interpretation such an API formed by a transfer of a text-file doesn't create a derivate. Completely independent on how we think about linking. – Mnementh Jul 18 '15 at 9:12
  • I'm trying to help define the exact point where you cross the line from a derivative work to a non-derivative work. Once you do that, it's very clear that there is no derivative in this case. PS: I edited my comment above to word it more clearly. – Abhi Beckert Jul 18 '15 at 9:15
  • Yes, if even linking is not forming a derivative, than exchanging a defined file should be not forming one too. – Mnementh Jul 18 '15 at 9:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.