ZOO-Project
Functions
service_internal_ruby.c File Reference
#include "service_internal_ruby.h"

Functions

int zoo_ruby_support (maps **main_conf, map *request, service *s, maps **real_inputs, maps **real_outputs)
 Load a Ruby file then run the function corresponding to the service by passing the conf, inputs and outputs parameters by refernce as Ruby Hash. More...
 
VALUE LoadWrap (VALUE arg)
 Load a ruby file. More...
 
VALUE FunCallWrap (VALUE rdata)
 Call a ruby function with parameters. More...
 
void ruby_trace_error (maps *m)
 Print the Ruby Stack Trace in an ows:ExceptionReport XML Document. More...
 
VALUE RubyHash_FromMaps (maps *t)
 Convert a maps to a Ruby Hash. More...
 
int keys_i (VALUE key, VALUE value, VALUE ary)
 Push the key on the array. More...
 
VALUE rb_hash_size (VALUE hash)
 Return the size of a Ruby Hash. More...
 
VALUE RubyHash_FromMap (map *t)
 Convert a map to a Ruby Hash. More...
 
mapsmapsFromRubyHash (VALUE t)
 Convert a Ruby Hash to a maps. More...
 
mapmapFromRubyHash (VALUE t)
 Convert a Ruby Hash to a map. More...
 
VALUE RubyTranslate (int argc, VALUE *argv, VALUE obj)
 Use the ZOO-Services messages translation function from the Ruby environment (ZOO-API) More...
 
VALUE RubyUpdateStatus (int argc, VALUE *argv, VALUE obj)
 Update the ongoing status of a running service from the Ruby environment (ZOO-API) More...
 

Function Documentation

VALUE FunCallWrap ( VALUE  rdata)

Call a ruby function with parameters.

  • the callback structure
    Returns
    the value returned the called ruby function
int keys_i ( VALUE  key,
VALUE  value,
VALUE  ary 
)

Push the key on the array.

Parameters
keythe key to push
valuenot used
arythe Array
Returns
ST_CONTINUE
VALUE LoadWrap ( VALUE  arg)

Load a ruby file.

  • the file to load
    Returns
    Qnil
map* mapFromRubyHash ( VALUE  t)

Convert a Ruby Hash to a map.

Parameters
tthe Ruby Hash to convert
Returns
a new map
maps* mapsFromRubyHash ( VALUE  t)

Convert a Ruby Hash to a maps.

Parameters
tthe Ruby Hash to convert
Returns
a new maps
VALUE rb_hash_size ( VALUE  hash)

Return the size of a Ruby Hash.

Parameters
hashthe input Hash
void ruby_trace_error ( maps m)

Print the Ruby Stack Trace in an ows:ExceptionReport XML Document.

Parameters
mthe conf maps containing the main.cfg settings
See also
printExceptionReportResponse
VALUE RubyHash_FromMap ( map t)

Convert a map to a Ruby Hash.

Parameters
tthe map to convert
Returns
a new Ruby Hash
VALUE RubyHash_FromMaps ( maps t)

Convert a maps to a Ruby Hash.

Parameters
tthe maps to convert
Returns
a new Ruby Hash
VALUE RubyTranslate ( int  argc,
VALUE *  argv,
VALUE  obj 
)

Use the ZOO-Services messages translation function from the Ruby environment (ZOO-API)

Parameters
argcthe number of parameters
argvthe parameter values given from the Ruby environment
objthe Ruby object on which we run the method
Returns
a new Ruby string containing the translated value
See also
_ss
VALUE RubyUpdateStatus ( int  argc,
VALUE *  argv,
VALUE  obj 
)

Update the ongoing status of a running service from the Ruby environment (ZOO-API)

Parameters
argcthe number of parameters
argvthe parameter values given from the Ruby environment
objthe Ruby object on which we run the method
Returns
a new Ruby string containing the translated value
See also
_updateStatus
int zoo_ruby_support ( maps **  main_conf,
map request,
service s,
maps **  real_inputs,
maps **  real_outputs 
)

Load a Ruby file then run the function corresponding to the service by passing the conf, inputs and outputs parameters by refernce as Ruby Hash.

Parameters
main_confthe conf maps containing the main.cfg settings
requestthe map containing the HTTP request
sthe service structure
real_inputsthe maps containing the inputs
real_outputsthe maps containing the outputs
Returns
SERVICE_SUCCEEDED or SERVICE_FAILED if the service run, -1 if the service failed to load or throw error at runtime.