Mercurial > code
changeset 105:eac1f370910a
English review (thanks afranke@)
author | David Demelier <markand@malikania.fr> |
---|---|
date | Tue, 24 Jan 2012 16:26:25 +0100 |
parents | c66fb578a7c4 |
children | 06c968b92090 |
files | ini.c ini.h |
diffstat | 2 files changed, 27 insertions(+), 27 deletions(-) [+] |
line wrap: on
line diff
--- a/ini.c Tue Jan 17 13:51:33 2012 +0100 +++ b/ini.c Tue Jan 24 16:26:25 2012 +0100 @@ -28,12 +28,12 @@ static char ini_error[1024 + 1]; /* -------------------------------------------------------- - * prototypes + * Prototypes * -------------------------------------------------------- */ static void *ini_read(INI_Config *, FILE *); static int ini_getline(INI_Config *, FILE *); -static void *ini_readline(INI_Config *); +static INI_Config *ini_readline(INI_Config *); static int ini_switch(INI_Config *, char **); static int ini_register(INI_Config *, char **); static void *ini_fatal(INI_Config *, FILE *, const char *, ...); @@ -50,7 +50,7 @@ fprintf(stderr, fmt, __VA_ARGS__) /* -------------------------------------------------------- - * public functions + * Public functions * -------------------------------------------------------- */ INI_Config * @@ -79,7 +79,7 @@ /* * Search the section `sectname' in the config structure. If the section - * is not found, this functions returns NULL. + * is not found, this function returns NULL. */ INI_Section * @@ -96,7 +96,7 @@ /* * Search the option `optname' in the section structure, argument - * section musn't be NULL. If the option is not found, this function + * section mustn't be NULL. If the option is not found, this function * returns NULL. */ @@ -113,7 +113,7 @@ } /* - * Find an option from the config, by section name and option name. + * Find an option from the config, by section and option names. * Returns the option or NULL if not found. */ @@ -129,7 +129,7 @@ } /* - * Return the last error or "No error" if there is not error at all. + * Return the last error or "No error" if there is no error. */ char * @@ -170,9 +170,9 @@ } /* - * These section provide very small API to convert value + * This section provides a very small API to convert values * and store them to the dst pointer. Because you can also - * use your own handlers, the user data here can't be used. + * use your own handlers, the user data here is unused. */ void @@ -245,12 +245,12 @@ } /* -------------------------------------------------------- - * private functions + * Private functions * -------------------------------------------------------- */ /* * Read file line per line and try to parse ini like file. Lines - * starting with # or empty line are ignored. Returns the file + * starting with '#', ';' or empty lines are ignored. Returns the file * on success and NULL on failure. */ @@ -312,12 +312,12 @@ } /* - * Read the next line that have been successfully read. Returns NULL - * on allocation failure (instanciation of new section or option) - * or the file on success. + * Parse the line that has been successfully read from the file. + * Returns NULL on allocation failure (instanciation of new + * section or option) or the file on success. */ -static void * +static INI_Config * ini_readline(INI_Config *conf) { char *lp; @@ -367,7 +367,7 @@ /* * Parse the new section (function called when '[' is found). Returns - * 0 or parse error (to avoid ini_readling from stopping) or -1 on + * 0 even on parse error (to avoid ini_readline from stopping) or -1 on * allocation failure. */ @@ -383,7 +383,7 @@ return (conf->_ignore = 1) - 2; /* single line rocks */ } - /* Redefinition of previous and not allowed? */ + /* Redefinition of previous section and not allowed? */ ++(*lp); if (conf->_current != NULL && I_NOREDEFINE(conf) @@ -419,8 +419,8 @@ } /* - * Store the new option that have been parsed. Returns 0 on success or - * on parse error (to avoid ini_readline from stopping) and -1 on + * Store the new option that has been parsed. Returns 0 on success + * even on parse error (to avoid ini_readline from stopping) and -1 on * allocation failure. */ @@ -546,7 +546,7 @@ INI_Option *res; /* - * Value may be NULL but not option's key. + * Value may be NULL but the option key may not. */ if (option->key == NULL) { if (option->value != NULL)
--- a/ini.h Tue Jan 17 13:51:33 2012 +0100 +++ b/ini.h Tue Jan 24 16:26:25 2012 +0100 @@ -31,7 +31,7 @@ typedef void (*INI_ConvertFunc)(void *, const char *, void *); /* -------------------------------------------------------- - * structure definitions + * Structure definitions * -------------------------------------------------------- */ struct ini_config { @@ -45,7 +45,7 @@ /* Private fields */ INI_Section *_current; /* current working section */ char *_line; /* line buffer */ - int _lineno; /* number of line */ + int _lineno; /* number of current line */ int _linesize; /* initial line size */ int _ignore; /* must ignore (no redefine) */ }; @@ -72,7 +72,7 @@ }; /* -------------------------------------------------------- - * INI_Config functions. + * Main functions * -------------------------------------------------------- */ INI_Config * @@ -94,11 +94,11 @@ ini_free(INI_Config *, int, int); /* -------------------------------------------------------- - * convenient api to query and convert data + * Convenient api to query and convert data * -------------------------------------------------------- */ /* - * For the config, read all available value and store them in + * For the config, read all available values and store them in * the array ini_handler. */ @@ -115,7 +115,7 @@ ini_convert_bool(void *, const char *, void *); /* - * Convert to a int. dst must be (int *). + * Convert to an int. dst must be (int *). */ void @@ -130,7 +130,7 @@ /* * Convert to a char *. dst must be (char **). This - * function use strdup() you need to free the dst + * function uses strdup(). You need to free the dst * pointer. */