# 22. Virtuoso Functions Guide - Virtuoso Server Extension Interface (VSEI) functions

Chapter Contents | Prev | Next
Keyword Search:
www.openlinksw.com
docs.openlinksw.com
Book Home
Contents
Preface
Virtuoso Functions Guide
Administration
Aggregate Functions
Array Manipulation
BPEL APIs
Backup
Compression
Cursor
Date & Time Manipulation
Debug
Dictionary Manipulation
Encoding & Decoding
File Manipulation
Free Text
Hashing / Cryptographic
LDAP
Locale
Mail
Miscellaneous
Number
Remote SQL Data Source
Replication
SOAP
SQL
String
Transaction
Type Mapping
UDDI
User Defined Types & The CLR
Virtuoso Java PL API
Virtuoso Server Extension Interface (VSEI)
virtuoso server exte...
Web Server & Internet
XML
XPATH & XQUERY
Functions Index

## Virtuoso Server Extension Interface (VSEI) functions

Get parameters for built in function
caddr_t bif_arg (caddr_t * qst , state_slot_t ** args , int nth , char * func );
caddr_t bif_array_arg (caddr_t * qst , state_slot_t ** args , int nth , char * func );
caddr_t bif_array_or_null_arg (caddr_t * qst , state_slot_t ** args , int nth , char * func );
caddr_t bif_bin_arg (caddr_t * qst , state_slot_t ** args , int nth , char * func );
caddr_t bif_double_arg (caddr_t * qst , state_slot_t ** args , int nth , char * func );
caddr_t bif_entity_arg (caddr_t * qst , state_slot_t ** args , int nth , char * func );
caddr_t bif_float_arg (caddr_t * qst , state_slot_t ** args , int nth , char * func );
caddr_t bif_long_arg (caddr_t * qst , state_slot_t ** args , int nth , char * func );
caddr_t bif_long_or_char_arg (caddr_t * qst , state_slot_t ** args , int nth , char * func );
caddr_t bif_string_arg (state_slot_t ** args , int nth , char * func );
caddr_t bif_string_or_null_arg (caddr_t * qst , state_slot_t ** args , int nth , char * func );
caddr_t bif_string_or_wide_or_null_arg (caddr_t * qst , state_slot_t ** args , int nth , char * func );
caddr_t bif_strses_arg (caddr_t * qst , state_slot_t ** args , int nth , char * func );
Description

The bif_...._arg functions are used in the Virtuoso shared object. They allow customisation of the Virtuoso server. They are written in C code, and linked with the Virtuoso shared object.

The _or_null_ variants of these functions represent the SQL null value as a 00 pointer, even though getting the same argument with bif_arg() would return a box with the DV_DB_NULL tag. All number functions will coerce other types of numbers to the result type. All array argument functions will accept any type of array. It is up to the VSE itself to distinguish.

Virtuoso Server Extensions (VSEs) were formally referred to as Built-In Functions (BIFs).

Parameters
qst – Query instance.
args – input arguments.
nth – which argument to retrieve (zero indexed).
func – name of calling function. This will be printed in the SQL error message.
Return Values

On success, return a valid pointer to the data retrieved, or NULL. A SQL error is generated if the datatype is not valid. The bif_arg is the only function not to have validation of a data type.

The values returned by any of these belong to the query instance, and the bif is not authorized to modify or free them.

Function | Type validated and returned
--- | ---
bif_arg | Any type of data. (no data type check)
bif_array_arg | string or array data
bif_array_or_null_arg | string or array or NULL data
bif_bin_arg | binary data
bif_double_arg | double data
bif_entity_arg | XML entity data
bif_float_arg | float data
bif_long_arg | long data
bif_long_or_char_arg | long or character data
bif_string_arg | string data
bif_string_or_null_arg | string or null data
bif_string_or_wide_or_null_arg | strings, widestrings or null data
bif_strses_arg | string session data

Examples
Creating a function my_length()

A function called my_length written by developers, may process a string argument by making a call to bif_string_arg.