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.0.0 for Windows"> 6<META http-equiv="Content-Style-Type" content="text/css"> 7<TITLE>init2env</TITLE> 8<LINK rel="stylesheet" href="../css/nitro.css" type="text/css"> 9<STYLE type="text/css"> 10<!-- 11.sample_source{ 12 background-color : #e8e8e8; 13} 14H3{ 15 color : teal; 16} 17.command_list{ 18 margin-bottom : 16pt; 19} 20.command_desc{ 21 } 22.command_item{ 23 margin-top : 16pt; 24 background-color : #e8e8e8; 25} 26.blockquoted_table { 27 border : 1px; 28 width : 80%; 29} 30TD,TH{ 31 border-color : #c0d8d8; 32 padding : 1pt 4pt 1pt 4pt; 33 border-width : 1px; 34 border-style : solid; 35} 36--> 37</STYLE> 38</HEAD> 39<BODY> 40<H1 align="left">init2env <IMG src="../image/NTR.gif" align="middle"><IMG src="../image/TWL.gif" align="middle"></H1> 41<H2>Description</H2> 42<P><CODE>init2env</CODE> is a tool to convert the resource data for the ENV library written in INIT format to the source file format in C.</P> 43<H2>Using the Tool</H2> 44<H3>Start Command</H3> 45<PRE><CODE>% init2env RESOURCE_FILE 46 [-o OUTPUT_FILE]</CODE></PRE> 47<P>The resource data written in the INIT format specified by <CODE>RESOURCE_FILE</CODE> is changed to the C source file format and is output with the name <CODE>result.c</CODE>.</P> 48<P>With the <CODE>-o</CODE> option, the output file name can be changed from <CODE>result.c</CODE> to <CODE>OUTPUT_FILE</CODE>.</P> 49 50<BR> 51<P><B>Description example of the resource data for the ENV library in INIT format.</B></P> 52<BR> 53<P>INIT formatted resource data before being changed.</P> 54<BLOCKQUOTE><CODE><environment1><BR> [myClass11]<BR> str1 STRING mario<BR> bin1 BINARY 12345678<BR> bin2 BINARY "testbin"<BR> <environment2><BR> [myClass21]<BR> str1 STRING mario<BR> bin1 BINARY abcd123<BR> bin2 BINARY "test.txt"<BR> [myClass22]<BR> data1 S32 -500<BR> data2 U16 0x8000<BR></CODE></BLOCKQUOTE> 55<BR> 56<P>C Source File formatted Resource Data after being changed.</P> 57<BLOCKQUOTE><CODE>ENVResource myResource1[] = {<BR> "myClass11.str1", ENV_STRING( "mario" ),<BR> "myClass11.bin1", ENV_BINARY( "12345678" ),<BR> "myClass11.bin2", ENV_BINARY( "testbin file content" ),<BR> ENV_RESOURCE_END<BR> };<BR> <BR> ENVResource myResource2[] = {<BR> "myClass21.str1", ENV_STRING( "mario" ),<BR> "myClass21.bin1", ENV_BINARY( "abcd123" ),<BR> "myClass21.bin2", ENV_BINARY( "test.txt file content" ),<BR> "myClass22.data1", ENV_S32( -500 ),<BR> "myClass22.data2", ENV_U16( 0x8000 ),<BR> ENV_RESOURCE_END<BR> };<BR> <BR> ENVResource* resourceArray[]={ myResource1, myResource2, NULL };</CODE></BLOCKQUOTE> 58 59<P>When the resource type is BINARY, data within <CODE> "" </CODE> is seen as file names and it is possible to make the file contents into data automatically.</P> 60<P>Resource data can be used as is by compiling the generated C source file and the program using ENV together.</P><BR> 61<H2>Location</H2> 62<P><CODE>$TwlSDK/tools/bin/init2env.exe</CODE></P> 63<H2>See Also</H2> 64<P><CODE><A href="../env/about_env.html">ENV</A></CODE></P> 65<H2>Revision History</H2> 66<P>2005/10/20 Initial version.</P> 67<hr><p>CONFIDENTIAL</p></body> 68</HTML>