Resources | developer.brewmp.com Resources | developer.brewmp.com

Developer

resources

Module file size and space restrictions

Developers and device integrators can specify the maximum number of files a module is allowed to create and the maximum amount of space the module is allowed to write. These limits can be specified in the modules CIF using the FS_Quota primitive. For example:

include "testmaxmin.bid"

-- Include Directory = C:\Temp\testmaxmin


Applet { 
    appletid       =AEECLSID_testmaxmin,
    resbaseid      =20,
    applethostid   =  0,
    type           =  0,
}

ModRsc {
    name  ="IDS_STRING_20", 
    id    = 20,
    type  = 1,
    data  =EncStringRscData(0xFF, "testmaxmin"),
}

FS_Quota { 
    max_files =9999, 
    max_space =1111, 
}

For more information on max_files and max_space, see the Resource File and Markup Reference in http://developer.brewmp.com/resources and IFILEMGR_GetFileUseInfo() and AEEFileUseInfo in the http://developer.brewmp.com/reference/api-all.

Shared directories

Brew MP tracks files in a shared directory by associating each file with a list of ClassIDs accessing the file. The list is persistent, stored separately, and not visible to the user. IFILEMGR_Use() adds the ClassID to this list and IFILEMGR_UnUse() removes ClassID from the list. When the last ClassID is deleted from the list, the file is removed.

How Brew MP uses the CIF information

When Brew MP starts up, it enumerates all the MIFs in the application directory and looks for the max_files and max_space primitives in the following order:

  1. Looks in the CIFs/MIFs. If max_files or max_space parameters exist, uses CIF/MIF settings and ignores any other settings.
  2. If these parameters are set to zero, Brew MP checks to see if the manufacturer has specified them. (in case of the Simulator, the device pack specifies these parameters in IDS_DD_MAX_FILES_IN_MOD and IDS_DD_MAX_BYTES_IN_MOD ). If so, those settings are used. If the manufacturer has not specified these parameters, Brew MP uses the maximum values from the range, which essentially disables this feature.
  3. If the parameters are not specified in the CIF/MIF, Brew MP uses the maximum values from the range, which essentially disables this feature.

Note: When an application is run on the Simulator, in the application directory, the application DLL size is divided by ten to make it comparable to the ARM binary (MOD file). The DLL is assumed to be built in debug mode.