Variable declarations at top of function,
separate from initialization.
Use == 0 instead of ! for checking pointers.
Consistent spacing around {, *, casts.
Declare 0-parameter functions as (void) not ().
Integer valued functions return -1 on failure, 0 on success.