Ejemplo n.º 1
0
static void i51RunBootApp( iBOOL results )
{
    extern const unsigned char* i51SapGetAppBoot(void);
    extern const int i51SapGetAppBootSize(void);
    U16 filename[256];

    if(!results) return;

    
    kal_wsprintf( filename, "%c:\\i51CALLTIME", FS_GetDrive(FS_DRIVE_V_REMOVABLE, 1, FS_NO_ALT_DRIVE) );
    if (FS_GetAttributes (filename) >= 0)  
        i51SapAppBootPara[0]= 60; 
    else {
        kal_wsprintf( filename, "C:\\i51CALLTIME" );
        if (FS_GetAttributes (filename) >= 0) 
            i51SapAppBootPara[0]= 60; 
    } 

	i51KernelRunStaticApp ( L"AppBoot" , (unsigned char* )i51SapGetAppBoot () , (unsigned int )i51SapGetAppBootSize () , i51SapAppBootPara, 1, 0 ) ;	
}
Ejemplo n.º 2
0
/*****************************************************************************
 * FUNCTION
 *  PmgFmgrDelExtMelodyFunc
 * DESCRIPTION
 *  
 * PARAMETERS
 *  pathfileName        [?]         
 *  action              [IN]        
 * RETURNS
 *  
 *****************************************************************************/
BOOL PmgFmgrDelExtMelodyFunc(S8 *pathfileName, PMG_DELFILE_ACTION action)      /* Finally, call PmgDelExtMelodyBySlot() */
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    BOOL res = MMI_TRUE;
    U16 c;
    S32 len1, idx;
    S8 *path;
    BOOL shortmark = FALSE;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    switch (action)
    {
        case PMG_FMGR_DEL_CERTAIN:
            res = PmgDelExtMelodyByPathFileName(pathfileName);
            break;
        case PMG_FMGR_DEL_ALL:
        {
            U8 i;
            S8 buf[MAX_EXT_MELODY_FULLNAME_WIDTH];

            /* check deleted file path */
            if ((len1 = mmi_ucs2strlen(pathfileName)) < 2) // at least <drive>:
                break;

            /* check if the last char "\" and don't count it in length */
            idx = (len1 - 1) << 1;
            c = (U16)(pathfileName[idx] | (pathfileName[idx+1]<<8));
            if (c == L'\\')
                len1--; // skip the last "\" char
                
            for (i = 0; i < MAXIMUM_EXT_MELODY_NUM; i++)
            {
                if(IS_EXTMELODY_SHORTNAME(gPmgExtMelodyInfo.info[i].filepath))
                {
                    UNMARK_EXTMELODY_SHORTNAME(gPmgExtMelodyInfo.info[i].filepath);
                    shortmark = TRUE;
                }
                path = (S8*)gPmgExtMelodyInfo.info[i].filepath;
                if(mmi_ucs2ncmp(pathfileName, path, len1) == 0)
                {
                    PmgConstructPathFileName(
                        buf,
                        sizeof(buf),
                        (S8*) gPmgExtMelodyInfo.info[i].filepath,
                        (S8*) gPmgExtMelodyInfo.info[i].filename);
                    
                    if(FS_GetAttributes((PU16)buf) < 0 )
                    {
                        if (PmgDelExtMelodyById(gPmgExtMelodyInfo.info[i].id) == MMI_FALSE)
                        {
                            res = MMI_FALSE;
                            if(shortmark)
                            {
                                MARK_EXTMELODY_SHORTNAME(gPmgExtMelodyInfo.info[i].filepath);
                            }
                        }
                    }
                }
                else
                {
                    if(shortmark)
                    {
                        MARK_EXTMELODY_SHORTNAME(gPmgExtMelodyInfo.info[i].filepath);  
                    }
                }
            }
            break;
        }
        default:
            PMG_ASSERT(0);
            break;
    }
    return res;
}