Structure, stability, and stress properties of amorphous and nanostructured carbon films