Define and fill flags on a struct