Module: Advantage::API

Defined in:
ext/advantage/advantage.c

Constant Summary collapse

VERSION =
rb_str_new2(VERSION)

Class Method Summary collapse

Class Method Details

.ads_finalize_interface(VALUEimp_drh) ⇒ nil

Finalize and free resources associated with the Advantage C API DLL.

This function will unload the library and uninitialize the supplied
AdvantageInterface structure.

<b>Parameters</b>:
- <tt>VALUE imp_drh</tt> -- An initialized API structure to finalize.

<b>Returns</b>:
- <tt>nil</tt>.

Returns:

  • (nil)


242
243
244
245
246
247
248
249
250
251
252
253
254
# File 'ext/advantage/advantage.c', line 242

static VALUE
static_API_ads_finalize_interface(VALUE module, VALUE imp_drh)
{
   imp_drh_st *s_imp_drh;

   Data_Get_Struct(imp_drh, imp_drh_st, s_imp_drh);

   ads_finalize_interface(&(s_imp_drh->api));

   free(&(s_imp_drh->api));

   return (Qnil);
}

.ads_initialize_interface(VALUEimp_drh) ⇒ Object

Initializes the AdvantageInterface object and loads the DLL dynamically.

This function attempts to load the Advantage C API DLL dynamically and
looks up all the entry points of the DLL.

<b>Parameters</b>:
- <tt>VALUE imp_drh</tt> -- An API structure to initialize.

<b>Returns</b>:
- <tt>result</tt>: <tt>1</tt> on successful initialization, <tt>0</tt> on failure.


213
214
215
216
217
218
219
220
221
222
223
224
# File 'ext/advantage/advantage.c', line 213

static VALUE
static_API_ads_initialize_interface(VALUE module, VALUE imp_drh)
{
   imp_drh_st *s_imp_drh;
   int result;

   Data_Get_Struct(imp_drh, imp_drh_st, s_imp_drh);

   result = ads_initialize_interface(&(s_imp_drh->api), NULL);

   return (INT2FIX(result));
}