aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md12
1 files changed, 12 insertions, 0 deletions
diff --git a/README.md b/README.md
index 76abf6d..220d1c1 100644
--- a/README.md
+++ b/README.md
@@ -31,18 +31,30 @@ This library provides a set of functions for reading and writing INI files. Here
int main(const int argc, const char **const argv) {
struct Ini_File *ini_file;
+
+ // Check that the user provided an argument specifying the INI file name
if (argc < 2) {
fprintf(stderr, "Usage: %s ini_file_name\n", argv[0]);
return EXIT_FAILURE;
}
+
+ // Parse the INI file and store the resulting data structure in a variable
ini_file = ini_file_parse(argv[1], NULL);
+
+ // Check that the INI file was parsed successfully
if (ini_file == NULL) {
fprintf(stderr, "Was not possible to parse the ini_file \"%s\"\n", argv[1]);
return EXIT_FAILURE;
}
+
+ // Print the properties from the INI file to the console
printf("\nThe properties retrieved from the the ini file \"%s\" are:\n\n", argv[1]);
ini_file_print_to(ini_file, stdout);
+
+ // Free the memory used by the INI file data structure
ini_file_free(ini_file);
+
+ // Return 0 to indicate success
return EXIT_SUCCESS;
}
```