Re: OFFTOPIC: recursive typedef



I have this function type definition:

typedef void (*NxpElementIterateFunc) (NxpElement *elem,
                                      gpointer func,
                                      gpointer user_data);

but what I would really like is:

typedef void (*NxpElementIterateFunc) (NxpElement *elem,
                                      NxpElementIterateFunc func,
                                      gpointer user_data);

Can it be done in C?
Thanks in advance.

I doubt, at least from my experience.
You can use this:

typedef struct _app_object {
void (*function) (struct _app_object *);
struct _app_object *next, *before; } app_object;

but not this:

typedef struct _app_object {
void (*function) (app_object *);
app_object *next, *before; } app_object;

Carlos




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]