As shown from the SQLite site, sqlite3_exec calls callback at every record returned for some action:
int sqlite3_exec(
sqlite3*, /* An open database */
const char *sql, /* SQL to be evaluated */
int (*callback)(void*,int,char**,char**), /* Callback function */
void *, /* 1st argument to callback */
char **errmsg /* Error msg written here */
);
Is it possible to invoke another self defined function to do a different set of actions on every record instead of editing the callback function?
For example, sqlite3_exec(db, sql, display, 0, &zErrMsg);, where display is a function to display all records in the terminal.
EDIT: I thought about overloading the function, but I don't think C supports overloading.
..., operator). However, have you considered using the callback function to simply call another function that would, as you suggest, display all records in the terminal?