Module: ErbppGsl

Included in:
DefGslClass, DefGslModule, DefInterp, DefStats
Defined in:
ext/numo/gsl/gen/erbpp_gsl.rb

Class Method Summary collapse

Class Method Details

.dblObject



13
# File 'ext/numo/gsl/gen/erbpp_gsl.rb', line 13

def dbl;   "double"   end

.dblpObject



14
# File 'ext/numo/gsl/gen/erbpp_gsl.rb', line 14

def dblp;  "double *" end

.FM(*args, **opts) ⇒ Object



9
10
11
# File 'ext/numo/gsl/gen/erbpp_gsl.rb', line 9

def FM(*args,**opts)
  FuncMatch.new(*args,**opts)
end

.intObject



18
# File 'ext/numo/gsl/gen/erbpp_gsl.rb', line 18

def int;   "int"      end

.intpObject



19
# File 'ext/numo/gsl/gen/erbpp_gsl.rb', line 19

def intp;  "int *"    end

.longObject



20
# File 'ext/numo/gsl/gen/erbpp_gsl.rb', line 20

def long;  "long"     end

.read_constObject



44
45
46
# File 'ext/numo/gsl/gen/erbpp_gsl.rb', line 44

def read_const
  read_eval("const")
end

.read_enumObject



48
49
50
# File 'ext/numo/gsl/gen/erbpp_gsl.rb', line 48

def read_enum
  read_eval("enum")
end

.read_eval(prefix) ⇒ Object



26
27
28
29
30
31
32
33
34
35
# File 'ext/numo/gsl/gen/erbpp_gsl.rb', line 26

def read_eval(prefix)
  fmt = prefix + "_%s.rb"
  # MinGW fails to invoke shell script command (gsl-config)
  cmd = "sh -c '`which gsl-config` --version'"
  fn = fmt % `#{cmd}`.chomp
  if !File.exist?(fn)
    fn = fmt % "def"
  end
  File.exist?(fn) ? eval(open(fn).read) : []
end

.read_func(prefix = "func") ⇒ Object



37
38
39
40
41
42
# File 'ext/numo/gsl/gen/erbpp_gsl.rb', line 37

def read_func(prefix="func")
  read_eval(prefix).each do |h|
    h[:desc].gsub!(/\/\*/,"//")
    h[:desc].gsub!(/\*\//,"")
  end
end

.read_func_pattern(*a) ⇒ Object



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'ext/numo/gsl/gen/erbpp_gsl.rb', line 56

def read_func_pattern(*a)
  read_func.each do |h|
    no_match = true
    a.each do |re,list|
      if re === h[:func_name]
        list << h
        no_match = false
        break
      end
    end
    if no_match
      $stderr.puts "skip "+h[:func_name]
    end
  end
end

.read_typeObject



52
53
54
# File 'ext/numo/gsl/gen/erbpp_gsl.rb', line 52

def read_type
  read_eval("type")
end

.strObject



15
# File 'ext/numo/gsl/gen/erbpp_gsl.rb', line 15

def str;   "char *"   end

.sztObject



16
# File 'ext/numo/gsl/gen/erbpp_gsl.rb', line 16

def szt;   "size_t"   end

.sztpObject



17
# File 'ext/numo/gsl/gen/erbpp_gsl.rb', line 17

def sztp;  "size_t *" end

.tpObject



24
# File 'ext/numo/gsl/gen/erbpp_gsl.rb', line 24

def tp; get(:struct)+" *" end

.uintObject



21
# File 'ext/numo/gsl/gen/erbpp_gsl.rb', line 21

def uint;  "unsigned int" end

.ulongObject



22
# File 'ext/numo/gsl/gen/erbpp_gsl.rb', line 22

def ulong; /^unsigned long/ end

.voidObject



23
# File 'ext/numo/gsl/gen/erbpp_gsl.rb', line 23

def void;  "void"     end