Module: Advantage::API
- Defined in:
- ext/advantage/advantage.c
Constant Summary collapse
- VERSION =
rb_str_new2(VERSION)
Class Method Summary collapse
-
.ads_finalize_interface(VALUEimp_drh) ⇒ nil
Finalize and free resources associated with the Advantage C API DLL.
-
.ads_initialize_interface(VALUEimp_drh) ⇒ Object
Initializes the AdvantageInterface object and loads the DLL dynamically.
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.
Parameters:
- VALUE imp_drh -- An initialized API structure to finalize.
Returns:
- nil.
248 249 250 251 252 253 254 255 256 257 258 259 260 |
# File 'ext/advantage/advantage.c', line 248
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.
Parameters:
- VALUE imp_drh -- An API structure to initialize.
Returns:
- result: 1 on successful initialization, 0 on failure.
219 220 221 222 223 224 225 226 227 228 229 230 |
# File 'ext/advantage/advantage.c', line 219
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));
}
|