Lines Matching refs:filename
95 char *scan_el_dir, *builtname, *builtname_generic, *filename = 0; in iioutils_get_type() local
125 ret = asprintf(&filename, in iioutils_get_type()
132 sysfsfp = fopen(filename, "r"); in iioutils_get_type()
136 filename); in iioutils_get_type()
169 filename); in iioutils_get_type()
174 free(filename); in iioutils_get_type()
175 filename = 0; in iioutils_get_type()
191 if (filename) in iioutils_get_type()
192 free(filename); in iioutils_get_type()
226 char *filename = NULL; in iioutils_get_param_float() local
250 ret = asprintf(&filename, in iioutils_get_param_float()
257 sysfsfp = fopen(filename, "r"); in iioutils_get_param_float()
270 if (filename) in iioutils_get_param_float()
271 free(filename); in iioutils_get_param_float()
324 char *filename; in build_channel_array() local
340 ret = asprintf(&filename, in build_channel_array()
347 sysfsfp = fopen(filename, "r"); in build_channel_array()
350 free(filename); in build_channel_array()
360 free(filename); in build_channel_array()
368 free(filename); in build_channel_array()
372 free(filename); in build_channel_array()
388 ret = asprintf(&filename, in build_channel_array()
397 sysfsfp = fopen(filename, "r"); in build_channel_array()
400 free(filename); in build_channel_array()
408 free(filename); in build_channel_array()
415 free(filename); in build_channel_array()
421 free(filename); in build_channel_array()
432 free(filename); in build_channel_array()
442 free(filename); in build_channel_array()
448 ret = asprintf(&filename, in build_channel_array()
453 free(filename); in build_channel_array()
458 sysfsfp = fopen(filename, "r"); in build_channel_array()
462 filename); in build_channel_array()
463 free(filename); in build_channel_array()
473 free(filename); in build_channel_array()
479 free(filename); in build_channel_array()
483 free(filename); in build_channel_array()
579 char *filename; in find_type_by_name() local
610 filename = malloc(strlen(iio_dir) + strlen(type) in find_type_by_name()
612 if (!filename) { in find_type_by_name()
617 ret = sprintf(filename, "%s%s%d/name", iio_dir, in find_type_by_name()
620 free(filename); in find_type_by_name()
624 namefp = fopen(filename, "r"); in find_type_by_name()
626 free(filename); in find_type_by_name()
630 free(filename); in find_type_by_name()
663 static int _write_sysfs_int(const char *filename, const char *basedir, int val, in _write_sysfs_int() argument
669 char *temp = malloc(strlen(basedir) + strlen(filename) + 2); in _write_sysfs_int()
674 ret = sprintf(temp, "%s/%s", basedir, filename); in _write_sysfs_int()
722 val, basedir, filename); in _write_sysfs_int()
740 int write_sysfs_int(const char *filename, const char *basedir, int val) in write_sysfs_int() argument
742 return _write_sysfs_int(filename, basedir, val, 0); in write_sysfs_int()
754 int write_sysfs_int_and_verify(const char *filename, const char *basedir, in write_sysfs_int_and_verify() argument
757 return _write_sysfs_int(filename, basedir, val, 1); in write_sysfs_int_and_verify()
760 static int _write_sysfs_string(const char *filename, const char *basedir, in _write_sysfs_string() argument
765 char *temp = malloc(strlen(basedir) + strlen(filename) + 2); in _write_sysfs_string()
772 ret = sprintf(temp, "%s/%s", basedir, filename); in _write_sysfs_string()
821 basedir, filename); in _write_sysfs_string()
840 int write_sysfs_string_and_verify(const char *filename, const char *basedir, in write_sysfs_string_and_verify() argument
843 return _write_sysfs_string(filename, basedir, val, 1); in write_sysfs_string_and_verify()
854 int write_sysfs_string(const char *filename, const char *basedir, in write_sysfs_string() argument
857 return _write_sysfs_string(filename, basedir, val, 0); in write_sysfs_string()
868 int read_sysfs_posint(const char *filename, const char *basedir) in read_sysfs_posint() argument
872 char *temp = malloc(strlen(basedir) + strlen(filename) + 2); in read_sysfs_posint()
879 ret = sprintf(temp, "%s/%s", basedir, filename); in read_sysfs_posint()
915 int read_sysfs_float(const char *filename, const char *basedir, float *val) in read_sysfs_float() argument
919 char *temp = malloc(strlen(basedir) + strlen(filename) + 2); in read_sysfs_float()
926 ret = sprintf(temp, "%s/%s", basedir, filename); in read_sysfs_float()
962 int read_sysfs_string(const char *filename, const char *basedir, char *str) in read_sysfs_string() argument
966 char *temp = malloc(strlen(basedir) + strlen(filename) + 2); in read_sysfs_string()
973 ret = sprintf(temp, "%s/%s", basedir, filename); in read_sysfs_string()