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