Lines Matching refs:filename

93 	char *scan_el_dir, *builtname, *builtname_generic, *filename = 0;  in iioutils_get_type()  local
123 ret = asprintf(&filename, in iioutils_get_type()
130 sysfsfp = fopen(filename, "r"); in iioutils_get_type()
134 filename); in iioutils_get_type()
167 filename); in iioutils_get_type()
172 free(filename); in iioutils_get_type()
173 filename = 0; in iioutils_get_type()
189 if (filename) in iioutils_get_type()
190 free(filename); in iioutils_get_type()
224 char *filename = NULL; in iioutils_get_param_float() local
248 ret = asprintf(&filename, in iioutils_get_param_float()
255 sysfsfp = fopen(filename, "r"); in iioutils_get_param_float()
268 if (filename) in iioutils_get_param_float()
269 free(filename); in iioutils_get_param_float()
321 char *filename; in build_channel_array() local
337 ret = asprintf(&filename, in build_channel_array()
344 sysfsfp = fopen(filename, "r"); in build_channel_array()
347 free(filename); in build_channel_array()
357 free(filename); in build_channel_array()
365 free(filename); in build_channel_array()
369 free(filename); in build_channel_array()
385 ret = asprintf(&filename, in build_channel_array()
394 sysfsfp = fopen(filename, "r"); in build_channel_array()
397 free(filename); in build_channel_array()
405 free(filename); in build_channel_array()
412 free(filename); in build_channel_array()
418 free(filename); in build_channel_array()
429 free(filename); in build_channel_array()
439 free(filename); in build_channel_array()
445 ret = asprintf(&filename, in build_channel_array()
450 free(filename); in build_channel_array()
455 sysfsfp = fopen(filename, "r"); in build_channel_array()
459 filename); in build_channel_array()
460 free(filename); in build_channel_array()
470 free(filename); in build_channel_array()
476 free(filename); in build_channel_array()
480 free(filename); in build_channel_array()
571 char *filename; in find_type_by_name() local
602 filename = malloc(strlen(iio_dir) + strlen(type) in find_type_by_name()
604 if (!filename) { in find_type_by_name()
609 ret = sprintf(filename, "%s%s%d/name", iio_dir, in find_type_by_name()
612 free(filename); in find_type_by_name()
616 namefp = fopen(filename, "r"); in find_type_by_name()
618 free(filename); in find_type_by_name()
622 free(filename); in find_type_by_name()
655 static int _write_sysfs_int(const char *filename, const char *basedir, int val, in _write_sysfs_int() argument
661 char *temp = malloc(strlen(basedir) + strlen(filename) + 2); in _write_sysfs_int()
666 ret = sprintf(temp, "%s/%s", basedir, filename); in _write_sysfs_int()
714 val, basedir, filename); in _write_sysfs_int()
732 int write_sysfs_int(const char *filename, const char *basedir, int val) in write_sysfs_int() argument
734 return _write_sysfs_int(filename, basedir, val, 0); in write_sysfs_int()
746 int write_sysfs_int_and_verify(const char *filename, const char *basedir, in write_sysfs_int_and_verify() argument
749 return _write_sysfs_int(filename, basedir, val, 1); in write_sysfs_int_and_verify()
752 static int _write_sysfs_string(const char *filename, const char *basedir, in _write_sysfs_string() argument
757 char *temp = malloc(strlen(basedir) + strlen(filename) + 2); in _write_sysfs_string()
764 ret = sprintf(temp, "%s/%s", basedir, filename); in _write_sysfs_string()
813 basedir, filename); in _write_sysfs_string()
832 int write_sysfs_string_and_verify(const char *filename, const char *basedir, in write_sysfs_string_and_verify() argument
835 return _write_sysfs_string(filename, basedir, val, 1); in write_sysfs_string_and_verify()
846 int write_sysfs_string(const char *filename, const char *basedir, in write_sysfs_string() argument
849 return _write_sysfs_string(filename, basedir, val, 0); in write_sysfs_string()
860 int read_sysfs_posint(const char *filename, const char *basedir) in read_sysfs_posint() argument
864 char *temp = malloc(strlen(basedir) + strlen(filename) + 2); in read_sysfs_posint()
871 ret = sprintf(temp, "%s/%s", basedir, filename); in read_sysfs_posint()
907 int read_sysfs_float(const char *filename, const char *basedir, float *val) in read_sysfs_float() argument
911 char *temp = malloc(strlen(basedir) + strlen(filename) + 2); in read_sysfs_float()
918 ret = sprintf(temp, "%s/%s", basedir, filename); in read_sysfs_float()
954 int read_sysfs_string(const char *filename, const char *basedir, char *str) in read_sysfs_string() argument
958 char *temp = malloc(strlen(basedir) + strlen(filename) + 2); in read_sysfs_string()
965 ret = sprintf(temp, "%s/%s", basedir, filename); in read_sysfs_string()