Misc source file. More...
#include "../include/misc.h"
Go to the source code of this file.
Functions | ||||||||
displayWelcomeMessage | ||||||||
Display welcome message This function displays the welcome message by reading from the file
| ||||||||
void | displayWelcomeMessage (void) | |||||||
displayUserMenu | ||||||||
Display user menu This function displays the user menu.
| ||||||||
void | displayUserMenu (void) | |||||||
displayAdminMenu | ||||||||
Display admin menu This function displays the admin menu.
| ||||||||
void | displayAdminMenu (void) | |||||||
clearInputBuffer | ||||||||
Clear input buffer This function clears the input buffer by reading until a newline character is encountered.
| ||||||||
void | clearInputBuffer (void) | |||||||
checkUsername | ||||||||
Check if username is valid This function checks if a username is valid.
| ||||||||
bool | checkUsername (const char *str) | |||||||
containsPipe | ||||||||
Check if string contains pipe This function checks if a string contains a pipe character.
| ||||||||
bool | containsPipe (const char *str) | |||||||
getPassword | ||||||||
Get password This function gets the password from the user by reading from the standard input.
| ||||||||
void | getPassword (char *password, size_t size) | |||||||
isLeapYear | ||||||||
Check if year is leap year This function checks if a year is a leap year.
| ||||||||
bool | isLeapYear (int year) | |||||||
isValidDate | ||||||||
Check if date is valid This function checks if a date is valid.
| ||||||||
bool | isValidDate (const char *date) | |||||||
formatDate | ||||||||
Format date to yyyy-mm-dd This function formats a date string to the format yyyy-mm-dd.
| ||||||||
void | formatDate (char *date) | |||||||
Misc source file.
This file contains the implementation of the functions for the misc module.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Definition in file misc.c.