annotate Lib/fftw-3.2.1/api/.svn/text-base/import-system-wisdom.c.svn-base @ 9:262e084a15a9

Vectorised everything and made use of unique_ptr so there should be no more memory leaks. Hurrah for RAII
author Geogaddi\David <d.m.ronan@qmul.ac.uk>
date Wed, 12 Aug 2015 22:25:06 +0100
parents 25bf17994ef1
children
rev   line source
d@0 1 /*
d@0 2 * Copyright (c) 2003, 2007-8 Matteo Frigo
d@0 3 * Copyright (c) 2003, 2007-8 Massachusetts Institute of Technology
d@0 4 *
d@0 5 * This program is free software; you can redistribute it and/or modify
d@0 6 * it under the terms of the GNU General Public License as published by
d@0 7 * the Free Software Foundation; either version 2 of the License, or
d@0 8 * (at your option) any later version.
d@0 9 *
d@0 10 * This program is distributed in the hope that it will be useful,
d@0 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
d@0 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d@0 13 * GNU General Public License for more details.
d@0 14 *
d@0 15 * You should have received a copy of the GNU General Public License
d@0 16 * along with this program; if not, write to the Free Software
d@0 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
d@0 18 *
d@0 19 */
d@0 20
d@0 21 #include "api.h"
d@0 22
d@0 23 #if defined(FFTW_SINGLE)
d@0 24 # define WISDOM_NAME "wisdomf"
d@0 25 #elif defined(FFTW_LDOUBLE)
d@0 26 # define WISDOM_NAME "wisdoml"
d@0 27 #else
d@0 28 # define WISDOM_NAME "wisdom"
d@0 29 #endif
d@0 30
d@0 31 /* OS-specific configuration-file directory */
d@0 32 #if defined(__DJGPP__)
d@0 33 # define WISDOM_DIR "/dev/env/DJDIR/etc/fftw/"
d@0 34 #else
d@0 35 # define WISDOM_DIR "/etc/fftw/"
d@0 36 #endif
d@0 37
d@0 38 int X(import_system_wisdom)(void)
d@0 39 {
d@0 40 #if defined(__WIN32__) || defined(WIN32) || defined(_WINDOWS)
d@0 41 return 0; /* TODO? */
d@0 42 #else
d@0 43
d@0 44 FILE *f;
d@0 45 f = fopen(WISDOM_DIR WISDOM_NAME, "r");
d@0 46 if (f) {
d@0 47 int ret = X(import_wisdom_from_file)(f);
d@0 48 fclose(f);
d@0 49 return ret;
d@0 50 } else
d@0 51 return 0;
d@0 52 #endif
d@0 53 }