int -> long for sizes char -> unsigned char for strings
buffer_get_token for getting n bytes till finding a termination char or EOF/error.