File: XdmfUtils.i

package info (click to toggle)
xdmf 3.0%2Bgit20160803-3
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 35,388 kB
  • ctags: 36,627
  • sloc: ansic: 265,382; cpp: 162,889; python: 10,976; f90: 1,378; yacc: 687; fortran: 464; xml: 200; java: 187; lex: 125; makefile: 82; sh: 28
file content (71 lines) | stat: -rw-r--r-- 1,506 bytes parent folder | download | duplicates (18)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
  To create C++ files:
ICE_INCLUDES="-I${Xdmf_SOURCE_DIR} -I${Xdmf_SOURCE_DIR}/libsrc -I${Xdmf_BINARY_DIR}/libsrc -I${Xdmf_BINARY_DIR}/Ice/libsrc"

XdmfUtilsTcl.cxx:
swig -v -c++ -make_default -includeall -tcl ${ICE_INCLUDES} -o XdmfUtilsTcl.cxx XdmfUtils.i

XdmfUtilsPython.cxx:
swig -v -c++ -make_default -includeall -python ${ICE_INCLUDES} -o XdmfUtilsPython.cxx XdmfUtils.i

XdmfUtilsJava.cxx:
swig -v -c++ -make_default -includeall -java ${ICE_INCLUDES} -o XdmfUtilsJava.cxx XdmfUtils.i
*/

%module XdmfUtils
%{

#include <XdmfDiff.h>
#include <XdmfExodusReader.h>
#include <XdmfExodusWriter.h>
#include <XdmfPartitioner.h>
#include <Xdmf.h>

#ifndef HAVE_STRTOLL
# define strtoll XDMF_strtoll
inline XDMF_LONG64 XDMF_strtoll(char *str, void*, int)
{
  XDMF_LONG64 result = 0;
  int negative=0;

  while (*str == ' ' || *str == '\t')
    {
    str++;
    }
  if (*str == '+')
    {
    str++;
    }
  else if (*str == '-')
    {
    negative = 1;
    str++;
    }

  while (*str >= '0' && *str <= '9')
    {
    result = (result*10)-(*str++ - '0');
    }
  return negative ? result : -result;
}
#else
# define XDMF_strtoll strtoll
#endif

%}

%import Xdmf.i // import typedefs etc. from xdmf lib --- this should keep us from regenerating the same code
%include std_string.i
%include XdmfDiff.h
%include XdmfExodusReader.h
%include XdmfExodusWriter.h
%include XdmfPartitioner.h

#ifdef SWIGPYTHON
%{
void XdmfSwigException(int code, const char* msg)
{
/*   SWIG_exception(code, msg); */
}
%}
#endif