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