aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorClecio Jung2023-03-18 20:43:43 -0300
committerClecio Jung2023-03-18 20:43:43 -0300
commit0113ec2c4358a5a6f4ad473372a63d2aa3c249c0 (patch)
tree18c1faa2ccebd38ca28511597cdbf031fc69e16b /README.md
parenta3942b3241189a003414874a96732e373e63ccae (diff)
downloadlibini-0113ec2c4358a5a6f4ad473372a63d2aa3c249c0.tar.xz
libini-0113ec2c4358a5a6f4ad473372a63d2aa3c249c0.tar.zst
Improve parsing
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;
}
```