Skip to content

Instantly share code, notes, and snippets.

@aragaer
Created July 9, 2012 14:57
Show Gist options
  • Select an option

  • Save aragaer/3077016 to your computer and use it in GitHub Desktop.

Select an option

Save aragaer/3077016 to your computer and use it in GitHub Desktop.
do {
rc = sqlite3_step(stm);
switch (rc) {
case SQLITE_ROW:
data.iface = sqlite3_column_text(stm, 0);
cnt->incoming_bytes = sqlite3_column_int64(stm, 1);
cnt->outgoing_bytes = sqlite3_column_int64(stm, 2);
if (info_cb(&data, user_data) == PCL_CANCEL)
rc = SQLITE_DONE; /* emulate end of data */
break;
case SQLITE_DONE:
break;
case SQLITE_ERROR:
default:
result = PCL_ERROR_DB_FAILED;
break;
}
} while (rc == SQLITE_ROW);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment