Tamil script processing API reference
Files:
C/C++ Header: brh_tamapi_api.h
Visual Basic definition: brh_tamapi.bas
Library: brh_tamapi.dll
Import Library: brh_tamapi.lib

Tamil Data Conversion Flow.
BrhRegister() function registers the Tamil Data Processing SDK. This function should be called before you call any other functions in the DLL.
VC++:
BOOL BrhRegister(
LPCSTR strCompanyName ,
LPCSTR strRegKey
);
VB:
Declare Function BrhRegister Lib "brh_tamapi.dll" (ByVal strCompanyName
As String, ByVal strRegKey As String) As Long
VC++ COM:
HRESULT Register (/*[in]*/ BSTR strCompanyName, /*[in]*/ BSTR
strRegKey, /*[out, retval]*/ BOOL* bOutput);
VB COM:
bOutput = tamapi.Register(strCompanyName, strRegKey)
Parameters:
strCompanyName: Specifies the name of the company/person to which/whom this
product is registered.
strRegkey: Specifies the registration key of the product.
Return Value:
If the function is successful, the return value is 1. If the function fails, the return
value is 0.
Remarks:
If you don't have valid registration key, then you should not call BrhRegister() or
tamapi.Register() function at all. This causes BRH_TAMAPI to run in the demo mode.
In the demo mode only the first 32 bytes (32 characters in the case of UNICODE) in the input string are converted to the specified output format by the BrhConvert & BrhConvertEx functions.
In the demo mode only first 16 bytes (16 characters in the case of UNICODE) are compared by BrhCompare & BrhCompareEx functions.
BrhConvert() function converts the input string represented in "TAMTRANS" format to "ANSI" output data format. This function internally calls BrhConvertEx() function.
VC++:
long BrhConvert(
LPCSTR strInput ,
LPSTR strOutput ,
long nMaxCount
);
VB:
Declare Function BrhConvert Lib "brh_tamapi.dll" (ByVal strInput
As String, ByVal strOutput As String, ByVal nMaxCount As Long)
As Long
VC++ COM:
HRESULT Convert (/*[in]*/ BSTR strInput, /*[out, retval]*/ BSTR*
strOutput);
VB COM:
strOutput = tamapi.Convert(strInput)
Parameters:
strInput: Points to the string in "TAMTRANS" format to be converted.
strOutput: Points to a buffer that receives the converted string in
"ANSI" format.
nMaxCount: Specifies the size, in bytes, of the buffer pointed to by the strOutput
parameter.
Return Value:
If the function succeeds, and nMaxCount is nonzero, the return value is the number
of bytes written to the buffer pointed to by strOutput.
If the function succeeds, and nMaxCount is zero, the return value is the required
size, in bytes, for a buffer that can receive the translated string.
If the function fails, the return value is zero.
BrhConvertEx() function converts the input string represented in strInputFormat format to the output format specified by strOutputFormat.
VC++:
long BrhConvertEx(
LPCSTR strInput ,
LPCSTR strInputFormat ,
LPSTR strOutput ,
LPCSTR strOutputFormat ,
long nMaxCount
);
VB:
Declare Function BrhConvertEx Lib "brh_tamapi.dll" (ByVal strInput
As String, ByVal strInputFormat As String, ByVal strOutput As String,
ByVal strOutputFormat As String, ByVal nMaxCount As Long) As Long
VC++ COM:
HRESULT ConvertEx (/*[in]*/ BSTR strInput, /*[in]*/ BSTR
strInputFormat, /*[in]*/ BSTR strOutputFormat, /*[out, retval]*/ BSTR*
strOutput);
VB COM:
strOutput = tamapi.ConvertEx(strInput, strInputFormat,
strOutputFormat)
Parameters:
strInput: Points to the string in strInputFormat format to be converted.
strInputFormat: Specifies the input string format.
strOutput: Points to a buffer that receives the converted string in strOutputFormat
format.
strOutputFormat: Specifies the output string format.
nMaxCount:Specifies the size, in bytes (UNICODE characters if strOutputFormat
= "UNICODE"), of the buffer pointed to by the strOutput parameter.
Return Value:
If the function succeeds, and nMaxCount is nonzero, the return value is the number
of bytes (UNICODE characters if strOutputFormat = "UNICODE") written to
the buffer pointed to by strOutput.
If the function succeeds, and nMaxCount is zero, the return value is the required
size, in bytes, for a buffer that can receive the translated string.
If the function fails, the return value is zero.
BrhCompare() function compares two Tamil strings represented in "TAMTRANS" format. This function internally calls BrhCompareEx() function.
VC++:
long BrhCompare(
LPCSTR strString1 ,
LPCSTR strString2 ,
BOOL bMemcmp
);
VB:
Declare Function BrhCompare Lib "brh_tamapi.dll" (ByVal strString1
As String, ByVal strString2 As String, ByVal bMemcmp As Long)
As Long
VC++ COM:
HRESULT Compare (/*[in]*/ BSTR strString1, /*[in]*/ BSTR
strString2, /*[in]*/ BOOL bMemcmp, /*[out, retval]*/ long* lOutput);
VB COM:
lOutput = tamapi.CompareEx(strString1, strString2, bMemcmp)
Parameters:
strString1: Points to the first string in "TAMTRANS" format.
strString2: Points to the second string in "TAMTRANS" format.
bMemcmp : This parameter is ignored.
Return Value:
Returns 0 if strString1 identical to strString2.
Returns -ve value if strString1 less than strString2.
Returns +ve value if strString1 greater than strString2.
BrhCompareEx() function compares two Tamil strings represented in various formats.
VC++:
long BrhCompareEx(
LPCSTR strString1 ,
LPCSTR strString1Format ,
LPCSTR strString2 ,
LPCSTR strString2Format ,
BOOL bMemcmp
);
VB:
Declare Function BrhCompareEx Lib "brh_tamapi.dll" (ByVal strString1
As String, ByVal strString1Format As String, ByVal strString2
As String, ByVal strString2Format As String, ByVal bMemcmp As Long
) As Long
VC++ COM:
HRESULT CompareEx (/*[in]*/ BSTR strString1, /*[in]*/ BSTR
strString1Format, /*[in]*/ BSTR strString2, /*[in]*/ BSTR strString2Format,
/*[in]*/ BOOL bMemcmp, /*[out, retval]*/ long* lOutput);
VB COM:
lOutput = tamapi.CompareEx(strString1, strString1Format, strString2,
strString2Format, bMemcmp)
Parameters:
strString1: Points to the first string.
strString1Format: Specifies the first string format.
strString2: Points to the second string.
strString2Format: Specifies the second string format.
bMemcmp : This parameter is ignored.
Return Value:
Returns 0 if strString1 identical to strString2.
Returns -ve value if strString1 less than strString2.
Returns +ve value if strString1 greater than strString2.
BrhConvertDate() function converts the Date/Time strings to/from Tamil(TAMTRANS) to English.
VC++:
void BrhConvertDate(
LPCSTR strInput,
BOOL bFromEnglish ,
LPSTR strOutput,
long nMaxCount
);
VB:
Declare Sub BrhConvertDate Lib "brh_tamapi.dll" (ByVal strInput
As String, ByVal bFromEnglish as Long, ByVal strOutput As String,
ByVal nMaxCount As Long )
VC++ COM:
HRESULT ConvertDate (/*[in]*/ BSTR strInput, /*[in]*/ BOOL
bFromEnglish , /*[in]*/ BSTR* strOutput);
VB COM:
strOutput = tamapi.ConvertDate(strInput, bFromEnglish)
Parameters:
strInput: Points to the input string to be converted.
bFromEnglish: If 1 convert from English to TAMTRANS. Else, convert from TAMTRANS to
English.
strOutput: Points to the output string.
nMaxCount: Specifies the size in bytes, of the buffer pointed to by the strOutput
parameter.
Remarks:
The Date/Time strings can be converted to/from English to TAMTRANS format. The string
can be later converted to other Tamil data formats.
Ex: "Tuesday, January 23, 1968" is converted to " cevvAy, janavari 23,
1968", when bFromEnglish is 1
Ex: " mArc 15, 1972, 8:00 kAlai" is converted to "MARCH 15, 1972, 8:00
AM", when bFromEnglish is 0.