declare constant function parameters const (as well as constant function return values)
This commit is contained in:
+12
-12
@@ -19,21 +19,21 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
int config_read_file( char *filename );
|
||||
int config_read_file(const char *filename);
|
||||
/* Opens the specified file and reads everything into memory.
|
||||
* Returns -1 on parsing errors.
|
||||
* Returns -2 if the file could not be opened or a read error occured.
|
||||
* Returns -16 if a malloc went wrong.
|
||||
*/
|
||||
|
||||
int config_read_string( char *sectionname, char *str );
|
||||
int config_read_string(const char *sectionname, const char *str);
|
||||
/* Reads everything in the string into memory.
|
||||
* Returns -1 on parsing errors.
|
||||
* Returns -16 if a malloc went wrong.
|
||||
*/
|
||||
|
||||
short config_get_bool( char *sectionname, char *keyname,
|
||||
int skip, short default_value );
|
||||
short config_get_bool(const char *sectionname, const char *keyname,
|
||||
int skip, short default_value);
|
||||
/* Tries to interpret a value in the config file as a boolean.
|
||||
* 0, false, no, n = false
|
||||
* 1, true, yes, y = true
|
||||
@@ -44,16 +44,16 @@ short config_get_bool( char *sectionname, char *keyname,
|
||||
* last.
|
||||
*/
|
||||
|
||||
long int config_get_int( char *sectionname, char *keyname,
|
||||
int skip, long int default_value );
|
||||
long int config_get_int(const char *sectionname, const char *keyname,
|
||||
int skip, long int default_value);
|
||||
/* Tries to interpret a value in the config file as an integer.*/
|
||||
|
||||
double config_get_float( char *sectionname, char *keyname,
|
||||
int skip, double default_value );
|
||||
double config_get_float(const char *sectionname, const char *keyname,
|
||||
int skip, double default_value);
|
||||
/* Tries to interpret a value in the config file as a float.*/
|
||||
|
||||
char *config_get_string( char * sectionname, char * keyname,
|
||||
int skip, char * default_value );
|
||||
const char *config_get_string(const char *sectionname, const char *keyname,
|
||||
int skip, const char *default_value);
|
||||
/* Returns a pointer to the string associated with the specified key.
|
||||
* The string should never be modified, and used only short-term. You can
|
||||
* for example scan it or copy it. In successive calls this function can
|
||||
@@ -80,12 +80,12 @@ char *config_get_string( char * sectionname, char * keyname,
|
||||
*
|
||||
*/
|
||||
|
||||
int config_has_section( char *sectionname );
|
||||
int config_has_section(const char *sectionname);
|
||||
/* Checks if a specified section exists.
|
||||
* Returns whether it exists.
|
||||
*/
|
||||
|
||||
int config_has_key( char *sectionname, char *keyname );
|
||||
int config_has_key(const char *sectionname, const char *keyname);
|
||||
/* Checks if a specified key within the specified section exists.
|
||||
* Returns the number of times the key exists.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user