Insert a new layer in the stack given by stack_index. The new layer is added below the one specified by layer_index. The layer is generated using the information given in layer_definition.
Returns 0 if no problem is found. Otherwise a value <> 0 is returned.