~diresu/blender/blender-command-port

« back to all changes in this revision

Viewing changes to extern/fftw/kernel/debug.c

  • Committer: theeth
  • Date: 2008-10-14 16:52:04 UTC
  • Revision ID: vcs-imports@canonical.com-20081014165204-r32w2gm6s0osvdhn
copy back trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (c) 2003, 2006 Matteo Frigo
 
3
 * Copyright (c) 2003, 2006 Massachusetts Institute of Technology
 
4
 *
 
5
 * This program is free software; you can redistribute it and/or modify
 
6
 * it under the terms of the GNU General Public License as published by
 
7
 * the Free Software Foundation; either version 2 of the License, or
 
8
 * (at your option) any later version.
 
9
 *
 
10
 * This program is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 * GNU General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU General Public License
 
16
 * along with this program; if not, write to the Free Software
 
17
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
18
 *
 
19
 */
 
20
 
 
21
/* $Id: debug.c,v 1.8 2006-01-05 03:04:27 stevenj Exp $ */
 
22
#include "ifftw.h"
 
23
 
 
24
#ifdef FFTW_DEBUG
 
25
#include <stdio.h>
 
26
 
 
27
typedef struct {
 
28
     printer super;
 
29
     FILE *f;
 
30
} P_file;
 
31
 
 
32
static void putchr_file(printer *p_, char c)
 
33
{
 
34
     P_file *p = (P_file *) p_;
 
35
     fputc(c, p->f);
 
36
}
 
37
 
 
38
static printer *mkprinter_file(FILE *f)
 
39
{
 
40
     P_file *p = (P_file *) X(mkprinter)(sizeof(P_file), putchr_file, 0);
 
41
     p->f = f;
 
42
     return &p->super;
 
43
}
 
44
 
 
45
void X(debug)(const char *format, ...)
 
46
{
 
47
     va_list ap;
 
48
     printer *p = mkprinter_file(stderr);
 
49
     va_start(ap, format);
 
50
     p->vprint(p, format, ap);
 
51
     va_end(ap);
 
52
     X(printer_destroy)(p);
 
53
}
 
54
#endif