Thanks for the contribution. Your C isn't so bad.
I have three small quibbles:
- Using raw strcmp() isn't a very good idea -- if one of the strings is not null-terminated, you introduce a subtle bug. Prefer instead strncmp() and strnlen(). This requires defining some reasonable upper limit on window names, of course.
- The two blocks are almost the same, the only difference is the string compare. It would be nice to merge them into one.
- My opinion only, but I don't actually like the behavior. It makes sense to me to skip the current window in the search, but it seems odd to me to have behavior depend on the current numbered ordering of windows. At the very least, to my mind this should be an option that is off by default (i.e., preserves current behavior) or else a new function (select-next).
Out of curiosity, why do you find it convenient to name multiple things with the same name?
Regards,