Skip to content

Commit

Permalink
Added a little style to variables, added comments 😄
Browse files Browse the repository at this point in the history
  • Loading branch information
adiultra committed Jun 5, 2016
1 parent 5c6da81 commit aa079ea
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ char filename[20] = "data.tdx";

// Fxns Used

void initiate();
int parse(char []);
void status();
void openL(int);
void displayL();
int confirm();
void empty();
void finish();
void initiate(); // Initiate the data before user inteface
int parse(char []); // run the command entered by the users
void status(); // display status of opened list
void openL(int); // open the list specified by index
void displayL(); // display all the lists
int confirm(); // ask for confirmation (y/n)
void empty(); // remove data from the program & data-file
void finish(); // save the data to the data-file

void initiate() {
// Fxn to read data from external file int the array of Lists
Expand All @@ -72,7 +72,7 @@ int parse(char command[80]){
/// to give zero. Mathematically it is quite accurate and syntactically
/// beautiful.

int success = 0;
int success = 0; // to mark wether a command completed successfully

if (!(strcmp(command, "new") * strcmp(command, "n"))) {
// Create a new List
Expand Down Expand Up @@ -209,11 +209,11 @@ int parse(char command[80]){

else if (!(strcmp(command, "search") * strcmp(command, "grep"))) {
// Search the Database
char term[40];
char searchTerm[40];

cout << "Enter the search term " << endl << green << " +> " << normal;
cin.getline(term, sizeof(term));
search(term, arrayL);
cin.getline(searchTerm, sizeof(searchTerm));
search(searchTerm, arrayL);
success = 1;
}

Expand Down Expand Up @@ -354,7 +354,7 @@ int parse(char command[80]){

else if (!(strcmp(command, "clear") * strcmp(command, "clr"))) {
// Refresh the data file
// XXX WARN XXX -> Strictly, Not to be used By users Deletes all Data
// XXX WARN XXX -> Strictly, Not to be used By users, Deletes all Data

if ( confirm() ) {
ofstream file(filename, ios::trunc|ios::binary|ios::out);
Expand Down Expand Up @@ -477,7 +477,7 @@ int main() {
if(result > 0){
continue;
}

else if (result == 0) {
cout << "Command not found, try `help` for help" << endl;
}
Expand All @@ -488,7 +488,7 @@ int main() {
}

else {
cout << "Something went terribly wrong, we are sorry for it. :(" << endl;
cout << "Something went terribly wrong, we apologize :(" << endl;
}
}

Expand Down

0 comments on commit aa079ea

Please sign in to comment.