I know the purpose of typedef is to assign alternative names to existing types
Exactly. Functions have types, and this assigns the name Tcl_DriverOutputProc
to this function type. The function type itself is written like a function with the name missing:
int(ClientData, const char *, int, int *)
and, as with a function declaration, you can include names for the parameters, or leave them out, as you choose.
How this can be used?
You can use pointers to functions in order to specify behaviour at run-time; for example:
typedef void function();
void hello() {printf("Hello\n");}
void goodbye() {printf("Goodbye\n");}
int main() {
function * pf = hello;
pf(); // prints "Hello"
pf = goodbye;
pg(); // prints "Goodbye"
}
In this case, it allows you to write a function to handle some aspect of TCL output, and tell TCL to use that function.