cannam@95: cannam@95: cannam@95: Wisdom Export - FFTW 3.3.3 cannam@95: cannam@95: cannam@95: cannam@95: cannam@95: cannam@95: cannam@95: cannam@95: cannam@95: cannam@95: cannam@95: cannam@95: cannam@95: cannam@95:
cannam@95: cannam@95:

cannam@95: Next: , cannam@95: Previous: Wisdom, cannam@95: Up: Wisdom cannam@95:


cannam@95:
cannam@95: cannam@95:

4.7.1 Wisdom Export

cannam@95: cannam@95:
     int fftw_export_wisdom_to_filename(const char *filename);
cannam@95:      void fftw_export_wisdom_to_file(FILE *output_file);
cannam@95:      char *fftw_export_wisdom_to_string(void);
cannam@95:      void fftw_export_wisdom(void (*write_char)(char c, void *), void *data);
cannam@95: 
cannam@95:

cannam@95: These functions allow you to export all currently accumulated wisdom cannam@95: in a form from which it can be later imported and restored, even cannam@95: during a separate run of the program. (See Words of Wisdom-Saving Plans.) The current store of wisdom is not affected by calling any cannam@95: of these routines. cannam@95: cannam@95:

fftw_export_wisdom exports the wisdom to any output cannam@95: medium, as specified by the callback function cannam@95: write_char. write_char is a putc-like function that cannam@95: writes the character c to some output; its second parameter is cannam@95: the data pointer passed to fftw_export_wisdom. For cannam@95: convenience, the following three “wrapper” routines are provided: cannam@95: cannam@95:

fftw_export_wisdom_to_filename writes wisdom to a file named cannam@95: filename (which is created or overwritten), returning 1 cannam@95: on success and 0 on failure. A lower-level function, which cannam@95: requires you to open and close the file yourself (e.g. if you want to cannam@95: write wisdom to a portion of a larger file) is cannam@95: fftw_export_wisdom_to_file. This writes the wisdom to the cannam@95: current position in output_file, which should be open with cannam@95: write permission; upon exit, the file remains open and is positioned cannam@95: at the end of the wisdom data. cannam@95: cannam@95:

fftw_export_wisdom_to_string returns a pointer to a cannam@95: NULL-terminated string holding the wisdom data. This string is cannam@95: dynamically allocated, and it is the responsibility of the caller to cannam@95: deallocate it with free when it is no longer needed. cannam@95: cannam@95:

All of these routines export the wisdom in the same format, which we cannam@95: will not document here except to say that it is LISP-like ASCII text cannam@95: that is insensitive to white space. cannam@95: cannam@95: cannam@95: cannam@95: