# ENV_Init

## Syntax

      #include <nitro/env.h>

      void ENV_Init( void );

## Arguments

None.

## Return Values

None.

## Description

Initializes the resource management system.

The `ENV_Init` function specifies resource arrays using the `ENVResource* resourceArray[]` array, as shown below.

>     SDK_WEAK_SYMBOL ENVResource *resourceArray[] = { NULL };

>     void ENV_Init(void)
>     {
>          :
>      ENV_SetResourceSetArray( resourceArray );
>     }

`resourceArray[]` is an array that holds resource arrays. Because `resourceArray[]` is an array of `NULL` members that is defined with the WEAK symbol in the system, it is useful for the application to define the array itself. Because `resourceArray[]` is an array of resource arrays, it can specify a number of necessary resource arrays all at once.

When describing a resource array, be sure to place an `ENV_RESOURCE_END` at the end.

Multiple arrays can be joined together into a list and retained inside the system. (The maximum number of arrays is `ENV_RESOURCE_SET_MAX`.) When multiple arrays are kept, searches are performed on all of them. The `ENV_SetResourceSet`, `ENV_AppendResourceSet`, `ENV_PrependResourceSet`, and `ENV_InsertResourceSet` functions manipulate the list.

Here is an example of the description of `resourceArray[]`.

>     (Example)

>     ENVResource myResource1[] = {
>        "res1.data1",    ENV_U32( 300 ),
>        "res1.data2",    ENV_STRING( "abcde" ),
>        "res1.data3",    ENV_S32( -100 ),
>        ENV_RESOURCE_END
>     };

>     ENVResource myResource2[] = {
>        "res2.data1",    ENV_U32( 500 ),
>        "res2.data2",    ENV_S32( -800 ),
>        ENV_RESOURCE_END
>     };

>     ENVResource* resourceArray[]={ myResource1, myResource2, NULL };

You should call the `ENV_Init` function before calling any other ENV functions. It cannot be called from the `OS_Init` function.

## See Also

`ENV_SetResourceSetArray`
`ENV_SetResourceSet`
`ENV_AppendResourceSet`
`ENV_PrependResourceSet`
`ENV_InsertResourceSet`
`ENV_Get*`

## Revision History

2008/12/19 Added example.
2005/08/29 Added text about multiple arrays.
2005/08/16 Initial version

CONFIDENTIAL