cannam@95: cannam@95:
cannam@95:cannam@95: Next: Forgetting Wisdom, cannam@95: Previous: Wisdom Export, cannam@95: Up: Wisdom cannam@95:
int fftw_import_system_wisdom(void); cannam@95: int fftw_import_wisdom_from_filename(const char *filename); cannam@95: int fftw_import_wisdom_from_string(const char *input_string); cannam@95: int fftw_import_wisdom(int (*read_char)(void *), void *data); cannam@95:cannam@95:
cannam@95: These functions import wisdom into a program from data stored by the
cannam@95: fftw_export_wisdom
functions above. (See Words of Wisdom-Saving Plans.) The imported wisdom replaces any wisdom
cannam@95: already accumulated by the running program.
cannam@95:
cannam@95:
fftw_import_wisdom
imports wisdom from any input medium, as
cannam@95: specified by the callback function read_char
. read_char
is
cannam@95: a getc
-like function that returns the next character in the
cannam@95: input; its parameter is the data
pointer passed to
cannam@95: fftw_import_wisdom
. If the end of the input data is reached
cannam@95: (which should never happen for valid data), read_char
should
cannam@95: return EOF
(as defined in <stdio.h>
). For convenience,
cannam@95: the following three “wrapper” routines are provided:
cannam@95:
cannam@95:
fftw_import_wisdom_from_filename
reads wisdom from a file named
cannam@95: filename
. A lower-level function, which requires you to open
cannam@95: and close the file yourself (e.g. if you want to read wisdom from a
cannam@95: portion of a larger file) is fftw_import_wisdom_from_file
. This
cannam@95: reads wisdom from the current position in input_file
(which
cannam@95: should be open with read permission); upon exit, the file remains
cannam@95: open, but the position of the read pointer is unspecified.
cannam@95:
cannam@95:
fftw_import_wisdom_from_string
reads wisdom from the
cannam@95: NULL
-terminated string input_string
.
cannam@95:
cannam@95:
fftw_import_system_wisdom
reads wisdom from an
cannam@95: implementation-defined standard file (/etc/fftw/wisdom
on Unix
cannam@95: and GNU systems).
cannam@95:
cannam@95:
cannam@95:
The return value of these import routines is 1
if the wisdom was
cannam@95: read successfully and 0
otherwise. Note that, in all of these
cannam@95: functions, any data in the input stream past the end of the wisdom data
cannam@95: is simply ignored.
cannam@95:
cannam@95:
cannam@95:
cannam@95: