The mi_get_next_sysname() function

The mi_get_next_sysname() function retrieves the next database server name.

Syntax

mi_integer mi_get_next_sysname(name_ptr, name_buf, name_len)
   mi_integer *name_ptr;
   char *name_buf;
   mi_integer name_len;
name_ptr
A pointer to the next database server name.
name_buf
A pointer to the buffer to contain the next database server name.
name_len
The size of the name_buf buffer.
Valid in client LIBMI application? Valid in user-defined routine?
Yes No

Usage

The mi_get_next_sysname() function obtains the next database server name and puts it into the buffer that name_buf references. It returns the length of this name in the name_len argument.

On UNIX or Linux, the sqlhosts file defines system names.

On Windows, the Registry defines system names.

The following code fragment uses mi_get_next_sysname() to display the contents of the server-definition file:
main()
{
   mi_integer handle;
   char nameb[32];

   handle = 0;
   while( mi_get_next_sysname(&handle, nameb, sizeof(nameb) )   
      puts(nameb);
   return 0;
}

The mi_get_next_sysname() function initializes the DataBlade® API when it is the first DataBlade® API function in a client LIBMI application.

Return values

MI_TRUE
The function was successful.
MI_FALSE
The function was not successful.