#ifndef ARGS_H #define ARGS_H #include /** @brief Record that stores the value of parsed command line arguments @details A structure (record) resembles a class in object-oriented paradigm */ typedef struct { /// true if given arguments by user are valid bool is_valid; /// true if `--help` was asked bool help_asked; /// true if `--version` was asked bool version_asked; /// true if simulation mode was asked with `-n` argument bool simulation; /// Point to the target extension wanted by user char* target_extension; } arguments_t; /** @brief Initializes a @a arguments_t record @details This procedure resembles the constructor in object-oriented paradigm @param arguments Pointer to the record to be initialized or reseted */ void init_arguments(arguments_t* arguments); /** @brief Parses all command-line arguments and returns a record with the results. @details This function traverses all given command line arguments by user. Each time a valid argument is identified, its respective field in the record @a arguments_t is set. A copy of the record is returned. @param argc Count of arguments. It must be the same from main(argc, argv) @param argv Argument vector. It must be the same from main(argc, argv) @return A copy of the structure that contains the analyzed information */ arguments_t analyze_arguments(int argc, char* argv[]); #endif // ARGS_H