Subject: Header independence

Header independence

From: Alexander Lamaison <>
Date: Sun, 22 Mar 2009 14:04:29 +0000

A development best-practice that I've been trying to adhere to
recently is that header files should be independent. In other words,
they shouldn't rely on the source file to include any other headers
that they rely on. If they need anything to be defined in order to be
parsed, they must include it themselves.

While making my own code do this, I discovered that the libssh2_sftp.h
requires definitions from the libssh2.h header but does not include
libssh2.h itself. It relies on source files #including libssh2.h

Can anyone think of any reason not to add #include <libssh2.h> to


Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial.
libssh2-devel mailing list
Received on 2009-03-22