Correct spelling for messages and comments. Replace occurances of <space(s)>
followed by <tab> with a single <tab>.
This commit is contained in:
+12
-12
@@ -49,8 +49,8 @@ static ConfigSection *find_section(const char *sectionname);
|
|||||||
static ConfigSection *add_section(const char *sectionname);
|
static ConfigSection *add_section(const char *sectionname);
|
||||||
static ConfigKey *find_key(ConfigSection *s, const char *keyname, int skip);
|
static ConfigKey *find_key(ConfigSection *s, const char *keyname, int skip);
|
||||||
static ConfigKey *add_key(ConfigSection *s, const char *keyname, const char *value);
|
static ConfigKey *add_key(ConfigSection *s, const char *keyname, const char *value);
|
||||||
static char get_next_char_f(FILE *f);
|
|
||||||
#if defined(LCDPROC_CONFIG_READ_STRING)
|
#if defined(LCDPROC_CONFIG_READ_STRING)
|
||||||
|
static char get_next_char_f(FILE *f);
|
||||||
static int process_config(ConfigSection **current_section, char(*get_next_char)(), const char *source_descr, FILE *f);
|
static int process_config(ConfigSection **current_section, char(*get_next_char)(), const char *source_descr, FILE *f);
|
||||||
#else
|
#else
|
||||||
static int process_config(ConfigSection **current_section, const char *source_descr, FILE *f);
|
static int process_config(ConfigSection **current_section, const char *source_descr, FILE *f);
|
||||||
@@ -96,7 +96,7 @@ int config_read_string(const char *sectionname, const char *str)
|
|||||||
int pos = 0;
|
int pos = 0;
|
||||||
ConfigSection *s;
|
ConfigSection *s;
|
||||||
|
|
||||||
/* We use a nested fuction to transfer the characters from buffer to parser*/
|
/* We use a nested function to transfer the characters from buffer to parser*/
|
||||||
char get_next_char() {
|
char get_next_char() {
|
||||||
return str[pos++];
|
return str[pos++];
|
||||||
}
|
}
|
||||||
@@ -122,7 +122,7 @@ int config_read_string(const char *sectionname, const char *str)
|
|||||||
* sscanf(s, "%dx%d", &w, &h); // scan format like: 20x4
|
* sscanf(s, "%dx%d", &w, &h); // scan format like: 20x4
|
||||||
* \endcode
|
* \endcode
|
||||||
* ...and check the w and h values...
|
* ...and check the w and h values...
|
||||||
* \li Copy it to a preallocated buffer like \c device[256]:
|
* \li Copy it to a pre-allocated buffer like \c device[256]:
|
||||||
* \code
|
* \code
|
||||||
* s = config_get_string(...);
|
* s = config_get_string(...);
|
||||||
* strncpy(device, s, sizeof(device));
|
* strncpy(device, s, sizeof(device));
|
||||||
@@ -267,7 +267,7 @@ long int config_get_int(const char *sectionname, const char *keyname,
|
|||||||
long int v = strtol(k->value, &end, 0);
|
long int v = strtol(k->value, &end, 0);
|
||||||
|
|
||||||
if ((end != NULL) && (end != k->value) && (*end == '\0'))
|
if ((end != NULL) && (end != k->value) && (*end == '\0'))
|
||||||
/* Conversion succesful */
|
/* Conversion successful */
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
return default_value;
|
return default_value;
|
||||||
@@ -294,7 +294,7 @@ double config_get_float(const char *sectionname, const char *keyname,
|
|||||||
double v = strtod(k->value, &end);
|
double v = strtod(k->value, &end);
|
||||||
|
|
||||||
if ((end != NULL) && (end != k->value) && (*end == '\0'))
|
if ((end != NULL) && (end != k->value) && (*end == '\0'))
|
||||||
/* Conversion succesful*/
|
/* Conversion successful*/
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
return default_value;
|
return default_value;
|
||||||
@@ -312,7 +312,7 @@ int config_has_section(const char *sectionname)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Test whether the configuration contains a specific key in a specfic section.
|
/** Test whether the configuration contains a specific key in a specific section.
|
||||||
* \param sectionname Name of the section where the key is sought.
|
* \param sectionname Name of the section where the key is sought.
|
||||||
* \param keyname Name of the key to look for.
|
* \param keyname Name of the key to look for.
|
||||||
* \retval 0 key or section not found
|
* \retval 0 key or section not found
|
||||||
@@ -361,7 +361,7 @@ void config_clear(void)
|
|||||||
free(s->name);
|
free(s->name);
|
||||||
free(s);
|
free(s);
|
||||||
}
|
}
|
||||||
/* Finally make everything inaccessable */
|
/* Finally make everything inaccessible */
|
||||||
first_section = NULL;
|
first_section = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -560,7 +560,7 @@ static int process_config(ConfigSection **current_section, const char *source_de
|
|||||||
report(RPT_WARNING, "Unterminated section label on line %d of %s: %s",
|
report(RPT_WARNING, "Unterminated section label on line %d of %s: %s",
|
||||||
line_nr, source_descr, sectionname);
|
line_nr, source_descr, sectionname);
|
||||||
error = 1;
|
error = 1;
|
||||||
state = ST_INITIAL; /* alrady at the end, no resync required */
|
state = ST_INITIAL; /* already at the end, no resync required */
|
||||||
break;
|
break;
|
||||||
case ']':
|
case ']':
|
||||||
/* label terminated: find/create section */
|
/* label terminated: find/create section */
|
||||||
@@ -638,7 +638,7 @@ static int process_config(ConfigSection **current_section, const char *source_de
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ST_ASSIGNMENT:
|
case ST_ASSIGNMENT:
|
||||||
/* assignement: "=" */
|
/* assignment: "=" */
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
case '\t':
|
case '\t':
|
||||||
case ' ':
|
case ' ':
|
||||||
@@ -651,7 +651,7 @@ static int process_config(ConfigSection **current_section, const char *source_de
|
|||||||
value_pos = 0;
|
value_pos = 0;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
report(RPT_WARNING, "Assigment expected on line %d of %s: %s",
|
report(RPT_WARNING, "Assignment expected on line %d of %s: %s",
|
||||||
line_nr, source_descr, keyname);
|
line_nr, source_descr, keyname);
|
||||||
error = 1;
|
error = 1;
|
||||||
state = ST_INVALID_ASSIGNMENT;
|
state = ST_INVALID_ASSIGNMENT;
|
||||||
@@ -732,13 +732,13 @@ static int process_config(ConfigSection **current_section, const char *source_de
|
|||||||
escape = 1;
|
escape = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* fall though */
|
/* fall through */
|
||||||
case '"':
|
case '"':
|
||||||
if (!escape) {
|
if (!escape) {
|
||||||
state = ST_VALUE;
|
state = ST_VALUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* fall though */
|
/* fall through */
|
||||||
default:
|
default:
|
||||||
if (escape) {
|
if (escape) {
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
|
|||||||
Reference in New Issue
Block a user