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