Use pointer for struct members in callback function