The enums make the C code easier to understand, and the compiler is smart enough these days that it will make negligible difference to the code size or speed. You could also check against the enum values in the switch statement to make things clearer.
Is 'hide_osd' a suitable name for the function when calling 'hide_osd(1)' does the exact opposite, and 'hide_osd(-1)' could either show or hide the display. It also does not make it clear that the function only affects the CHDK OSD, not the Canon one. Perhaps 'set_chkd_osd_state' might be better.
My other concern is that the 'magic' integer values as parameters to the functions make the script code harder to follow for new users, or if you've forgotten what the magic numbers mean. Not sure what the best solution for this is - having three separate functions seems overkill.
Thanks for the input. I like: set_chdk_osd( -1| 0 | 1).
This is similar to set_backlight(0 | 1), which everyone is already used to. Adding a -1 input for toggle is very useful in a script, I've discovered. And all the other script functions use "magic numbers" since enum is not visible to scripts. You could use a string input, like "off", "on" or "toggle", but I think that's overkill for just 3 values, and is inconsistent with set_backlight and other functions. If you really hate the -1 option, that can be done in the script with another script variable. I find it useful, so I hope you'll agree to keep it.
Using enum is useful for C variables with 3 or more valid values, but not useful with only 2 values. I was able to handle the screen clearing with only 2 values, so enum isn't needed. A single assignment statement should take a lot less memory than the switch and all the if statements.
So I don't think -1,0, and 1 are too much to remember, especially if we keep it consistent with set_backlight and other functions. I'm working on set_display(-1,0,1) using reyalp's new display off event_proc discovery, so we can add that to the list.
The new code hides the osd when camera_info.state.osd_off is any non zero value. I only used the assignment to conditional form to force the values to 0 or 1. If you eliminate the -1 input, you can just store the parameter to camera_info.state.osd_off.
I agree that I want it to be as simple as possible to understand and use. However everyone else wants to implement it is fine with me.