remove the sql coode
This commit is contained in:
		
							parent
							
								
									0504491668
								
							
						
					
					
						commit
						e97cd55e28
					
				
							
								
								
									
										34
									
								
								src/db.c
									
									
									
									
									
								
							
							
						
						
									
										34
									
								
								src/db.c
									
									
									
									
									
								
							@ -1,4 +1,5 @@
 | 
			
		||||
/*
 | 
			
		||||
/* Create a database and handel it
 | 
			
		||||
 * Created by Jan on 13.12.2024.
 | 
			
		||||
 * INPUT: query for previous state
 | 
			
		||||
 *        linked list of tasks to store
 | 
			
		||||
 *
 | 
			
		||||
@ -9,12 +10,33 @@
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/************************************************************
 | 
			
		||||
*Create a database and handel it
 | 
			
		||||
*Created by Jan on 13.12.2024.
 | 
			
		||||
*
 | 
			
		||||
************************************************************/
 | 
			
		||||
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include <time.h>
 | 
			
		||||
#include "planner.h"
 | 
			
		||||
#include "list.h"
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
write a complete linkedlist to a csv file.
 | 
			
		||||
 */
 | 
			
		||||
void write_linkedlist_to_csv(llist* head, const char* filename) {
 | 
			
		||||
  //Open file with write permision
 | 
			
		||||
  FILE* file = fopen(filename, "w");
 | 
			
		||||
  //if there is no file or a wrong file path you becom an error
 | 
			
		||||
  if (file == NULL) {
 | 
			
		||||
    printf("Could not open file %s\n", filename);
 | 
			
		||||
  }
 | 
			
		||||
  else{
 | 
			
		||||
    //write the file head
 | 
			
		||||
    //fprintf(file, "**********************");
 | 
			
		||||
 | 
			
		||||
    // iteration through the list and write data to csv
 | 
			
		||||
    llist* current = head;
 | 
			
		||||
    while (current != NULL) {
 | 
			
		||||
         //fprintf(file, "%d \n", current->id );
 | 
			
		||||
          current = current->next;
 | 
			
		||||
    }
 | 
			
		||||
    fclose(file)
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user