Added TODOs
This commit is contained in:
parent
61e9ee7047
commit
1e1163b96a
11
src/dodo.c
11
src/dodo.c
@ -69,16 +69,17 @@ void view_heading(){
|
|||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
int print_select_test(sqlite3 *db, sqlite3_stmt* out_stmt, char* colnames, char* table, char* status){
|
sqlite3_stmt *print_select_test(sqlite3 *db, char* colnames, char* table, char* status){
|
||||||
char *sql_query = "SELECT ? FROM ? WHERE status = ?";
|
char *sql_query = "SELECT ? FROM ? WHERE status = ?";
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
|
sqlite3_stmt *out_stmt;
|
||||||
|
|
||||||
rc = sqlite3_prepare_v2(db, sql_query, -1, &out_stmt, NULL);
|
rc = sqlite3_prepare_v2(db, sql_query, -1, &out_stmt, NULL);
|
||||||
rc = sqlite3_bind_text(out_stmt, 1, colnames, -1, SQLITE_STATIC);
|
rc = sqlite3_bind_text(out_stmt, 1, colnames, -1, SQLITE_STATIC);
|
||||||
rc = sqlite3_bind_text(out_stmt, 2, table, -1, SQLITE_STATIC);
|
rc = sqlite3_bind_text(out_stmt, 2, table, -1, SQLITE_STATIC);
|
||||||
rc = sqlite3_bind_text(out_stmt, 3, status, -1, SQLITE_STATIC);
|
rc = sqlite3_bind_text(out_stmt, 3, status, -1, SQLITE_STATIC);
|
||||||
|
|
||||||
return 0;
|
return out_stmt;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get number of tasks from tasks table give status
|
// Get number of tasks from tasks table give status
|
||||||
@ -117,6 +118,8 @@ int get_num_rows(sqlite3 *db, char* table, char* status, char *errmsg){
|
|||||||
|
|
||||||
// Print kanban table
|
// Print kanban table
|
||||||
// All lists with task name and due date
|
// All lists with task name and due date
|
||||||
|
|
||||||
|
// TODO just gotta use snprintf because can't bind column or table names
|
||||||
int view(sqlite3 *db, char *errmsg){
|
int view(sqlite3 *db, char *errmsg){
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
sqlite3_stmt* out_stmt;
|
sqlite3_stmt* out_stmt;
|
||||||
@ -132,9 +135,9 @@ int view(sqlite3 *db, char *errmsg){
|
|||||||
|
|
||||||
|
|
||||||
// Print "today" tasks
|
// Print "today" tasks
|
||||||
print_select_test(db, out_stmt, colnames, table, status);
|
out_stmt = print_select_test(db, colnames, table, status);
|
||||||
while ( rc = sqlite3_step(out_stmt) == SQLITE_ROW ){
|
while ( rc = sqlite3_step(out_stmt) == SQLITE_ROW ){
|
||||||
return sqlite3_column_int(out_stmt, 0);
|
printf("%d\n", sqlite3_column_int(out_stmt, 0));
|
||||||
}
|
}
|
||||||
//*currcol = -1;
|
//*currcol = -1;
|
||||||
//numrows = get_num_rows(db, table, status, errmsg);
|
//numrows = get_num_rows(db, table, status, errmsg);
|
||||||
|
Loading…
Reference in New Issue
Block a user