Return Value of Functions

For all functions, return values are used as error codes.
Return value is 0 means normal termination, a value other than 0 means error or warning.
Error content is defined depending on the return value.