Private
Public Access
2
0

mraa.c: change helper functions to use const char*

Signed-off-by: Michael Ring <mail@michael-ring.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Michael Ring
2015-04-04 18:41:13 +01:00
committed by Brendan Le Foll
parent 4d36d24a70
commit d2fcadc8d5
2 changed files with 6 additions and 6 deletions

View File

@@ -65,7 +65,7 @@ mraa_platform_t mraa_arm_platform();
* @param filename to check * @param filename to check
* @return mraa_boolean_t boolean result. * @return mraa_boolean_t boolean result.
*/ */
mraa_boolean_t mraa_file_exist(char *filename); mraa_boolean_t mraa_file_exist(const char* filename);
/** /**
* helper function to unglob filenames * helper function to unglob filenames
@@ -73,7 +73,7 @@ mraa_boolean_t mraa_file_exist(char *filename);
* @param filename to unglob * @param filename to unglob
* @return char * with the existing filename matching the pattern of input. NULL if there is no match. Caller must free result * @return char * with the existing filename matching the pattern of input. NULL if there is no match. Caller must free result
*/ */
char * mraa_file_unglob(char *filename); char* mraa_file_unglob(const char* filename);
/** /**
* helper function to find out if file that is targeted by a softlink (partially) matches the given name * helper function to find out if file that is targeted by a softlink (partially) matches the given name
@@ -82,7 +82,7 @@ char * mraa_file_unglob(char *filename);
* @param (partial) filename that is matched with the filename of the link-targeted file * @param (partial) filename that is matched with the filename of the link-targeted file
* @return mraa_boolean_t true when targetname (partially) matches * @return mraa_boolean_t true when targetname (partially) matches
*/ */
mraa_boolean_t mraa_link_targets(char *filename,char *targetname); mraa_boolean_t mraa_link_targets(const char* filename, const char* targetname);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@@ -312,7 +312,7 @@ mraa_get_pin_count()
} }
mraa_boolean_t mraa_boolean_t
mraa_file_exist(char* filename) mraa_file_exist(const char* filename)
{ {
glob_t results; glob_t results;
results.gl_pathc = 0; results.gl_pathc = 0;
@@ -334,7 +334,7 @@ mraa_get_pin_name(int pin)
} }
char* char*
mraa_file_unglob(char* filename) mraa_file_unglob(const char* filename)
{ {
glob_t results; glob_t results;
char* res = NULL; char* res = NULL;
@@ -347,7 +347,7 @@ mraa_file_unglob(char* filename)
} }
mraa_boolean_t mraa_boolean_t
mraa_link_targets(char* filename, char* targetname) mraa_link_targets(const char* filename, const char* targetname)
{ {
int size = 100; int size = 100;
int nchars = 0; int nchars = 0;