How do I interpret this declaration that appears to be a function declaration, but doesn't fit the usual mould?

Viewed 261

I'm trying to decipher this declaration from sqlite3.c

SQLITE_PRIVATE void (*sqlite3OsDlSym(sqlite3_vfs *, void *, const char *))(void);

It seems like it is declaring a function because subsequently there is this

SQLITE_PRIVATE void (*sqlite3OsDlSym(sqlite3_vfs *pVfs, void *pHdle, const char *zSym))(void){
  return pVfs->xDlSym(pVfs, pHdle, zSym);
}

and then what appear to be calls to the function

xInit = (sqlite3_loadext_entry)sqlite3OsDlSym(pVfs, handle, zEntry);

and

xInit = (sqlite3_loadext_entry)sqlite3OsDlSym(pVfs, handle, zEntry);

But I cannot make sense of the declaration. I've highlighted what I cannot understand

SQLITE_PRIVATE void (*sqlite3OsDlSym(sqlite3_vfs *, void *, const char *))(void);
                    ^                                                    ^^^^^^^

I'm wondering why the declaration is not like so

SQLITE_PRIVATE void *sqlite3OsDlSym(sqlite3_vfs *, void *, const char *);

I expect that there may well be a similar question already asked but searching for terms like (, ) and void doesn't really get anywhere. So, if this is a dupe, I'd be very happy for it to be closed as such.

2 Answers
Related