Andreas Grünbacher wrote:
Well, try_file() passes the flags on to open() for gen_tempfile's GT_FILE mode.
Ah, sorry, I missed that.
For some uses (like mine), a create mode parameter wouldn't hurt, either.
Then I suggest just passing a generic (void const *) argument to the TRY function. That way, each function can pass whatever extra info it likes, by packaging data up in a struct and passing the struct's address to __gen_tempname. __gen_tempname's existing FLAGS argument would be one of the things packaged up.