736cb565d0e885a638f972f53a05362b66bfba6d
[jabaws.git] / binaries / src / ViennaRNA / RNAforester / g2-0.70 / src / g2_util.h
1 /*****************************************************************************
2 **  Copyright (C) 1998-2001  Ljubomir Milanovic & Horst Wagner
3 **  This file is part of the g2 library
4 **
5 **  This library is free software; you can redistribute it and/or
6 **  modify it under the terms of the GNU Lesser General Public
7 **  License as published by the Free Software Foundation; either
8 **  version 2.1 of the License, or (at your option) any later version.
9 **
10 **  This library 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 GNU
13 **  Lesser General Public License for more details.
14 **
15 **  You should have received a copy of the GNU Lesser General Public
16 **  License along with this library; if not, write to the Free Software
17 **  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18 ******************************************************************************/
19 #ifndef _G2_UTIL_H
20 #define _G2_UTIL_H
21
22 #include <stdlib.h>
23 #include "g2_physical_device.h"
24
25 int  dtoi(double x);
26
27 void g2_uc2pdc_int(g2_physical_device *pd, double x, double y,
28                    int *ix, int *iy);
29 void g2_uc2pdc_double(g2_physical_device *pd, double x, double y,
30                       double *dx, double *dy);
31 void g2_us2pds_int(g2_physical_device *pd, double x, double y,
32                    int *ix, int *iy);
33 void g2_us2pds_double(g2_physical_device *pd, double x, double y,
34                       double *dx, double *dy);
35 void g2_pdc2uc(g2_physical_device *pd, double ix, double iy,
36                    double *x, double *y);
37 void g2_sort2_i(int *a, int *b);
38 void g2_sort2_d(double *a, double *b);
39 void *g2_malloc(size_t size);
40 void *g2_realloc(void *p, size_t size);
41 void g2_free(void *p);
42
43 double *g2_floatp2doublep(float *f, int N);
44
45 enum g2_log_level {Error=1, Warning, Verbose, Debug};
46 void g2_log(enum g2_log_level log_level, const char *format, ...);
47
48 #endif /* _G2_UTIL_H */