VLSsetFileNameExt

This API is a Unicode variant of the existing VLSsetFileName API. It enables you to set the localized license or configuration file path (in multi-byte format) for non-English Windows operating systems.

VLSFileNameStruct

You can use this structure to pass the localized license or configuration file name/file path input parameters for the VLSFileNameExt API. Both Unicode (multi-byte) and ASCII character formats are supported.

typedef struct
  {      
     char *fileName;
#ifdef _VMSWIN_ /* Windows Specific */

     wchar_t *wFileName;
#endif   	 
  }VLSFileNameStruct;

Member

Description

fileName

The custom file name/path (ASCII) for the license or configuration files

wFileName

The localized license or configuration file name/file path in Unicode (multi-byte) format

Function Prototype

LS_STATUS_CODE VLSsetFileNameExt
(
   VLS_FILE_TYPE        filetype,  /*IN*/
   VLSFileNameStruct*   FileConfig /*IN*/
);

Returns

>Returns LS_SUCCESS(0) on success.

>Returns non-zero on failure.

Parameter

Description

filetype

This is an IN parameter.

It specifies the type of license file (lservrc, lservrccnf, or ULSERVRC) or configuration file that you are going to provide a customized location/name.

FileConfig

It stores the license or configuration file name/file path in Unicode (multi-byte) or ASCII format. The following table defines the character set(s) supported on different operating systems.

Operating System Supported Character Set (Unicode/ASCII)
Windows (English-based) ASCII/Unicode (same as VLSsetFileName)

 

Windows(non-English)

Unicode. It can store localized file name / file path for non-English Windows operating systems.
UNIX ASCII (same as VLSsetFileName)

NOTE   The memory needs to be allocated and freed by the caller.

Code Snippet

NOTE   This code snippet is applicable in case of Windows operating system only.

#include "lserv.h"

#define  FILE_NAME_LENGTH 256

int main(int argc, char* argv[])
{
   LS_STATUS_CODE statusCode = LS_SUCCESS;
   VLSFileNameStruct objFileName;
   wchar_t wcFileName[] = L"श啊"; /* This is the new file name that will be set using VLSsetFileNameExt */
   objFileName.fileName = NULL;
   objFileName.wFileName = (wchar_t*)malloc(FILE_NAME_LENGTH);
   wmemset(objFileName.wFileName,'\0', wcslen(wcFileName));
   wcscpy(objFileName.wFileName,wcFileName);

   statusCode = VLSsetFileNameExt(VLS_LSERVRC, &objFileName); 
   if (statusCode != LS_SUCCESS)
   {
      return 1; /* non-zero to mark failure */
   }

   statusCode = VLSinitialize();
   if (statusCode != LS_SUCCESS)
   {
      return 1; /* non-zero to mark failure */
   }
   /* add the client application code here  */
   return 0;
}