Module: SQLAnywhere::API

Defined in:
ext/sqlanywhere.c

Constant Summary collapse

VERSION =
rb_str_new2(VERSION)

Class Method Summary collapse

Class Method Details

.sqlany_finalize_interface(VALUEapi) ⇒ nil

Finalize and free resources associated with the SQL Anywhere C API DLL.

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

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

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

Returns:

  • (nil)


225
226
227
228
229
230
231
232
233
234
235
236
237
# File 'ext/sqlanywhere.c', line 225

static VALUE
static_API_sqlany_finalize_interface(VALUE module, VALUE api)
{
    SQLAnywhereInterface* s_api;

    Data_Get_Struct(api, SQLAnywhereInterface, s_api);

    sqlany_finalize_interface(s_api);

    free(s_api);

    return( Qnil );
}

.sqlany_initialize_interface(VALUEapi) ⇒ Object

Initializes the SQLAnywhereInterface object and loads the DLL dynamically.

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

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

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


196
197
198
199
200
201
202
203
204
205
206
207
# File 'ext/sqlanywhere.c', line 196

static VALUE
static_API_sqlany_initialize_interface(VALUE module, VALUE api)
{
    SQLAnywhereInterface* s_api;
    int result;

    Data_Get_Struct(api, SQLAnywhereInterface, s_api);
    
    result = sqlany_initialize_interface( s_api, NULL );

    return( INT2NUM(result) ); 
}