EZXCodec script fromat v.5
~~~~~~~~~~~~~~~~~~~~~~~~~~




Intro
=====
Scripts for EZXCodec - are text files with commands to automatically execute some operations.


General rules
=============
Any scrips must begin with two necessary lines (here and further down - spaces at the beginning of lines are not necessary):

	EZXCodec script file        # identifier
	5                           # version

(Everything after the symbol "#" in the line is a comment and will be ignored by the program.)

Right after these two line there must be at least one name of a codegroup, which must be extracted. For example:

	RDL3
	CG34
	CG41
	CG43

There may be a special parameter "bootscreen" to the right of a codegroup name. For example:

	CG39 bootscreen mypic.gif

After each codegroup there may be a sequence of commands, which apply to last extracted codegroup. Following commands are supported:

	add
	del
	md
	skin
	cfg

If after the line with codegroup name there is a name of another codegroup or end of file, no modification performed with this codegroup, it only extracted from firmware file (SBF) to include in resulting firmware file (SBF). Good example is codegroup named RDL3 - EZXCodec is not able to recompile it but RDL3 must be present in SBF to permorm successfull flashing.




Commands, their descriptions and parameters
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Intro
=====
As said above, sctipting system supports a number of commands. General rules, which applies to all commands:
  - first word in a line is always a command, without quotes or any other symbols;
  - all command parameters separated with single space;
  - if some command parameter contains spaces (usually it is a name of a file or a folder), it must be enclosed with double quotes (symbol ");
  - if a command receives a name of a file or a folder as a parameter, it is shown in a syntax as a word "file" or "folder" or both;
  - file or folder path must be entered starting with symbol "/", path elements must be separated with the same symbol;
  - file you wish to add (or replace with) must be placed in the same folder as the script file (not in subfolder), having the same name it will have in codegroup;
  - using double period ("..") in a path to a file/folder is not allowed;
  - if a command have optional parameters, syntax shows them enclosed in symbols "<" and ">";
  - if a syntax line have parameter named "switch" - this is a switch parameter, which must be prefixed with a minus sign (symbol "-") (no space between minus and parameter must be present);
  - maximum script file size = 10240 bytes.


add command
===========
Adds a file to a codegroup.
Syntax:
  add <switch> file <uid> <gid> <permissions>

switch - optional switch parameter, may have two values:
  -ifexists - add a file only if it already exists in codegroup; file will be replaced, "uid", "gid" and "permissions" parameters will be ignored;
  -ifnotexists - add a file only if it not exists in codegroup; "uid", "gid" and "permissions" parameters may be ommitted, but then these properties will be set to default.
  If "switch" parameter is ommitted, file will be added in any case, but "uid", "gid" and "permissions" will be used only if a file did not exist in codeegroup.
uid - User ID (look in Unix reference).
gid - Group ID, ID  (look in Unix reference).
permissions - file premissions, written as symbols "rwxrwxrwx" (look in Unix reference).

Notes:
  if a path to a file not exists in codegroup, needed folders will be created automatically, but it is preferred to create them with "md" command (look further) - then you'll be able to give needed permissions to a folder.


del command
===========
Deletes files or folders from codegroup.
Syntax:
  del file/folder

Notes:
  if you give a folder as a parameter, it will be deleted with all it's content.


md command
==========
Creates a directory in codegroup.
Syntax:
  md folder <uid> <gid> <permissions>

For a descrtiption of "uid", "gid" and "permissions" parameters look in "add command" section. If a folder already exists in codegroup, "uid", "gid" and "permissions" parameters will be ignored.

Notes:
  if a path to a folder not exists in codegroup, needed folders will be created automatically, but it is preferred to create them with "md" command - then you'll be able to give needed permissions to a folder.


skin command
============
Adds or replaces pictures in iconres.ezx file.
Syntax:
  skin file picture

file - iconres.ezx file
picture - picture name you wish to add or replace

Notes:
  if you want to add/replace more than one picture in the same file, use multiple "skin" commands one after another with the same "file" parameter, or give correct "file" parameter to the first "skin" command in a sequence and minus sign (symbol "-") to the rest.


cfg command
===========
Edits INI-like *.cfg files. Have two syntax variants.
Syntax 1 (to set a value of string type):
  cfg file section key value

Syntax 2 (to set or unset a bit in a value of integer type):
  cfg file section key offset1=bit1 offset2=bit2 ...

section - section with a needed "key"
key - key with a value you want to replace to a "value"
value - value you want to set to a "key"
offset - offset of a bit in a value of "key" you want to set to a value "bit"
bit - value you want to set to a bit at "offset" of a value of "key"

Notes:
  if section or a key does not exist - it will be created;
  if you want to add/replace more than one values in the same file, use multiple "cfg" commands one after another with the same "file" parameter, or give correct "file" parameter to the first "cfg" command in a sequence and minus sign (symbol "-") to the rest.




bootscreen parameter
~~~~~~~~~~~~~~~~~~~~
A1200 and E6 models' firmwares have CG39 containing a GIF format picture on 2048 bytes offset. This picture show up very first, before starting theme animation. You can replace this picture by writing something like:

	CG39 bootscreen mypic.gif

mypic.gif must be placed in a folder with the script and have parameters descripted in readme_en.txt in "Bootscreen picture" part.
