//This file contains function declaration and implementations for all file related functions like //opening file and parsing from file and fsize() that returns file size #include <stdlib.h> #include <stdio.h> #include <string.h> #define ERR_FILE_NOT_FOUND "The specified file is not found, please recheck the file name and path\n" #define ERR_CODE_FILE_NOT_FOUND 40 #define MAX_USERS_BYTE 251 typedef struct { char id[26]; Time time; }User; int totalLines(FILE* file); int len(char* str); long fsize(FILE* file); char* removeSpaces(char* str,int length); int fileIt(int argc,char** argv); char* loadLine(FILE* file,int n); int countChars(char* str,char c); int totalUsers(FILE* file); User** parseUsers(FILE* file,int n); void parseUserTime(char* line,User** users,int totalUsers); void calcUserTime(FILE* file,User** users); int removeColon(char* str,int len); int len(char* str){ int counter = 0; short ended = 0; while(ended == 0){ if (str[c
Comments
Post a Comment