1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<HTML> 3<HEAD> 4<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 5<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 7.0.1.0 for Windows"> 6<META http-equiv="Content-Style-Type" content="text/css"> 7<TITLE>ENV_GetXXX</TITLE> 8<LINK rel="stylesheet" href="../css/nitro.css" type="text/css"> 9</HEAD> 10<BODY> 11<H1 align="left">ENV_Get* <img src="../image/NTR.gif"align="middle"><img src="../image/TWL.gif" align="middle"></H1> 12<H2>Syntax</H2> 13<DL> 14 <DD> 15<PRE><CODE>#include <nitro/env.h></CODE></PRE> 16 <PRE><CODE>BOOL ENV_GetS8( const char* name, s8* retVal ); 17BOOL ENV_GetU8( const char* name, u8* retVal ); 18BOOL ENV_GetS16( const char* name, s16* retVal ); 19BOOL ENV_GetU16( const char* name, u16* retVal ); 20BOOL ENV_GetS32( const char* name, s32* retVal ); 21BOOL ENV_GetU32( const char* name, u32* retVal ); 22BOOL ENV_GetS64( const char* name, s64* retVal ); 23BOOL ENV_GetU64( const char* name, u64* retVal ); 24BOOL ENV_GetBOOL( const char* name, BOOL* retVal ); 25 26BOOL ENV_GetString( const char* name, char** retPtr ); 27BOOL ENV_GetStringAndLength( const char* name, char** retPtr, int* length ); 28BOOL ENV_GetBinary( const char* name, void** retPtr ); 29BOOL ENV_GetBinaryAndSize( const char* name, void** retPtr, int* size ); 30 </CODE></PRE> 31</DL> 32<H2>Arguments</H2> 33<TABLE border="1" width="100%"> 34 <TBODY> 35 <TR> 36<TD width="20%"><SPAN class="argument">name</SPAN></TD> 37<TD>Pointer to the resource name. If this string begins with "<CODE>.</CODE>" (period), the class name is considered to be omitted, and the current class is filled in before that period.</TD> 38 </TR> 39 <TR> 40<TD><SPAN class="argument">length</SPAN></TD> 41<TD>Pointer that stores the string length when getting a string resource.</TD> 42 </TR> 43 <TR> 44<TD><SPAN class="argument">retVal</SPAN></TD> 45<TD>Pointer that stores the obtained resource.</TD> 46 </TR> 47 <TR> 48<TD><SPAN class="argument">retPtr</SPAN></TD> 49<TD>Pointer that stores the pointer to the obtained resource.</TD> 50 </TR> 51 <TR> 52<TD><SPAN class="argument">size</SPAN></TD> 53<TD>Pointer that stores the size when getting a binary resource.</TD> 54 </TR> 55 </TBODY> 56</TABLE> 57<H2>Return Values</H2> 58<P>Returns whether or not the resource was successfully obtained. Returns <CODE>TRUE</CODE> if successful. Returns <CODE>FALSE</CODE> if the specified resource does not exist.</P> 59<H2>Description</H2> 60<P>Gets the designated resource value.</P> 61<P>The <SPAN class="argument">name</SPAN> argument is the resource name. This function searches for a resource with the same resource name defined. If <SPAN class="argument">name</SPAN> begins with a period ("<CODE>.</CODE>"), the current class set with the <A href="ENV_SetClass.html"><CODE>ENV_SetClass</CODE></A> function is filled in before that period.</P> 62<BLOCKQUOTE style="background-color:#ffffcc"><B>Example:</B> <BR> <BR> <CODE>These two both return the same values.// (1)<BR> ENV_GetU32( "MYCLASS.U32VALUE", &retVal );<BR> <BR> // (2)<BR> ENV_SetClass( "MYCLASS" );<BR> ENV_GetU32( ".U32VALUE", &retVal );<BR> <BR></CODE></BLOCKQUOTE> 63<P><BR>Searches are performed on all resource arrays registered in the system. If there are resources with identical resource names, the first one found according to the list order in the system is returned.</P> 64<P><CODE>ENV_GetS8</CODE> gets a value of an <CODE>s8</CODE> type. Be sure to define the resource with <CODE>ENV_S8</CODE>.<BR><CODE>ENV_GetU8</CODE> gets a value of a <CODE>u8</CODE> type. Be sure to define the resource with <CODE>ENV_U8</CODE>.<BR><CODE>ENV_GetS16</CODE> gets a value of an <CODE>s16</CODE> type. Be sure to define the resource with <CODE>ENV_S16</CODE>.<BR><CODE>ENV_GetU16</CODE> gets a value of a <CODE>u16</CODE> type. Be sure to define the resource with <CODE>ENV_U16</CODE>.<BR><CODE>ENV_GetS32</CODE> gets a value of an <CODE>s32</CODE> type. Be sure to define the resource with <CODE>ENV_S32</CODE>.<BR><CODE>ENV_GetU32</CODE> gets a value of a <CODE>u32</CODE> type. Be sure to define the resource with <CODE>ENV_U32</CODE>.<BR clear=""><CODE>ENV_GetS64</CODE> gets a value of an <CODE>s64</CODE> type. Define the resource with <CODE>ENV_S64</CODE>.<BR clear=""><CODE>ENV_GetU64</CODE> gets a value of a <CODE>u64</CODE> type. Define the resource with <CODE>ENV_U64</CODE>.<BR clear=""><CODE>ENV_GetBOOL</CODE> gets a value of a <CODE>BOOL</CODE> type. Be sure to define the resource with <CODE>ENV_BOOL</CODE>.<BR>The obtained value is always either <CODE>TRUE</CODE> or <CODE>FALSE</CODE>. (In other words, the value is <CODE>TRUE</CODE> even when the stored value is a non-zero value that indicates other than <CODE>TRUE</CODE>.)</P> 65<P>The obtained value is stored in the place where <SPAN class="argument">retVal</SPAN> points to. If the value was obtained, the return value is <CODE>TRUE</CODE>. If the value was not obtained, the return value is <CODE>FALSE</CODE>, and a 0 is assigned in the place where <SPAN class="argument">retVal</SPAN> points to.</P> 66<P><CODE>ENV_GetString</CODE> gets the pointer to the string as a <CODE>char*</CODE> type. Be sure to define the resource with <CODE>ENV_STRING</CODE>. The obtained pointer is stored in the the place where <SPAN class="argument">retPtr</SPAN> points to. If the pointer was obtained, <CODE>TRUE</CODE> is returned. If not, <CODE>FALSE</CODE> is returned. The value that is stored is a <CODE>NULL</CODE> value. <CODE>ENV_GetStringAndLength</CODE> stores the same content as <CODE>ENV_GetString</CODE> as well as the length of the string in the place pointed to by <SPAN class="argument">length</SPAN>.</P> 67<P><CODE>ENV_GetBinary</CODE> gets the pointer to the binary data as a <CODE>void*</CODE> type. Be sure to define the resource with <CODE>ENV_BINARY</CODE>. The obtained pointer is stored in the the place where <SPAN class="argument">retPtr</SPAN> points to. If the pointer was obtained, <CODE>TRUE</CODE> is returned. If not, <CODE>FALSE</CODE> is returned. The value that is stored is a <CODE>NULL</CODE> value. <CODE>ENV_GetBinaryAndSize</CODE> stores the binary data size in <SPAN class="argument">size</SPAN> in addition to the content stored with <CODE>ENV_GetBinary</CODE>.</P> 68 69<H2>See Also</H2> 70<P><A href="ENV_Init.html"><CODE>ENV_Init</CODE></A><BR> <A href="ENV_GetSize.html"><CODE>ENV_GetSize</CODE></A><BR> <A href="ENV_GetType.html"><CODE>ENV_GetType</CODE></A><BR> <A href="ENV_SetClass.html"><CODE>ENV_SetClass</CODE></A></P> 71<H2>Revision History</H2> 72<P>2008/10/29 Corrected errors.<BR> 2005/08/29 Revised description errors in function names.<BR> 2005/08/23 Changed the method for getting resource values.<BR> 2005/08/16 Initial version.</P> 73<hr><p>CONFIDENTIAL</p></body> 74</HTML> 75