/[escript]/trunk/escript/src/Dodgy.h
ViewVC logotype

Contents of /trunk/escript/src/Dodgy.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4154 - (show annotations)
Tue Jan 22 09:30:23 2013 UTC (6 years, 8 months ago) by jfenwick
File MIME type: text/plain
File size: 1610 byte(s)
Round 1 of copyright fixes
1
2 /*****************************************************************************
3 *
4 * Copyright (c) 2009-2013 by University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Open Software License version 3.0
9 * http://www.opensource.org/licenses/osl-3.0.php
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development since 2012 by School of Earth Sciences
13 *
14 *****************************************************************************/
15
16 #ifndef ES_DODGY_H
17 #define ES_DODGY_H
18
19 // This file contains functions which do bad things like violate the C standard
20 // Functions in here should not go into general use and should only be used on
21 // systems where the users are willing to accept responsibility for things working.
22
23 // Do not add functions here without explaining why they are problematic
24
25 namespace escript
26 {
27 // first param is output, next two are input data1 and2 the 3 ints are the size [in doubles]
28 // of the first three params in order
29 typedef int (*binOpFnPtr)(double*, const double*, const double*, int, int, int);
30
31 /**
32 ** Casts a void* to a function pointer taking 3 double* and 3 int
33 ** \warning The C standard does not guarantee that void* and function pointer
34 ** are the same size.
35 **
36 ** Why do we have this? To allow us to pass function pointers between modules via python.
37 ** To do this without using a custom object we use void*
38 */
39 binOpFnPtr binOpFnPtrFromVoidPtr(void* v);
40
41 /**
42 Why do we have this? Only to act as an inverse to the above function
43 */
44 void* voidPtrFromBinOpFnPtr(binOpFnPtr f);
45
46 }
47
48 #endif

  ViewVC Help
Powered by ViewVC 1.1.26