progress
This commit is contained in:
		
							parent
							
								
									beafc6d418
								
							
						
					
					
						commit
						9198fe9b1f
					
				
							
								
								
									
										28
									
								
								src/main.c
									
									
									
									
									
								
							
							
						
						
									
										28
									
								
								src/main.c
									
									
									
									
									
								
							@ -15,8 +15,10 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 | 
				
			|||||||
#include <stdio.h>
 | 
					#include <stdio.h>
 | 
				
			||||||
#include <string.h>
 | 
					#include <string.h>
 | 
				
			||||||
#include <stdlib.h>
 | 
					#include <stdlib.h>
 | 
				
			||||||
 | 
					#include <stdbool.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define BUF 1024
 | 
					#define BUF 1024
 | 
				
			||||||
 | 
					#define DEBUG true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct datetime_t {
 | 
					struct datetime_t {
 | 
				
			||||||
@ -36,14 +38,36 @@ struct errorLogEntry_t {
 | 
				
			|||||||
    char *connection_id_message;
 | 
					    char *connection_id_message;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void debugmsg(char *msg) {
 | 
				
			||||||
 | 
					    if(DEBUG==true){
 | 
				
			||||||
 | 
					        printf("DEBUG: %s\n", msg);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					int checkparams(int *argc, char *argv[]) {
 | 
				
			||||||
 | 
					    if(*argc <= 1) {
 | 
				
			||||||
 | 
					        printf("Dateipfad anageben! Syntax: ./main <absoluter Dateipfad>\n");
 | 
				
			||||||
 | 
					        exit(-1);
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct errorLogEntry_t parseLogline(char *logLine) {
 | 
					struct errorLogEntry_t parseLogline(char *logLine) {
 | 
				
			||||||
    struct errorLogEntry_t logEntry;
 | 
					    struct errorLogEntry_t logEntry;
 | 
				
			||||||
    return logEntry;
 | 
					    return logEntry;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int main(int argc, char *argv[]) {
 | 
					int main(int argc, char *argv[]) {
 | 
				
			||||||
    printf("START\n");
 | 
					    debugmsg("START OF PROGRAM");
 | 
				
			||||||
 | 
					    int i = 0;
 | 
				
			||||||
 | 
					    while(i<argc){
 | 
				
			||||||
 | 
					        char msg[BUF];
 | 
				
			||||||
 | 
					        sprintf(msg,"Argument %d: %s", i, argv[i]);
 | 
				
			||||||
 | 
					        debugmsg(msg);
 | 
				
			||||||
 | 
					        i++;
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					    checkparams(&argc,  argv);
 | 
				
			||||||
    char *filepath;
 | 
					    char *filepath;
 | 
				
			||||||
    char *fp = fopen(const char *restrict argv[0], const char *restrict r)
 | 
					    debugmsg("END OF PROGRAM");
 | 
				
			||||||
    return 0;
 | 
					    return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user