The alghoritm for parsing identifiers is same - the differences are in a names of levels, and in ending symbols.
I don't would to write totally generic parser - more without access to system catalog or without external hint, you cannot to decide if identifier is schema.table or table.column. But the rules for parsing is exactly same.
The function can be redesigned little bit:
FUNCTION parse_ident(OUT level1 text,OUT level2 text,OUT level3 text,OUT specific text)
so it can parse function myschema.myfunc(xx int)
level1: NULL
level2: myschema
level3: myfunc
specific: (xx int)
Is it acceptable?
Regards
Pavel
Also, for the umpteenst time: Start actually quoting in a sane manner.