0% found this document useful (0 votes)
9 views2 pages

INI File Parsing for Developers

The document includes C header files and function prototypes for parsing configuration and user data sections from an INI file based on the provided filename and key.

Uploaded by

Payal Agrawal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views2 pages

INI File Parsing for Developers

The document includes C header files and function prototypes for parsing configuration and user data sections from an INI file based on the provided filename and key.

Uploaded by

Payal Agrawal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

#include "ds_ini.

h"

#include <assert.h>
#include <ctype.h>
#include <math.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <inttypes.h>
#include <string.h>

#include <iniparser.h>

/**
* @brief Extracts a configuration section from the provided INI file.
*
* All fields are required, incomplete configuration should result in a failure.
* Fields in the ini file that do not map to the output structure are to be
ignored.
*
* @param filename A string input with the path to the INI file to be parsed.
* @param key A string with the key naming the section of the INI file to be
used.
* @param out A pointer used as output on success. If a failure occurs, do not
modify the output argument.
* @return true if parsing succeeded, false on failure.
*/
C_API
bool parse_config(char const* filename, const char* key, struct config* out)
{
return false;
}

/**
* @brief Extracts a user data section from the provided INI file.
*
* All fields are required, incomplete configuration should result in a failure.
* Fields in the ini file that do not map to the output structure are to be
ignored.
*
* @param filename A string input with the path to the INI file to be parsed.
* @param key A string with the key naming the section of the INI file to be
used.
* @param out A pointer used as output on success. If a failure occurs, do not
modify the output argument.
* @return true if parsing succeeded, false on failure.
*/
C_API
bool parse_user_data(char const* filename, const char* key, struct user_data*
out)
{
return false;
}

You might also like