Peter Eisentraut <[EMAIL PROTECTED]> writes:
> switch(lower(string[0]) + lower(string[5]))
> {
> case 'f': /* fsync */
> case 'f' + 's': /* fdatasync */
> case 'o' + 's': /* open_sync */
> case 'o' + 'd': /* open_datasync */
> }
> Although ugly, it should serve as a readable solution for now.
Ugly is the word ...
>> Do you object if I add an "assign_hook" to guc.c that's called when an
>> actual assignment is made?
> Something like this is on my wish list, but I'm not sure if it's wise to
> start this now.
I'm not particularly concerned about changing the interface later if
that proves necessary. We're not likely to have so many of the things
that an API change is burdensome, and they will all be strictly backend
internal.
What I have in mind for now is just
void (*assign_hook) (const char *newval);
(obviously this is for string variables only, for now) called just
before actually changing the variable value. This lets the hook see
the old value if it needs to.
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])