decoration decoration
Stories

GROKLAW
When you want to know more...
decoration
For layout only
Home
Archives
Site Map
Search
About Groklaw
Awards
Legal Research
Timelines
ApplevSamsung
ApplevSamsung p.2
ArchiveExplorer
Autozone
Bilski
Cases
Cast: Lawyers
Comes v. MS
Contracts/Documents
Courts
DRM
Gordon v MS
GPL
Grokdoc
HTML How To
IPI v RH
IV v. Google
Legal Docs
Lodsys
MS Litigations
MSvB&N
News Picks
Novell v. MS
Novell-MS Deal
ODF/OOXML
OOXML Appeals
OraclevGoogle
Patents
ProjectMonterey
Psystar
Quote Database
Red Hat v SCO
Salus Book
SCEA v Hotz
SCO Appeals
SCO Bankruptcy
SCO Financials
SCO Overview
SCO v IBM
SCO v Novell
SCO:Soup2Nuts
SCOsource
Sean Daly
Software Patents
Switch to Linux
Transcripts
Unix Books

Gear

Groklaw Gear

Click here to send an email to the editor of this weblog.


You won't find me on Facebook


Donate

Donate Paypal


No Legal Advice

The information on Groklaw is not intended to constitute legal advice. While Mark is a lawyer and he has asked other lawyers and law students to contribute articles, all of these articles are offered to help educate, not to provide specific legal advice. They are not your lawyers.

Here's Groklaw's comments policy.


What's New

STORIES
No new stories

COMMENTS last 48 hrs
No new comments


Sponsors

Hosting:
hosted by ibiblio

On servers donated to ibiblio by AMD.

Webmaster
What are "hidden" APIs? | 687 comments | Create New Account
Comments belong to whoever posts them. Please notify us of inappropriate comments.
Meant to be in off-topic...
Authored by: Anonymous on Friday, April 27 2012 @ 01:39 PM EDT
Pardon

[ Reply to This | Parent | # ]

What are "hidden" APIs?
Authored by: Anonymous on Friday, April 27 2012 @ 09:09 PM EDT
A hidden API can not exist if you have the source code publicly available.


The terms "Public" and "Private" in C++ and Java are only
design contracts telling the compiler that source code outside this class
(typically outside the file) can only interact with functions (methods) and
variables (fields) that are marked "Public".

The API is full of publicly known data that is marked "private" It's
no secret how the code will work, or that those functions and variables exist,
just that you can't access them from an external class.

"Protected" is also used. This means Only this class and any of it's
child classes (subclasses) that inherit from the class can access the field or
method. We know it's there, but if we're not a direct decedent then the
compiler won't let us use it. We can easily gain access to anything that's
protected by saying "I inherit form that thing over there wot has the
protected stuff" It's a bit difficult to gain access to the private bits,
you have to edit the source code of the private method / class.

You're free to modify the Java API and implementation, but the programs you
create won't run on someone else's version of the Java VM.

A Hidden API is really just an Undocumented API. It's a set of functions and
variables that do exist, but are unpublicized -- Windows has a lot of
Undocumented API. The hidden part is that it's the documentation that's hidden
-- If you figure out the function's location and it's signature, you can make
use the hidden API.

In C/C++ To make a hidden API, simply don't publish the header file. In Java?
There are no header files -- The header file information is mixed in with the
source code. The Javadoc tool extracts this data. Oracle is essentially suing
over Header Files (ring any SCO bells?).

In Java the compiled .class files contain all the function names, you can't hide
much because a decompiler directly reveals "Look! Functions that aren't in
the Docs"

Now, in C++, all of your class's "private" functions and variables
must be listed in the class's declaration -- In the header file, along with all
the "public" functions and variables.

"Public" / "Private" is really just an advisory. In C++ you
can totally ignore the advisory by using two lines of code before you #include
the API / header files:

#define protected public
#define private public

Now the compiler will replace all occurrences of "protected" or
"private" with "public" and you can ignore any such
artificial restrictions.

In C++ if you remove the header files, then the code can't compile. In Java the
header file data is within the source code, so it's a part of the implementation
files. The Javadoc tool extracts the ideas about how the implementation works
-- That's the API. The "how to use this"

In short: A hidden API is one that exists that someone hasn't disclosed the
documentation for. If you can figure out how it works, you can still use it.

To note: When Sun licensed Java under the GPLv2, they agreed to license the
source code as well as its API (Application Programmer's INTERFACE):

"The source code for a work means the preferred form of the work for making
modifications to it. For an executable work, complete source code means all the
source code for all modules it contains, plus ANY ASSOCIATED INTERFACE
DEFINITION FILES, plus the scripts used to control compilation and installation
of the executable."
-GNU GPL

Caps emphasis mine... That Application Programmer's Interface (API) is an
associated file that defines the interface.

This whole case should be thrown out. The patent claims are the only thing that
should be considered. I mean, unless SCO should have won, and Linus is wrong
about header files, and Linux is infringing on Unix.

[ Reply to This | Parent | # ]

Groklaw © Copyright 2003-2013 Pamela Jones.
All trademarks and copyrights on this page are owned by their respective owners.
Comments are owned by the individual posters.

PJ's articles are licensed under a Creative Commons License. ( Details )