# How do I create a function pointer typedef using SymbolicC

I am just getting started with the SymbolicC package, and am trying to figure out how to handle function pointer typedefs, like, say:

typedef double (*rhs)(double, double);


The problem is that the CTypedef function expects its arguments to be CTypedef[type, var], which isn't really how function pointer declarationss in C work. An ordinary pointer typedef is done using CDereference, as:

CTypedef["double", CDereference["xp"]]


I'm not sure how to make that work in the context of CFunction.

I feel slightly foolish for posting this, because I figured it our almost immediately after posting my question, but the answer is to follow C's philosophy that type declaration should mimic use. CFunction is used only for function declaration and definition; for function types, you use CCall:
CTypedef["double", CCall[CDereference[rhs], {"double", "double"}]]

ToCCodeString turns this into:
typedef double *rhs(double, double);