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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2881 - (show annotations)
Thu Jan 28 02:03:15 2010 UTC (9 years, 6 months ago) by jfenwick
File MIME type: text/plain
File size: 1491 byte(s)
Don't panic.
Updating copyright stamps

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

  ViewVC Help
Powered by ViewVC 1.1.26